@sap/ux-specification 1.144.0 → 1.144.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
- package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
- package/dist/documentation/v2/v2-ListReport.html +2 -2
- package/dist/documentation/v2/v2-ListReportNew.html +2 -2
- package/dist/documentation/v2/v2-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
- package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
- package/dist/documentation/v4/v4-FreestylePage.html +2 -2
- package/dist/documentation/v4/v4-ListReport.html +2 -2
- package/dist/documentation/v4/v4-ObjectPage.html +2 -2
- package/dist/index-min.js +340 -330
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/ListReportNewConfig.json +208 -7
- package/dist/schemas/v4/ApplicationV4.json +14 -0
- package/dist/schemas/v4/BuildingBlocksConfig.json +384 -43
- package/dist/schemas/v4/ObjectPageConfig.json +112 -728
- package/dist/specification/package.json +11 -10
- package/dist/specification/scripts/generate-validity-report.js +1 -1
- package/dist/specification/scripts/generate-validity-report.js.map +1 -1
- package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +48 -1
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
- package/dist/specification/scripts/macros/schema.js +23 -10
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
- package/dist/specification/src/api.d.ts.map +1 -1
- package/dist/specification/src/api.js +39 -3
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/ftfs/ftfs.d.ts +8 -0
- package/dist/specification/src/ftfs/ftfs.d.ts.map +1 -1
- package/dist/specification/src/ftfs/ftfs.js +1 -0
- package/dist/specification/src/ftfs/ftfs.js.map +1 -1
- package/dist/specification/src/ftfs/index.d.ts +1 -1
- package/dist/specification/src/ftfs/index.d.ts.map +1 -1
- package/dist/specification/src/ftfs/index.js +2 -1
- package/dist/specification/src/ftfs/index.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.js +3 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.js.map +1 -1
- package/dist/specification/src/i18n/i18n.d.ts.map +1 -1
- package/dist/specification/src/i18n/i18n.js +2 -1
- package/dist/specification/src/i18n/i18n.js.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +8 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +10 -7
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/Decorator.d.ts +91 -0
- package/dist/specification/src/sync/common/decoration/Decorator.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/Decorator.js +139 -0
- package/dist/specification/src/sync/common/decoration/Decorator.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.d.ts +95 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.js +210 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +58 -22
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.js +23 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.d.ts +6 -48
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +26 -106
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.d.ts +4 -0
- package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.js +4 -0
- package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/interfaces.d.ts +38 -0
- package/dist/specification/src/sync/common/decoration/interfaces.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/interfaces.js +3 -0
- package/dist/specification/src/sync/common/decoration/interfaces.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.js +50 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.js +46 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.d.ts +26 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.js +77 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.js +43 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.js +68 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.d.ts +19 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.js +48 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/index.d.ts +6 -0
- package/dist/specification/src/sync/common/decoration/steps/index.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/index.js +14 -0
- package/dist/specification/src/sync/common/decoration/steps/index.js.map +1 -0
- package/dist/specification/src/sync/common/i18n.json +25 -1
- package/dist/specification/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/specification/src/sync/common/importProject.js +2 -0
- package/dist/specification/src/sync/common/importProject.js.map +1 -1
- package/dist/specification/src/sync/common/rules.d.ts +25 -0
- package/dist/specification/src/sync/common/rules.d.ts.map +1 -1
- package/dist/specification/src/sync/common/rules.js +27 -2
- package/dist/specification/src/sync/common/rules.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts +4 -5
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.js +29 -20
- package/dist/specification/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/specification/src/sync/v2/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/export.js +3 -2
- package/dist/specification/src/sync/v2/export/export.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.js +48 -19
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts +2 -0
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js +17 -6
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts +54 -6
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.js +106 -12
- package/dist/specification/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +7 -7
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.js +56 -2
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts +2 -0
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +3 -2
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.d.ts +16 -1
- package/dist/specification/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.js +30 -18
- package/dist/specification/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.js +4 -4
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.d.ts +12 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.d.ts.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.js +167 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.js.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.js +3 -3
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +60 -2
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +626 -11
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js +30 -6
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js.map +1 -1
- package/dist/specification/src/sync/v2/types.d.ts +2 -0
- package/dist/specification/src/sync/v2/types.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/types.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +25 -0
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +28 -4
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +12 -0
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +28 -3
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts +1 -2
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js +1 -2
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts +3 -5
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.js +2 -7
- package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +9 -3
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +10 -6
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +1 -2
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js +1 -2
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +11 -51
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +95 -246
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +6 -21
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +46 -37
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +1 -2
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +3 -4
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/factory.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/factory.js +2 -4
- package/dist/specification/src/sync/v4/export/factory.js.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts +1 -0
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js +212 -46
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/app.d.ts +11 -0
- package/dist/specification/src/sync/v4/generate/app.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/app.js +31 -0
- package/dist/specification/src/sync/v4/generate/app.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +13 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +93 -13
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js +4 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +29 -27
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +12 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts +32 -13
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js +103 -78
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts +13 -6
- package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/list-report/listReport.js +107 -108
- package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts +1 -2
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +162 -118
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js +20 -0
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.js +11 -50
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts +2 -4
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js +2 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +2 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +3 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +1 -302
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +0 -753
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +2 -4
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/StableIdHelper.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js +10 -4
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.d.ts +19 -0
- package/dist/specification/src/sync/v4/utils/macros.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.js +34 -0
- package/dist/specification/src/sync/v4/utils/macros.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts +22 -2
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +238 -41
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/specification/test/test-utils/utils.d.ts +1 -0
- package/dist/specification/test/test-utils/utils.d.ts.map +1 -1
- package/dist/specification/test/test-utils/utils.js +11 -0
- package/dist/specification/test/test-utils/utils.js.map +1 -1
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts +2 -2
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts.map +1 -1
- package/dist/specification/test/unit/decorators/validity-test-utils.js +6 -6
- package/dist/specification/test/unit/decorators/validity-test-utils.js.map +1 -1
- package/dist/templates/AnalyticalTableColumnsExtension.xml +3 -3
- package/dist/templates/GridTableColumnsExtension.xml +3 -3
- package/dist/templates/ResponsiveTableColumnsExtension.xml +2 -2
- package/dist/templates/TreeTableColumnsExtension.xml +4 -4
- package/dist/templates/fragment.xml +3 -3
- package/dist/templates/view.xml +3 -3
- package/dist/types/src/apiTypes.d.ts +15 -5
- package/dist/types/src/apiTypes.d.ts.map +1 -1
- package/dist/types/src/apiTypes.js +1 -0
- package/dist/types/src/apiTypes.js.map +1 -1
- package/dist/types/src/common/types.d.ts +11 -6
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +12 -7
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v4/application.d.ts +15 -0
- package/dist/types/src/v4/application.d.ts.map +1 -1
- package/dist/types/src/v4/application.js +10 -0
- package/dist/types/src/v4/application.js.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts +86 -252
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.js.map +1 -1
- package/package.json +12 -11
|
@@ -1,756 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Decorator = exports.BaseClass = exports.BaseConstruct = void 0;
|
|
7
|
-
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
8
|
-
const decoration_1 = require("../../common/decoration");
|
|
9
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
10
|
-
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
11
|
-
const utils_1 = require("./utils");
|
|
12
|
-
/**
|
|
13
|
-
* Adds a message to a schema element.
|
|
14
|
-
* Inlined to avoid circular dependency issues.
|
|
15
|
-
*
|
|
16
|
-
* @param element - The schema element to add the message to
|
|
17
|
-
* @param message - The message parameters
|
|
18
|
-
* @param message.text - The message text
|
|
19
|
-
* @param message.deletable - Whether the message is deletable (default: false)
|
|
20
|
-
*/
|
|
21
|
-
function addMessageToSchema(element, { text, deletable = false }) {
|
|
22
|
-
if (!element[ux_specification_types_1.SchemaTag.messages]) {
|
|
23
|
-
element[ux_specification_types_1.SchemaTag.messages] = [];
|
|
24
|
-
}
|
|
25
|
-
element[ux_specification_types_1.SchemaTag.messages].push({ text, deletable });
|
|
26
|
-
}
|
|
27
|
-
class BaseConstruct {
|
|
28
|
-
/**
|
|
29
|
-
* Constructor for BaseConstruct.
|
|
30
|
-
*
|
|
31
|
-
* @param settings - General settings including appSchema, app, page, and logger
|
|
32
|
-
*/
|
|
33
|
-
constructor(settings) {
|
|
34
|
-
const { app, appSchema, page, logger } = settings || {};
|
|
35
|
-
// Define properties as non-enumerable to hide them from serialization and Object.keys()
|
|
36
|
-
Object.defineProperty(this, 'appSchema', {
|
|
37
|
-
value: appSchema,
|
|
38
|
-
writable: false,
|
|
39
|
-
enumerable: false,
|
|
40
|
-
configurable: true
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(this, 'app', {
|
|
43
|
-
value: app,
|
|
44
|
-
writable: false,
|
|
45
|
-
enumerable: false,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(this, 'page', {
|
|
49
|
-
value: page,
|
|
50
|
-
writable: false,
|
|
51
|
-
enumerable: false,
|
|
52
|
-
configurable: true
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(this, 'logger', {
|
|
55
|
-
value: logger,
|
|
56
|
-
writable: false,
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Gets the general settings.
|
|
63
|
-
*
|
|
64
|
-
* @returns The general settings object
|
|
65
|
-
*/
|
|
66
|
-
getSettings() {
|
|
67
|
-
return {
|
|
68
|
-
appSchema: this.appSchema,
|
|
69
|
-
app: this.app,
|
|
70
|
-
page: this.page,
|
|
71
|
-
logger: this.logger
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.BaseConstruct = BaseConstruct;
|
|
76
|
-
class BaseClass extends BaseConstruct {
|
|
77
|
-
/**
|
|
78
|
-
* Creates an instance of BaseClass.
|
|
79
|
-
*
|
|
80
|
-
* @param settings - General settings including appSchema, app, page, and logger
|
|
81
|
-
*/
|
|
82
|
-
constructor(settings) {
|
|
83
|
-
super(settings);
|
|
84
|
-
const name = this.getClassName();
|
|
85
|
-
// Define base as non-enumerable to hide it from serialization and Object.keys()
|
|
86
|
-
Object.defineProperty(this, 'base', {
|
|
87
|
-
value: { name, definition: this.appSchema?.get().definitions?.[name] },
|
|
88
|
-
writable: true,
|
|
89
|
-
enumerable: false,
|
|
90
|
-
configurable: true
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Gets the class name.
|
|
95
|
-
*
|
|
96
|
-
* @returns The name of the class
|
|
97
|
-
*/
|
|
98
|
-
getClassName() {
|
|
99
|
-
return this.constructor.name;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Gets the base name.
|
|
103
|
-
*
|
|
104
|
-
* @returns The base name
|
|
105
|
-
*/
|
|
106
|
-
getBaseName() {
|
|
107
|
-
return this.base.name;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Gets the base definition.
|
|
111
|
-
*
|
|
112
|
-
* @returns The base definition
|
|
113
|
-
*/
|
|
114
|
-
getBase() {
|
|
115
|
-
return this.base.definition;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Creates an annotation path for schema based on entity type, term, and qualifier.
|
|
119
|
-
*
|
|
120
|
-
* @param entityTypeName - Entity type name.
|
|
121
|
-
* @param term - Annotation term.
|
|
122
|
-
* @param qualifier - Annotation qualifier (optional).
|
|
123
|
-
* @returns Annotation path based on received params
|
|
124
|
-
*/
|
|
125
|
-
createAnnotationPath(entityTypeName, term, qualifier) {
|
|
126
|
-
if (!entityTypeName) {
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
let annotationPath = `/${entityTypeName}/@${term}`;
|
|
130
|
-
if (qualifier) {
|
|
131
|
-
annotationPath += `#${qualifier}`;
|
|
132
|
-
}
|
|
133
|
-
this.getBase()[ux_specification_types_1.SchemaTag.annotationPath] = annotationPath;
|
|
134
|
-
return annotationPath;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
exports.BaseClass = BaseClass;
|
|
138
|
-
class Decorator extends BaseClass {
|
|
139
|
-
/**
|
|
140
|
-
* Creates an instance of Decorator.
|
|
141
|
-
*
|
|
142
|
-
* @param settings - General settings including appSchema, app, page, and logger
|
|
143
|
-
*/
|
|
144
|
-
constructor(settings) {
|
|
145
|
-
super(settings);
|
|
146
|
-
// Define decoratorContext as non-enumerable to hide from serialization
|
|
147
|
-
Object.defineProperty(this, 'decoratorContext', {
|
|
148
|
-
value: {},
|
|
149
|
-
writable: true,
|
|
150
|
-
enumerable: false,
|
|
151
|
-
configurable: true
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Initializes the decorator by applying all decorators to the schema definition.
|
|
156
|
-
*
|
|
157
|
-
* The decorator context is structured as:
|
|
158
|
-
* - `app`: The App configuration (from `this.app.config`, includes manifest)
|
|
159
|
-
* - `page`: The Page configuration (from `this.page.config`)
|
|
160
|
-
* - `custom`: Custom context provided by the caller.
|
|
161
|
-
*
|
|
162
|
-
* @param customContext - Optional custom context for decorator conditions.
|
|
163
|
-
* Use this for runtime-specific conditions like table state, section state, etc.
|
|
164
|
-
* @param definition - Optional custom definition to apply decorators to.
|
|
165
|
-
* If provided, decorators are applied to this definition instead of the one from appSchema.
|
|
166
|
-
* @example
|
|
167
|
-
* ```typescript
|
|
168
|
-
* // Basic initialization (app and page auto-injected)
|
|
169
|
-
* decorator.init();
|
|
170
|
-
*
|
|
171
|
-
* // With custom context for table-specific conditions
|
|
172
|
-
* decorator.init({
|
|
173
|
-
* table: { type: 'GridTable', views: [] }
|
|
174
|
-
* });
|
|
175
|
-
*
|
|
176
|
-
* // With custom definition (for dynamically created definitions)
|
|
177
|
-
* decorator.init({ table: { type: 'GridTable' } }, customTableDefinition);
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
180
|
-
init(customContext, definition) {
|
|
181
|
-
this.decoratorContext = {
|
|
182
|
-
app: this.app?.config,
|
|
183
|
-
page: this.page?.config,
|
|
184
|
-
custom: customContext
|
|
185
|
-
};
|
|
186
|
-
// @ToDo activate for actual use of minUI5Version.
|
|
187
|
-
// const minUi5Version = this.app?.getMinUI5Version();
|
|
188
|
-
this.applyDecorators(undefined, undefined, definition);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Gets property value from the decorator context using a property path.
|
|
192
|
-
*
|
|
193
|
-
* The path must include an explicit source prefix ('app', 'page', or 'custom').
|
|
194
|
-
*
|
|
195
|
-
* @param propertyPath - The property path with explicit source prefix - supports full jsonpath syntax
|
|
196
|
-
* @returns Object containing the final key and its value, or undefined if not found
|
|
197
|
-
* @example
|
|
198
|
-
* ```typescript
|
|
199
|
-
* // With decoratorContext = {
|
|
200
|
-
* // app: { manifest: { 'sap.ui5': { routing: {...} } } },
|
|
201
|
-
* // page: { isALP: true },
|
|
202
|
-
* // custom: { type: 'GridTable', items: [{ name: 'Item1' }, { name: 'Item2' }] }
|
|
203
|
-
* // }
|
|
204
|
-
* getPropertyKeyValue('page.isALP') // { key: 'isALP', value: true }
|
|
205
|
-
* getPropertyKeyValue('custom.items[0]') // { key: '0', value: { name: 'Item1' } }
|
|
206
|
-
* getPropertyKeyValue('custom.items[1].name') // { key: 'name', value: 'Item2' }
|
|
207
|
-
* getPropertyKeyValue('app.manifest["sap.ui5"]') // Access property with dot in name
|
|
208
|
-
* getPropertyKeyValue('$.app.manifest["sap.ui5"].routing') // JSONPath with root reference
|
|
209
|
-
* getPropertyKeyValue('$app["manifest"]["sap.ui5"]') // Alternative JSONPath format
|
|
210
|
-
* ```
|
|
211
|
-
*/
|
|
212
|
-
getPropertyKeyValue(propertyPath) {
|
|
213
|
-
if (!propertyPath || !this.decoratorContext) {
|
|
214
|
-
return undefined;
|
|
215
|
-
}
|
|
216
|
-
try {
|
|
217
|
-
// Ensure path starts with $ for JSONPath
|
|
218
|
-
const jsonPath = propertyPath.startsWith('$') ? propertyPath : `$.${propertyPath}`;
|
|
219
|
-
// Use JSONPath to query with resultType 'all' to get both value and metadata
|
|
220
|
-
const results = (0, jsonpath_plus_1.JSONPath)({
|
|
221
|
-
path: jsonPath,
|
|
222
|
-
json: this.decoratorContext,
|
|
223
|
-
resultType: 'all'
|
|
224
|
-
});
|
|
225
|
-
// JSONPath with resultType 'all' returns an array of result objects
|
|
226
|
-
if (!results || results.length === 0) {
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
|
-
// Get the first result (wrap: false behavior)
|
|
230
|
-
const result = results[0];
|
|
231
|
-
// parentProperty contains the last key in the path
|
|
232
|
-
const key = String(result.parentProperty);
|
|
233
|
-
const value = result.value;
|
|
234
|
-
return { key, value };
|
|
235
|
-
}
|
|
236
|
-
catch {
|
|
237
|
-
// If JSONPath fails, return undefined
|
|
238
|
-
return undefined;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Evaluates a single dependency condition.
|
|
243
|
-
*
|
|
244
|
-
* @param condition - The single condition to evaluate
|
|
245
|
-
* @param condition.path - The property path to check
|
|
246
|
-
* @param condition.dependsOn - Optional custom condition function
|
|
247
|
-
* @param condition.expectedValue - Optional expected value for equality check
|
|
248
|
-
* @param condition.negate - Optional flag to invert the condition result
|
|
249
|
-
* @returns Object containing whether condition passed and the dependency value
|
|
250
|
-
*/
|
|
251
|
-
evaluateSingleCondition(condition) {
|
|
252
|
-
// Handle special __always__ path (from @hide(true))
|
|
253
|
-
if (condition.path === '__always__') {
|
|
254
|
-
return { passed: true, value: true, key: '__always__' };
|
|
255
|
-
}
|
|
256
|
-
const result = this.getPropertyKeyValue(condition.path);
|
|
257
|
-
const key = result?.key ?? condition.path;
|
|
258
|
-
const value = result?.value;
|
|
259
|
-
let passed = false;
|
|
260
|
-
if (condition.dependsOn) {
|
|
261
|
-
// Use custom condition function
|
|
262
|
-
passed = condition.dependsOn(value);
|
|
263
|
-
}
|
|
264
|
-
else if (condition.expectedValue !== undefined) {
|
|
265
|
-
// Use simple equality check
|
|
266
|
-
passed = value === condition.expectedValue;
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
// Default: truthy check
|
|
270
|
-
passed = !!value;
|
|
271
|
-
}
|
|
272
|
-
// Apply negation if negate flag is set (from not() helper)
|
|
273
|
-
if (condition.negate) {
|
|
274
|
-
passed = !passed;
|
|
275
|
-
}
|
|
276
|
-
return { passed, value, key };
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Helper method to add a message to the schema property based on value condition.
|
|
280
|
-
*
|
|
281
|
-
* @param condition - DecoratorMetadata or EnumValueCondition object containing condition details
|
|
282
|
-
* @param syncRuleProviderInstance - The instance of the sync rule provider
|
|
283
|
-
* @param definition - The schema property definition
|
|
284
|
-
* @param i18nProperties - i18n properties for message translation
|
|
285
|
-
* @param i18nProperties.propertyName - The property name for the message
|
|
286
|
-
* @param i18nProperties.context - The context for the message
|
|
287
|
-
*/
|
|
288
|
-
addConditionalMessage(condition, syncRuleProviderInstance, definition, i18nProperties) {
|
|
289
|
-
// Handle new MessageConfig format (from msg() helper)
|
|
290
|
-
const metadata = condition;
|
|
291
|
-
if (metadata.messageConfig && (0, decoration_1.isMessageConfig)(metadata.messageConfig)) {
|
|
292
|
-
// Resolve any PathNode values in the params
|
|
293
|
-
const resolvedParams = this.resolveMessageParams(metadata.messageConfig.params);
|
|
294
|
-
const messageText = i18next_1.default.t(metadata.messageConfig.i18nKey, resolvedParams);
|
|
295
|
-
addMessageToSchema(definition, { text: messageText, deletable: metadata.messageConfig.deletable });
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
// Handle legacy DependsOnMessage format
|
|
299
|
-
if (!condition.message) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
let messageText;
|
|
303
|
-
if (typeof condition.message.text === 'function') {
|
|
304
|
-
messageText = condition.message.text(syncRuleProviderInstance);
|
|
305
|
-
}
|
|
306
|
-
else if (typeof condition.message.text === 'string') {
|
|
307
|
-
messageText = condition.message.text;
|
|
308
|
-
}
|
|
309
|
-
else if (condition.message.text === true) {
|
|
310
|
-
// true means use default i18n translation
|
|
311
|
-
messageText = i18next_1.default.t('PROPERTY_NOT_ALLOWED', { ...i18nProperties });
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
messageText = i18next_1.default.t('PROPERTY_NOT_ALLOWED', { ...i18nProperties });
|
|
315
|
-
}
|
|
316
|
-
addMessageToSchema(definition, { text: messageText, deletable: condition.message.deletable });
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Resolves PathNode values in message params to their actual values from the decorator context.
|
|
320
|
-
*
|
|
321
|
-
* @param params - The message params potentially containing PathNode values
|
|
322
|
-
* @returns The params with PathNode values resolved to actual values
|
|
323
|
-
*/
|
|
324
|
-
resolveMessageParams(params) {
|
|
325
|
-
if (!params) {
|
|
326
|
-
return params;
|
|
327
|
-
}
|
|
328
|
-
const resolved = {};
|
|
329
|
-
for (const [key, value] of Object.entries(params)) {
|
|
330
|
-
if ((0, decoration_1.isPathNode)(value)) {
|
|
331
|
-
// Resolve PathNode to actual value
|
|
332
|
-
const result = this.getPropertyKeyValue((0, decoration_1.getPath)(value));
|
|
333
|
-
resolved[key] = result?.value ?? '';
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
resolved[key] = value;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
return resolved;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Gets the context message from evaluation results.
|
|
343
|
-
*
|
|
344
|
-
* @param results - The evaluation results
|
|
345
|
-
* @returns The context message string
|
|
346
|
-
*/
|
|
347
|
-
getContextForMessage(results) {
|
|
348
|
-
return results
|
|
349
|
-
.filter((result) => !result.passed)
|
|
350
|
-
.map((result) => `${result.key}: ${result.value}`)
|
|
351
|
-
.join(', ');
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Evaluates an AND condition item which can be either a single condition or a nested OR group.
|
|
355
|
-
*
|
|
356
|
-
* @param conditionItem - The condition item to evaluate
|
|
357
|
-
* @returns Object containing whether condition passed and evaluation details
|
|
358
|
-
*/
|
|
359
|
-
evaluateAndConditionItem(conditionItem) {
|
|
360
|
-
// Check if this is a nested OR group
|
|
361
|
-
if ((0, decoration_1.isOrConditionGroup)(conditionItem)) {
|
|
362
|
-
// Evaluate the nested OR - at least one must pass
|
|
363
|
-
return this.evaluateOrConditions(conditionItem.__orConditions);
|
|
364
|
-
}
|
|
365
|
-
// It's a single condition
|
|
366
|
-
const result = this.evaluateSingleCondition(conditionItem);
|
|
367
|
-
return { passed: result.passed, results: [result] };
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Evaluates OR conditions (at least one condition must match).
|
|
371
|
-
* Supports both single conditions and nested AND groups.
|
|
372
|
-
*
|
|
373
|
-
* @param orConditions - Array of condition items (single conditions or AND groups)
|
|
374
|
-
* @returns Object containing whether any condition passed and evaluation details
|
|
375
|
-
*/
|
|
376
|
-
evaluateOrConditions(orConditions) {
|
|
377
|
-
const allResults = [];
|
|
378
|
-
for (const conditionItem of orConditions) {
|
|
379
|
-
// Check if this is a nested AND group
|
|
380
|
-
if ((0, decoration_1.isAndConditionGroup)(conditionItem)) {
|
|
381
|
-
// Evaluate all conditions in the AND group - all must pass
|
|
382
|
-
const andResults = [];
|
|
383
|
-
let allAndPassed = true;
|
|
384
|
-
for (const andItem of conditionItem.__andConditions) {
|
|
385
|
-
const { passed, results } = this.evaluateAndConditionItem(andItem);
|
|
386
|
-
andResults.push(...results);
|
|
387
|
-
if (!passed) {
|
|
388
|
-
allAndPassed = false;
|
|
389
|
-
// Don't break - we want all results for context
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
allResults.push(...andResults);
|
|
393
|
-
if (allAndPassed) {
|
|
394
|
-
// Short-circuit: if this AND group passes, the OR passes
|
|
395
|
-
return { passed: true, results: allResults };
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
// Single condition (symmetric with AND handling)
|
|
400
|
-
const result = this.evaluateSingleCondition(conditionItem);
|
|
401
|
-
allResults.push(result);
|
|
402
|
-
if (result.passed) {
|
|
403
|
-
// Short-circuit: if any condition passes, the OR passes
|
|
404
|
-
return { passed: true, results: allResults };
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return { passed: false, results: allResults };
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Evaluates AND conditions (all conditions must match).
|
|
412
|
-
* Supports both single conditions and nested OR groups.
|
|
413
|
-
*
|
|
414
|
-
* @param andConditions - Array of condition items (single conditions or OR groups)
|
|
415
|
-
* @returns Object containing whether all conditions passed and evaluation details
|
|
416
|
-
*/
|
|
417
|
-
evaluateAndConditions(andConditions) {
|
|
418
|
-
const allResults = [];
|
|
419
|
-
let allPassed = true;
|
|
420
|
-
for (const conditionItem of andConditions) {
|
|
421
|
-
const { passed, results } = this.evaluateAndConditionItem(conditionItem);
|
|
422
|
-
allResults.push(...results);
|
|
423
|
-
if (!passed) {
|
|
424
|
-
allPassed = false;
|
|
425
|
-
// Continue to collect all results for context
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return { passed: allPassed, results: allResults };
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Evaluates condition metadata and returns whether the condition is met and the context.
|
|
432
|
-
*
|
|
433
|
-
* @param conditionInfo - The condition metadata
|
|
434
|
-
* @returns Object with passed (boolean) and context (string)
|
|
435
|
-
*/
|
|
436
|
-
evaluateCondition(conditionInfo) {
|
|
437
|
-
let passed = false;
|
|
438
|
-
let context = '';
|
|
439
|
-
if (conditionInfo.orConditions && Array.isArray(conditionInfo.orConditions)) {
|
|
440
|
-
// OR logic: At least one condition object must match
|
|
441
|
-
const result = this.evaluateOrConditions(conditionInfo.orConditions);
|
|
442
|
-
passed = result.passed;
|
|
443
|
-
context = this.getContextForMessage(result.results);
|
|
444
|
-
}
|
|
445
|
-
else if (conditionInfo.conditions && Array.isArray(conditionInfo.conditions)) {
|
|
446
|
-
// Multi-condition: ALL must be met (AND logic)
|
|
447
|
-
// Now supports nested OR groups via evaluateAndConditions
|
|
448
|
-
const result = this.evaluateAndConditions(conditionInfo.conditions);
|
|
449
|
-
passed = result.passed;
|
|
450
|
-
context = this.getContextForMessage(result.results);
|
|
451
|
-
}
|
|
452
|
-
else if (conditionInfo.path) {
|
|
453
|
-
// Single condition
|
|
454
|
-
const result = this.evaluateSingleCondition(conditionInfo);
|
|
455
|
-
passed = result.passed;
|
|
456
|
-
context = this.getContextForMessage([result]);
|
|
457
|
-
}
|
|
458
|
-
return { passed, context };
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Iterates over schema properties and yields property info for decorator processing.
|
|
462
|
-
* Centralizes the guard clause and property iteration logic.
|
|
463
|
-
*
|
|
464
|
-
* @param schemaDefinition - The schema definition to process
|
|
465
|
-
* @param target - The target object (used for guard clause validation)
|
|
466
|
-
* @yields Property name and definition for each property in the schema
|
|
467
|
-
*/
|
|
468
|
-
*iterateProperties(schemaDefinition, target) {
|
|
469
|
-
if (!schemaDefinition?.properties || !target) {
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
for (const propertyName in schemaDefinition.properties) {
|
|
473
|
-
const property = schemaDefinition.properties[propertyName];
|
|
474
|
-
yield { propertyName, property };
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Applies the hide decorator to the schema definition.
|
|
479
|
-
* Hides properties when their condition evaluates to true, but only if
|
|
480
|
-
* the message decorator did not add any messages to the property.
|
|
481
|
-
*
|
|
482
|
-
* @param schemaDefinition - The schema definition to apply the decorator to
|
|
483
|
-
* @param syncRuleProviderInstance - The sync rule provider instance
|
|
484
|
-
*/
|
|
485
|
-
applyHideDecorator(schemaDefinition, syncRuleProviderInstance) {
|
|
486
|
-
for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
|
|
487
|
-
const hideInfo = (0, decoration_1.getHideMetadata)(syncRuleProviderInstance, propertyName);
|
|
488
|
-
if (hideInfo) {
|
|
489
|
-
const { passed } = this.evaluateCondition(hideInfo);
|
|
490
|
-
// Hide when condition IS met (passed=true means hide)
|
|
491
|
-
// But only if no messages were added by the message decorator
|
|
492
|
-
const hasMessages = Array.isArray(property[ux_specification_types_1.SchemaTag.messages]) && property[ux_specification_types_1.SchemaTag.messages].length > 0;
|
|
493
|
-
if (passed && !hasMessages) {
|
|
494
|
-
property[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* Applies the message decorator to the schema definition.
|
|
501
|
-
* Shows messages when their condition evaluates to true.
|
|
502
|
-
*
|
|
503
|
-
* @param schemaDefinition - The schema definition to apply the decorator to
|
|
504
|
-
* @param syncRuleProviderInstance - The sync rule provider instance
|
|
505
|
-
*/
|
|
506
|
-
applyMessageDecorator(schemaDefinition, syncRuleProviderInstance) {
|
|
507
|
-
for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
|
|
508
|
-
const messageInfoList = (0, decoration_1.getMessageMetadata)(syncRuleProviderInstance, propertyName);
|
|
509
|
-
if (messageInfoList) {
|
|
510
|
-
for (const messageInfo of messageInfoList) {
|
|
511
|
-
const { passed, context } = this.evaluateCondition(messageInfo);
|
|
512
|
-
if (passed && (messageInfo.message || messageInfo.messageConfig)) {
|
|
513
|
-
this.addConditionalMessage(messageInfo, syncRuleProviderInstance, property, {
|
|
514
|
-
propertyName,
|
|
515
|
-
context
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
/**
|
|
523
|
-
* Applies the readonly decorator to the schema definition.
|
|
524
|
-
* Marks properties as readonly when their condition evaluates to true.
|
|
525
|
-
*
|
|
526
|
-
* @param schemaDefinition - The schema definition to apply the decorator to
|
|
527
|
-
* @param syncRuleProviderInstance - The sync rule provider instance
|
|
528
|
-
*/
|
|
529
|
-
applyReadonlyDecorator(schemaDefinition, syncRuleProviderInstance) {
|
|
530
|
-
for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
|
|
531
|
-
const readonlyInfo = (0, decoration_1.getReadonlyMetadata)(syncRuleProviderInstance, propertyName);
|
|
532
|
-
if (readonlyInfo) {
|
|
533
|
-
const { passed } = this.evaluateCondition(readonlyInfo);
|
|
534
|
-
if (passed) {
|
|
535
|
-
property.readOnly = true;
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Applies the enums decorator to the schema definition.
|
|
542
|
-
* Restricts enum values when their condition evaluates to true.
|
|
543
|
-
* If multiple @enums decorators exist on the same property, the first matching condition wins.
|
|
544
|
-
*
|
|
545
|
-
* @param schemaDefinition - The schema definition to apply the decorator to
|
|
546
|
-
* @param syncRuleProviderInstance - The sync rule provider instance
|
|
547
|
-
*/
|
|
548
|
-
applyEnumsDecorator(schemaDefinition, syncRuleProviderInstance) {
|
|
549
|
-
for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
|
|
550
|
-
const enumsMetadataList = (0, decoration_1.getEnumsMetadata)(syncRuleProviderInstance, propertyName);
|
|
551
|
-
if (!enumsMetadataList?.length) {
|
|
552
|
-
continue;
|
|
553
|
-
}
|
|
554
|
-
// Find first matching condition (first match wins)
|
|
555
|
-
for (const enumsMetadata of enumsMetadataList) {
|
|
556
|
-
const { passed } = this.evaluateCondition(enumsMetadata);
|
|
557
|
-
if (passed) {
|
|
558
|
-
const currentEnumValues = this.resolveEnumFromProperty(property);
|
|
559
|
-
if (currentEnumValues) {
|
|
560
|
-
// Filter to only allowed values that exist in original enum
|
|
561
|
-
const filteredValues = enumsMetadata.allowedValues.filter((v) => currentEnumValues.includes(v));
|
|
562
|
-
this.applyFilteredEnumToProperty(property, filteredValues);
|
|
563
|
-
}
|
|
564
|
-
break; // First match wins, stop processing
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Gets the validity metadata for a property.
|
|
571
|
-
*
|
|
572
|
-
* @param target - The target object
|
|
573
|
-
* @param propertyName - The property name
|
|
574
|
-
* @returns The validity metadata or undefined
|
|
575
|
-
*/
|
|
576
|
-
getValidityMetadata(target, propertyName) {
|
|
577
|
-
let validityInfo;
|
|
578
|
-
if (target) {
|
|
579
|
-
validityInfo = Reflect.getMetadata(decoration_1.metadataKeys.validity, target, propertyName);
|
|
580
|
-
}
|
|
581
|
-
return validityInfo;
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* Resolves an enum array from a property definition.
|
|
585
|
-
* Handles both inline enums and $ref to enum definitions.
|
|
586
|
-
*
|
|
587
|
-
* @param property - The property definition
|
|
588
|
-
* @returns The enum array or undefined if not found
|
|
589
|
-
*/
|
|
590
|
-
resolveEnumFromProperty(property) {
|
|
591
|
-
// Check for inline enum
|
|
592
|
-
if (property?.enum && Array.isArray(property.enum)) {
|
|
593
|
-
return property.enum;
|
|
594
|
-
}
|
|
595
|
-
// Check for $ref to an enum definition
|
|
596
|
-
if (property?.$ref) {
|
|
597
|
-
const refName = property.$ref.replace('#/definitions/', '');
|
|
598
|
-
const schema = this.appSchema?.get();
|
|
599
|
-
const refDef = schema?.definitions?.[refName];
|
|
600
|
-
if (refDef?.enum && Array.isArray(refDef.enum)) {
|
|
601
|
-
return refDef.enum;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
return undefined;
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Applies filtered enum values to a property.
|
|
608
|
-
* For $ref properties, inlines the filtered enum, copies the type from the referenced definition, and removes the $ref.
|
|
609
|
-
* For inline enum properties, updates the enum directly.
|
|
610
|
-
*
|
|
611
|
-
* @param property - The property definition to update
|
|
612
|
-
* @param filteredEnum - The filtered enum values
|
|
613
|
-
*/
|
|
614
|
-
applyFilteredEnumToProperty(property, filteredEnum) {
|
|
615
|
-
if (property.$ref) {
|
|
616
|
-
// For $ref properties, resolve the referenced definition to get the type
|
|
617
|
-
const refName = property.$ref.replace('#/definitions/', '');
|
|
618
|
-
const schema = this.appSchema?.get();
|
|
619
|
-
const refDef = schema?.definitions?.[refName];
|
|
620
|
-
// Copy the type from the referenced definition if it exists
|
|
621
|
-
if (refDef?.type) {
|
|
622
|
-
property.type = refDef.type;
|
|
623
|
-
}
|
|
624
|
-
// Remove the $ref and inline the filtered enum
|
|
625
|
-
delete property.$ref;
|
|
626
|
-
property.enum = filteredEnum;
|
|
627
|
-
}
|
|
628
|
-
else {
|
|
629
|
-
// For inline enum properties, update directly
|
|
630
|
-
property.enum = filteredEnum;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* Applies the validity decorator to the schema definition based on the sync rule provider instance and minimum UI5 version.
|
|
635
|
-
*
|
|
636
|
-
* @param schemaDefinition The schema definition to apply the validity decorator to
|
|
637
|
-
* @param syncRuleProviderInstance The instance of the sync rule provider
|
|
638
|
-
* @param minUI5Version The minimum UI5 version to consider for validity checks
|
|
639
|
-
*/
|
|
640
|
-
applyValidityDecorator(schemaDefinition, syncRuleProviderInstance, minUI5Version) {
|
|
641
|
-
if (!schemaDefinition?.properties || !syncRuleProviderInstance || !minUI5Version) {
|
|
642
|
-
return;
|
|
643
|
-
}
|
|
644
|
-
for (const propertyName in schemaDefinition.properties) {
|
|
645
|
-
const property = schemaDefinition.properties[propertyName];
|
|
646
|
-
const validityInfo = this.getValidityMetadata(syncRuleProviderInstance, propertyName);
|
|
647
|
-
// Check if property has a 'since' requirement that exceeds the app's minUI5Version
|
|
648
|
-
if (validityInfo?.since && !(0, utils_1.compareUI5Versions)(minUI5Version, validityInfo.since)) {
|
|
649
|
-
property[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
650
|
-
// possible message?
|
|
651
|
-
}
|
|
652
|
-
// Process enum validity configuration from @validity decorator
|
|
653
|
-
// Supports both inline enums and $ref to enum definitions
|
|
654
|
-
if (validityInfo?.enum) {
|
|
655
|
-
const enumValues = this.resolveEnumFromProperty(property);
|
|
656
|
-
if (enumValues) {
|
|
657
|
-
const filteredEnum = enumValues.filter((enumValue) => {
|
|
658
|
-
const enumValueStr = String(enumValue);
|
|
659
|
-
const condition = validityInfo.enum[enumValueStr];
|
|
660
|
-
if (!condition) {
|
|
661
|
-
return true; // Keep values without conditions
|
|
662
|
-
}
|
|
663
|
-
// Check UI5 version requirement (if specified)
|
|
664
|
-
if (condition.since && minUI5Version) {
|
|
665
|
-
if (!(0, utils_1.compareUI5Versions)(minUI5Version, condition.since)) {
|
|
666
|
-
if (condition.message) {
|
|
667
|
-
this.addConditionalMessage(condition, syncRuleProviderInstance, property, {
|
|
668
|
-
propertyName: enumValueStr
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
return false; // Version requirement not met
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
// Check property dependency using dependsOn function
|
|
675
|
-
if (condition.dependsOn) {
|
|
676
|
-
if (!condition.dependsOn(syncRuleProviderInstance)) {
|
|
677
|
-
if (condition.message) {
|
|
678
|
-
this.addConditionalMessage(condition, syncRuleProviderInstance, property, {
|
|
679
|
-
propertyName: enumValueStr
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
return false; // Dependency condition not met
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
return true;
|
|
686
|
-
});
|
|
687
|
-
// Only update if enum was actually filtered
|
|
688
|
-
if (filteredEnum.length !== enumValues.length) {
|
|
689
|
-
this.applyFilteredEnumToProperty(property, filteredEnum);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* Applies the isViewNode decorator to the schema definition based on the target and property name.
|
|
697
|
-
*
|
|
698
|
-
* @param schemaDefinition The schema definition to apply the isViewNode decorator to
|
|
699
|
-
* @param target The target object or function
|
|
700
|
-
* @param propertyName The property name (optional)
|
|
701
|
-
*/
|
|
702
|
-
applyIsViewNodeDecorator(schemaDefinition, target, propertyName) {
|
|
703
|
-
const isViewNode = Reflect.getMetadata(decoration_1.metadataKeys.isViewNode, target, propertyName);
|
|
704
|
-
if (isViewNode !== undefined) {
|
|
705
|
-
schemaDefinition[ux_specification_types_1.SchemaTag.isViewNode] = isViewNode;
|
|
706
|
-
schemaDefinition.properties = schemaDefinition.properties || {};
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Applies the description decorator to the schema definition.
|
|
711
|
-
*
|
|
712
|
-
* @param schemaDefinition - The schema definition to apply the decorator to
|
|
713
|
-
* @param target - The target object or function
|
|
714
|
-
* @param propertyName - The property name (optional)
|
|
715
|
-
*/
|
|
716
|
-
applyDescriptionDecorator(schemaDefinition, target, propertyName) {
|
|
717
|
-
const description = Reflect.getMetadata(decoration_1.metadataKeys.description, target, propertyName);
|
|
718
|
-
if (description !== undefined) {
|
|
719
|
-
schemaDefinition.description = description;
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Applies all decorators to the schema definition.
|
|
724
|
-
*
|
|
725
|
-
* @param minUi5Version - The minimum UI5 version (optional)
|
|
726
|
-
* @param propertyName - The property name (optional)
|
|
727
|
-
* @param customDefinition - Optional custom definition to apply decorators to (overrides getBase())
|
|
728
|
-
* @returns Object containing the definition
|
|
729
|
-
*/
|
|
730
|
-
applyDecorators(minUi5Version, propertyName, customDefinition) {
|
|
731
|
-
const definition = customDefinition ?? this.getBase();
|
|
732
|
-
if (!definition) {
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
const target = propertyName ? this : this.constructor;
|
|
736
|
-
// Apply description decorator
|
|
737
|
-
this.applyDescriptionDecorator(definition, target, propertyName);
|
|
738
|
-
// Apply isViewNode decorator
|
|
739
|
-
this.applyIsViewNodeDecorator(definition, target, propertyName);
|
|
740
|
-
// Apply validity decorator (for properties)
|
|
741
|
-
this.applyValidityDecorator(definition, this, minUi5Version);
|
|
742
|
-
// Apply enums decorator - filter enum values based on conditions
|
|
743
|
-
this.applyEnumsDecorator(definition, this);
|
|
744
|
-
// Apply message decorator - show messages based on conditions
|
|
745
|
-
// NOTE: Message decorator must run before hide decorator so hide can check for messages
|
|
746
|
-
this.applyMessageDecorator(definition, this);
|
|
747
|
-
// Apply hide decorator - hide properties based on conditions
|
|
748
|
-
// NOTE: Only hides if message decorator did not add any messages
|
|
749
|
-
this.applyHideDecorator(definition, this);
|
|
750
|
-
// Apply readonly decorator - mark properties as readonly based on conditions
|
|
751
|
-
this.applyReadonlyDecorator(definition, this);
|
|
752
|
-
return { definition };
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
exports.Decorator = Decorator;
|
|
756
3
|
//# sourceMappingURL=DecoratorClass.js.map
|