@sap/ux-specification 1.142.5 → 1.144.1
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 +26 -160
- 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 +312 -317
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/AnalyticalListPageConfig.json +18 -0
- package/dist/schemas/v2/ListReportConfig.json +30 -0
- package/dist/schemas/v2/ListReportNewConfig.json +7 -202
- package/dist/schemas/v2/ObjectPageConfig.json +30 -0
- package/dist/schemas/v4/ApplicationV4.json +5 -13
- package/dist/schemas/v4/BuildingBlocksConfig.json +2094 -1618
- package/dist/schemas/v4/ObjectPageConfig.json +734 -112
- package/dist/specification/package.json +10 -9
- 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 +18 -24
- 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 +10 -23
- 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 +9 -45
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/ftfs/ftfs.d.ts +0 -8
- package/dist/specification/src/ftfs/ftfs.d.ts.map +1 -1
- package/dist/specification/src/ftfs/ftfs.js +0 -1
- 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 +1 -2
- 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 +1 -3
- package/dist/specification/src/ftfs/parser/model/TreeModel.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +22 -58
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.js +1 -23
- package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.d.ts +8 -0
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +15 -0
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.d.ts +0 -4
- package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.js +0 -4
- package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +1 -0
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +0 -25
- package/dist/specification/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/specification/src/sync/common/importProject.js +3 -3
- package/dist/specification/src/sync/common/importProject.js.map +1 -1
- package/dist/specification/src/sync/common/rules.d.ts +1 -1
- package/dist/specification/src/sync/common/rules.js +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts +5 -4
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.js +20 -29
- package/dist/specification/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts +1 -0
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.js +25 -40
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Table.d.ts +1 -0
- package/dist/specification/src/sync/v2/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Table.js +24 -34
- package/dist/specification/src/sync/v2/export/controls/Table.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 +2 -3
- 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 +19 -48
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js +6 -17
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts +6 -54
- 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 +12 -106
- package/dist/specification/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +15 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/generate.d.ts +6 -3
- package/dist/specification/src/sync/v2/generate/generate.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/generate.js +12 -7
- package/dist/specification/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.js +2 -0
- package/dist/specification/src/sync/v2/generate/listReport.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 +20 -6
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +2 -2
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.d.ts +19 -0
- package/dist/specification/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.js +75 -0
- 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/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 +2 -59
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +7 -582
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +0 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +0 -1
- 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 +14 -29
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js.map +1 -1
- package/dist/specification/src/sync/v2/types.d.ts +0 -2
- 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 +0 -25
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +4 -28
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +1 -1
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +2 -2
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js +2 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts +5 -3
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.js +7 -2
- package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +3 -9
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +6 -10
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js +2 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +51 -11
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +246 -95
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +27 -6
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +38 -11
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +2 -1
- 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 +4 -2
- package/dist/specification/src/sync/v4/export/factory.js.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts +0 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js +46 -212
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/export/pages/ObjectPage.d.ts +1 -0
- package/dist/specification/src/sync/v4/export/pages/ObjectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/pages/ObjectPage.js +11 -0
- package/dist/specification/src/sync/v4/export/pages/ObjectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +0 -13
- 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 +2 -74
- 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.js +5 -5
- 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 +39 -29
- 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 +3 -12
- 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 +13 -32
- 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 +78 -103
- 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 +4 -7
- 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 +19 -34
- package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts +2 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +95 -136
- 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 +0 -20
- 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 +50 -11
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts +4 -2
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js +1 -2
- package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +1 -2
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +1 -3
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +294 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +753 -0
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +4 -2
- 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 +4 -10
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.d.ts +0 -19
- package/dist/specification/src/sync/v4/utils/macros.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.js +0 -34
- package/dist/specification/src/sync/v4/utils/macros.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts +4 -24
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +43 -240
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/specification/test/test-utils/utils.d.ts +1 -2
- package/dist/specification/test/test-utils/utils.d.ts.map +1 -1
- package/dist/specification/test/test-utils/utils.js +18 -26
- 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 +9 -15
- package/dist/types/src/apiTypes.d.ts.map +1 -1
- package/dist/types/src/apiTypes.js +0 -1
- package/dist/types/src/apiTypes.js.map +1 -1
- package/dist/types/src/common/types.d.ts +13 -11
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +7 -12
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts +4 -0
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v2/controls/Table.d.ts +4 -0
- package/dist/types/src/v2/controls/Table.d.ts.map +1 -1
- package/dist/types/src/v4/application.d.ts +4 -13
- package/dist/types/src/v4/application.d.ts.map +1 -1
- package/dist/types/src/v4/application.js +0 -10
- package/dist/types/src/v4/application.js.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts +252 -86
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.js.map +1 -1
- package/dist/types/src/v4/pages/ObjectPageConfigV4.d.ts +4 -0
- package/dist/types/src/v4/pages/ObjectPageConfigV4.d.ts.map +1 -1
- package/package.json +10 -9
- package/dist/specification/src/sync/common/decoration/Decorator.d.ts +0 -91
- package/dist/specification/src/sync/common/decoration/Decorator.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/Decorator.js +0 -139
- package/dist/specification/src/sync/common/decoration/Decorator.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/condition-evaluator.d.ts +0 -95
- package/dist/specification/src/sync/common/decoration/condition-evaluator.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/condition-evaluator.js +0 -210
- package/dist/specification/src/sync/common/decoration/condition-evaluator.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/interfaces.d.ts +0 -38
- package/dist/specification/src/sync/common/decoration/interfaces.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/interfaces.js +0 -3
- package/dist/specification/src/sync/common/decoration/interfaces.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts +0 -18
- package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Enums.js +0 -50
- package/dist/specification/src/sync/common/decoration/steps/Enums.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Hide.d.ts +0 -18
- package/dist/specification/src/sync/common/decoration/steps/Hide.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Hide.js +0 -46
- package/dist/specification/src/sync/common/decoration/steps/Hide.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Message.d.ts +0 -26
- package/dist/specification/src/sync/common/decoration/steps/Message.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Message.js +0 -77
- package/dist/specification/src/sync/common/decoration/steps/Message.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Readonly.d.ts +0 -18
- package/dist/specification/src/sync/common/decoration/steps/Readonly.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Readonly.js +0 -43
- package/dist/specification/src/sync/common/decoration/steps/Readonly.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Validity.d.ts +0 -18
- package/dist/specification/src/sync/common/decoration/steps/Validity.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/Validity.js +0 -68
- package/dist/specification/src/sync/common/decoration/steps/Validity.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.d.ts +0 -19
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.js +0 -48
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.js.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/index.d.ts +0 -6
- package/dist/specification/src/sync/common/decoration/steps/index.d.ts.map +0 -1
- package/dist/specification/src/sync/common/decoration/steps/index.js +0 -14
- package/dist/specification/src/sync/common/decoration/steps/index.js.map +0 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.d.ts +0 -12
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.d.ts.map +0 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.js +0 -167
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiEdit.js.map +0 -1
- package/dist/specification/src/sync/v4/generate/app.d.ts +0 -11
- package/dist/specification/src/sync/v4/generate/app.d.ts.map +0 -1
- package/dist/specification/src/sync/v4/generate/app.js +0 -31
- package/dist/specification/src/sync/v4/generate/app.js.map +0 -1
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Decorator = void 0;
|
|
4
|
-
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
5
|
-
const decorators_1 = require("./decorators");
|
|
6
|
-
const steps_1 = require("./steps");
|
|
7
|
-
/**
|
|
8
|
-
* Default steps executed in order.
|
|
9
|
-
* Order: enums -> message -> hide
|
|
10
|
-
* Validity is opt-in - add new Validity() to steps to enable it.
|
|
11
|
-
* TODO: add @validity for general enablement
|
|
12
|
-
*/
|
|
13
|
-
const DEFAULT_STEPS = [new steps_1.Enums(), new steps_1.Message(), new steps_1.Hide()];
|
|
14
|
-
/**
|
|
15
|
-
* Decorator processor - applies decorator metadata to schema definitions.
|
|
16
|
-
*
|
|
17
|
-
* This class processes decorator annotations (@hide, @message, @enums, @validity)
|
|
18
|
-
* through a configurable pipeline of steps.
|
|
19
|
-
*
|
|
20
|
-
* If the target class defines an `init(context: DecoratorContext)` method, it will be
|
|
21
|
-
* called automatically after all steps have been executed.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* // Define a class with decorators (no base class needed)
|
|
26
|
-
* class TableSettings implements v4.TableSettings {
|
|
27
|
-
* @hide(when(tableContext.type, 'AnalyticalTable'))
|
|
28
|
-
* @validity({ since: '1.84.0' })
|
|
29
|
-
* creationMode?: v4.TableCreationModeLR;
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* // Create decorator processor with context
|
|
33
|
-
* const decorator = new Decorator({ schema: appSchema, app, page });
|
|
34
|
-
*
|
|
35
|
-
* // Apply decorators - just pass the class
|
|
36
|
-
* const definition = decorator.apply(TableSettings, { type: 'GridTable' });
|
|
37
|
-
*
|
|
38
|
-
* // Apply with an explicit definition (e.g., view-specific copy)
|
|
39
|
-
* const definition = decorator.apply(Table, customContext, tableDefinition);
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
class Decorator {
|
|
43
|
-
/**
|
|
44
|
-
* Creates a new Decorator processor.
|
|
45
|
-
*
|
|
46
|
-
* @param context - Runtime context for decorator evaluation (app, page, schema)
|
|
47
|
-
* @param options - Optional configuration for steps
|
|
48
|
-
*/
|
|
49
|
-
constructor(context, options) {
|
|
50
|
-
this.context = context;
|
|
51
|
-
this.steps = options?.steps ?? DEFAULT_STEPS;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Initialize all decorator metadata to a schema definition.
|
|
55
|
-
*
|
|
56
|
-
* Resolves the definition by class name from the schema, or uses an explicit
|
|
57
|
-
* definition if provided. Runs all configured steps in order, then calls
|
|
58
|
-
* `init(context)` on the target class if it defines one.
|
|
59
|
-
*
|
|
60
|
-
* @param Target - Class constructor with decorator metadata
|
|
61
|
-
* @param customContext - Optional runtime context (e.g., table state, section state)
|
|
62
|
-
* @param definition - Optional explicit definition (overrides schema lookup by class name)
|
|
63
|
-
* @returns The modified schema definition, or undefined if not found
|
|
64
|
-
*/
|
|
65
|
-
init(Target, customContext, definition) {
|
|
66
|
-
if (Array.isArray(Target)) {
|
|
67
|
-
for (const SingleTarget of Target) {
|
|
68
|
-
this.apply(SingleTarget, customContext, definition);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
return this.apply(Target, customContext, definition);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Apply decorator metadata to a schema definition.
|
|
77
|
-
*
|
|
78
|
-
* Resolves the definition by class name from the schema, or uses an explicit
|
|
79
|
-
* definition if provided. Runs all configured steps in order, then calls
|
|
80
|
-
* `init(context)` on the target class if it defines one.
|
|
81
|
-
*
|
|
82
|
-
* @param Target - Class constructor with decorator metadata
|
|
83
|
-
* @param customContext - Optional runtime context (e.g., table state, section state)
|
|
84
|
-
* @param definition - Optional explicit definition (overrides schema lookup by class name)
|
|
85
|
-
* @returns The modified schema definition, or undefined if not found
|
|
86
|
-
*/
|
|
87
|
-
apply(Target, customContext, definition) {
|
|
88
|
-
// Resolve definition: explicit parameter takes precedence, then schema lookup by class name
|
|
89
|
-
const resolvedDefinition = definition ?? this.context.schema?.getDefinition(Target.name);
|
|
90
|
-
if (!resolvedDefinition) {
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
// Class-level decorators (inline, not steps)
|
|
94
|
-
this.applyDescription(Target, resolvedDefinition);
|
|
95
|
-
this.applyIsViewNode(Target, resolvedDefinition);
|
|
96
|
-
// Build runtime context with custom context merged
|
|
97
|
-
const context = {
|
|
98
|
-
...this.context,
|
|
99
|
-
custom: customContext
|
|
100
|
-
};
|
|
101
|
-
// Run steps in order (using Target.prototype for metadata lookup)
|
|
102
|
-
for (const step of this.steps) {
|
|
103
|
-
step.init(Target.prototype, resolvedDefinition, context);
|
|
104
|
-
}
|
|
105
|
-
// Auto-call init() if the target class defines a single-argument post-processing hook.
|
|
106
|
-
// Guards against DecoratorStep classes (whose init takes 3 args) being invoked incorrectly.
|
|
107
|
-
if (typeof Target.prototype.init === 'function' && Target.prototype.init.length === 1) {
|
|
108
|
-
Target.prototype.init(context);
|
|
109
|
-
}
|
|
110
|
-
return resolvedDefinition;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Apply description decorator from class metadata.
|
|
114
|
-
*
|
|
115
|
-
* @param Target - Class constructor with decorator metadata
|
|
116
|
-
* @param definition - The schema definition to modify
|
|
117
|
-
*/
|
|
118
|
-
applyDescription(Target, definition) {
|
|
119
|
-
const description = Reflect.getMetadata(decorators_1.metadataKeys.description, Target);
|
|
120
|
-
if (description !== undefined) {
|
|
121
|
-
definition.description = description;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Apply isViewNode decorator from class metadata.
|
|
126
|
-
*
|
|
127
|
-
* @param Target - Class constructor with decorator metadata
|
|
128
|
-
* @param definition - The schema definition to modify
|
|
129
|
-
*/
|
|
130
|
-
applyIsViewNode(Target, definition) {
|
|
131
|
-
const isViewNode = Reflect.getMetadata(decorators_1.metadataKeys.isViewNode, Target);
|
|
132
|
-
if (isViewNode !== undefined) {
|
|
133
|
-
definition[ux_specification_types_1.SchemaTag.isViewNode] = isViewNode;
|
|
134
|
-
definition.properties = definition.properties || {};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.Decorator = Decorator;
|
|
139
|
-
//# sourceMappingURL=Decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Decorator.js","sourceRoot":"","sources":["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|
1
|
-
/**
|
|
2
|
-
* Condition evaluation utilities for decorator steps.
|
|
3
|
-
* Extracted from DecoratorClass to be shared across all steps.
|
|
4
|
-
*/
|
|
5
|
-
import type { DependsOnCondition } from '@sap/ux-specification-types';
|
|
6
|
-
import type { DecoratorContext } from './interfaces';
|
|
7
|
-
/**
|
|
8
|
-
* Result of evaluating a single condition.
|
|
9
|
-
*/
|
|
10
|
-
export type EvaluateConditionResult = {
|
|
11
|
-
passed: boolean;
|
|
12
|
-
value: unknown;
|
|
13
|
-
key: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Result of evaluating a condition with context for messages.
|
|
17
|
-
*/
|
|
18
|
-
export type ConditionEvaluationResult = {
|
|
19
|
-
passed: boolean;
|
|
20
|
-
context: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Evaluates decorator conditions against runtime context.
|
|
24
|
-
* Supports single conditions, AND conditions, and OR conditions with nesting.
|
|
25
|
-
*/
|
|
26
|
-
export declare class ConditionEvaluator {
|
|
27
|
-
private readonly context;
|
|
28
|
-
/**
|
|
29
|
-
* Creates a new ConditionEvaluator with the given decorator context.
|
|
30
|
-
*
|
|
31
|
-
* @param context - The decorator context containing app, page, and custom runtime data
|
|
32
|
-
*/
|
|
33
|
-
constructor(context: DecoratorContext);
|
|
34
|
-
/**
|
|
35
|
-
* Gets property value from the decorator context using a property path.
|
|
36
|
-
* Supports JSONPath syntax for complex paths.
|
|
37
|
-
*
|
|
38
|
-
* @param propertyPath - JSONPath-style path to resolve (e.g. 'page.isALP', 'custom.type')
|
|
39
|
-
* @returns The key/value pair at the resolved path, or undefined if not found
|
|
40
|
-
*/
|
|
41
|
-
getPropertyKeyValue(propertyPath: string): {
|
|
42
|
-
key: string;
|
|
43
|
-
value: unknown;
|
|
44
|
-
} | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Resolves PathNode values in message params to their actual values.
|
|
47
|
-
*
|
|
48
|
-
* @param params - Optional map of parameter names to values (may contain PathNodes)
|
|
49
|
-
* @returns Resolved params with PathNodes replaced by their runtime values
|
|
50
|
-
*/
|
|
51
|
-
resolveMessageParams(params?: Record<string, unknown>): Record<string, unknown> | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Evaluates a condition and returns whether it passed and context for messages.
|
|
54
|
-
*
|
|
55
|
-
* @param conditionInfo - The condition to evaluate (single, AND, or OR)
|
|
56
|
-
* @returns Whether the condition passed and a context string for message interpolation
|
|
57
|
-
*/
|
|
58
|
-
evaluate(conditionInfo: DependsOnCondition): ConditionEvaluationResult;
|
|
59
|
-
/**
|
|
60
|
-
* Evaluates a single dependency condition.
|
|
61
|
-
*
|
|
62
|
-
* @param condition - A single condition with path, optional expectedValue, and optional negate
|
|
63
|
-
* @returns The evaluation result with passed flag, resolved value, and key
|
|
64
|
-
*/
|
|
65
|
-
private evaluateSingleCondition;
|
|
66
|
-
/**
|
|
67
|
-
* Gets the context message from evaluation results.
|
|
68
|
-
*
|
|
69
|
-
* @param results - Array of evaluation results to summarize
|
|
70
|
-
* @returns A comma-separated string of failed condition key/value pairs
|
|
71
|
-
*/
|
|
72
|
-
private getContextForMessage;
|
|
73
|
-
/**
|
|
74
|
-
* Evaluates an AND condition item which can be a single condition or nested OR group.
|
|
75
|
-
*
|
|
76
|
-
* @param conditionItem - A single condition or an OR group nested inside AND
|
|
77
|
-
* @returns Whether the item passed and the individual evaluation results
|
|
78
|
-
*/
|
|
79
|
-
private evaluateAndConditionItem;
|
|
80
|
-
/**
|
|
81
|
-
* Evaluates OR conditions (at least one must match).
|
|
82
|
-
*
|
|
83
|
-
* @param orConditions - Array of OR condition items (single conditions or AND groups)
|
|
84
|
-
* @returns Whether any condition passed and all individual evaluation results
|
|
85
|
-
*/
|
|
86
|
-
private evaluateOrConditions;
|
|
87
|
-
/**
|
|
88
|
-
* Evaluates AND conditions (all must match).
|
|
89
|
-
*
|
|
90
|
-
* @param andConditions - Array of AND condition items (single conditions or OR groups)
|
|
91
|
-
* @returns Whether all conditions passed and all individual evaluation results
|
|
92
|
-
*/
|
|
93
|
-
private evaluateAndConditions;
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=condition-evaluator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"condition-evaluator.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/condition-evaluator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACR,kBAAkB,EAIrB,MAAM,6BAA6B,CAAC;AAIrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYrD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C;;;;OAIG;gBACS,OAAO,EAAE,gBAAgB;IAUrC;;;;;;OAMG;IACH,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS;IA2BtF;;;;;OAKG;IACH,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAiB3F;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,kBAAkB,GAAG,yBAAyB;IAqBtE;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IA0B/B;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAYhC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAqC5B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;CAkBhC"}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConditionEvaluator = void 0;
|
|
4
|
-
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
5
|
-
const decorator_paths_1 = require("./decorator-paths");
|
|
6
|
-
/**
|
|
7
|
-
* Evaluates decorator conditions against runtime context.
|
|
8
|
-
* Supports single conditions, AND conditions, and OR conditions with nesting.
|
|
9
|
-
*/
|
|
10
|
-
class ConditionEvaluator {
|
|
11
|
-
/**
|
|
12
|
-
* Creates a new ConditionEvaluator with the given decorator context.
|
|
13
|
-
*
|
|
14
|
-
* @param context - The decorator context containing app, page, and custom runtime data
|
|
15
|
-
*/
|
|
16
|
-
constructor(context) {
|
|
17
|
-
this.context = {
|
|
18
|
-
// Use app.config (plain AppContext) for JSONPath evaluation, not the full App instance.
|
|
19
|
-
// app.config holds manifest and other plain data that path builders reference (e.g. app.manifest).
|
|
20
|
-
app: context.app?.config,
|
|
21
|
-
page: context.page?.config,
|
|
22
|
-
custom: context.custom
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Gets property value from the decorator context using a property path.
|
|
27
|
-
* Supports JSONPath syntax for complex paths.
|
|
28
|
-
*
|
|
29
|
-
* @param propertyPath - JSONPath-style path to resolve (e.g. 'page.isALP', 'custom.type')
|
|
30
|
-
* @returns The key/value pair at the resolved path, or undefined if not found
|
|
31
|
-
*/
|
|
32
|
-
getPropertyKeyValue(propertyPath) {
|
|
33
|
-
if (!propertyPath || !this.context) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const jsonPath = propertyPath.startsWith('$') ? propertyPath : `$.${propertyPath}`;
|
|
38
|
-
const results = (0, jsonpath_plus_1.JSONPath)({
|
|
39
|
-
path: jsonPath,
|
|
40
|
-
json: this.context,
|
|
41
|
-
resultType: 'all'
|
|
42
|
-
});
|
|
43
|
-
if (!results || results.length === 0) {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
const result = results[0];
|
|
47
|
-
const key = String(result.parentProperty);
|
|
48
|
-
const value = result.value;
|
|
49
|
-
return { key, value };
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Resolves PathNode values in message params to their actual values.
|
|
57
|
-
*
|
|
58
|
-
* @param params - Optional map of parameter names to values (may contain PathNodes)
|
|
59
|
-
* @returns Resolved params with PathNodes replaced by their runtime values
|
|
60
|
-
*/
|
|
61
|
-
resolveMessageParams(params) {
|
|
62
|
-
if (!params) {
|
|
63
|
-
return params;
|
|
64
|
-
}
|
|
65
|
-
const resolved = {};
|
|
66
|
-
for (const [key, value] of Object.entries(params)) {
|
|
67
|
-
if ((0, decorator_paths_1.isPathNode)(value)) {
|
|
68
|
-
const result = this.getPropertyKeyValue((0, decorator_paths_1.getPath)(value));
|
|
69
|
-
resolved[key] = result?.value ?? '';
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
resolved[key] = value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return resolved;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Evaluates a condition and returns whether it passed and context for messages.
|
|
79
|
-
*
|
|
80
|
-
* @param conditionInfo - The condition to evaluate (single, AND, or OR)
|
|
81
|
-
* @returns Whether the condition passed and a context string for message interpolation
|
|
82
|
-
*/
|
|
83
|
-
evaluate(conditionInfo) {
|
|
84
|
-
let passed = false;
|
|
85
|
-
let context = '';
|
|
86
|
-
if (conditionInfo.orConditions && Array.isArray(conditionInfo.orConditions)) {
|
|
87
|
-
const result = this.evaluateOrConditions(conditionInfo.orConditions);
|
|
88
|
-
passed = result.passed;
|
|
89
|
-
context = this.getContextForMessage(result.results);
|
|
90
|
-
}
|
|
91
|
-
else if (conditionInfo.conditions && Array.isArray(conditionInfo.conditions)) {
|
|
92
|
-
const result = this.evaluateAndConditions(conditionInfo.conditions);
|
|
93
|
-
passed = result.passed;
|
|
94
|
-
context = this.getContextForMessage(result.results);
|
|
95
|
-
}
|
|
96
|
-
else if (conditionInfo.path) {
|
|
97
|
-
const result = this.evaluateSingleCondition(conditionInfo);
|
|
98
|
-
passed = result.passed;
|
|
99
|
-
context = this.getContextForMessage([result]);
|
|
100
|
-
}
|
|
101
|
-
return { passed, context };
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Evaluates a single dependency condition.
|
|
105
|
-
*
|
|
106
|
-
* @param condition - A single condition with path, optional expectedValue, and optional negate
|
|
107
|
-
* @returns The evaluation result with passed flag, resolved value, and key
|
|
108
|
-
*/
|
|
109
|
-
evaluateSingleCondition(condition) {
|
|
110
|
-
if (condition.path === '__always__') {
|
|
111
|
-
return { passed: true, value: true, key: '__always__' };
|
|
112
|
-
}
|
|
113
|
-
const result = this.getPropertyKeyValue(condition.path);
|
|
114
|
-
const key = result?.key ?? condition.path;
|
|
115
|
-
const value = result?.value;
|
|
116
|
-
let passed = false;
|
|
117
|
-
if (condition.dependsOn) {
|
|
118
|
-
passed = condition.dependsOn(value);
|
|
119
|
-
}
|
|
120
|
-
else if (condition.expectedValue !== undefined) {
|
|
121
|
-
passed = value === condition.expectedValue;
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
passed = !!value;
|
|
125
|
-
}
|
|
126
|
-
if (condition.negate) {
|
|
127
|
-
passed = !passed;
|
|
128
|
-
}
|
|
129
|
-
return { passed, value, key };
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Gets the context message from evaluation results.
|
|
133
|
-
*
|
|
134
|
-
* @param results - Array of evaluation results to summarize
|
|
135
|
-
* @returns A comma-separated string of failed condition key/value pairs
|
|
136
|
-
*/
|
|
137
|
-
getContextForMessage(results) {
|
|
138
|
-
return results
|
|
139
|
-
.filter((result) => !result.passed)
|
|
140
|
-
.map((result) => `${result.key}: ${result.value}`)
|
|
141
|
-
.join(', ');
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Evaluates an AND condition item which can be a single condition or nested OR group.
|
|
145
|
-
*
|
|
146
|
-
* @param conditionItem - A single condition or an OR group nested inside AND
|
|
147
|
-
* @returns Whether the item passed and the individual evaluation results
|
|
148
|
-
*/
|
|
149
|
-
evaluateAndConditionItem(conditionItem) {
|
|
150
|
-
if ((0, decorator_paths_1.isOrConditionGroup)(conditionItem)) {
|
|
151
|
-
return this.evaluateOrConditions(conditionItem.__orConditions);
|
|
152
|
-
}
|
|
153
|
-
const result = this.evaluateSingleCondition(conditionItem);
|
|
154
|
-
return { passed: result.passed, results: [result] };
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Evaluates OR conditions (at least one must match).
|
|
158
|
-
*
|
|
159
|
-
* @param orConditions - Array of OR condition items (single conditions or AND groups)
|
|
160
|
-
* @returns Whether any condition passed and all individual evaluation results
|
|
161
|
-
*/
|
|
162
|
-
evaluateOrConditions(orConditions) {
|
|
163
|
-
const allResults = [];
|
|
164
|
-
for (const conditionItem of orConditions) {
|
|
165
|
-
if ((0, decorator_paths_1.isAndConditionGroup)(conditionItem)) {
|
|
166
|
-
const andResults = [];
|
|
167
|
-
let allAndPassed = true;
|
|
168
|
-
for (const andItem of conditionItem.__andConditions) {
|
|
169
|
-
const { passed, results } = this.evaluateAndConditionItem(andItem);
|
|
170
|
-
andResults.push(...results);
|
|
171
|
-
if (!passed) {
|
|
172
|
-
allAndPassed = false;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
allResults.push(...andResults);
|
|
176
|
-
if (allAndPassed) {
|
|
177
|
-
return { passed: true, results: allResults };
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
const result = this.evaluateSingleCondition(conditionItem);
|
|
182
|
-
allResults.push(result);
|
|
183
|
-
if (result.passed) {
|
|
184
|
-
return { passed: true, results: allResults };
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return { passed: false, results: allResults };
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Evaluates AND conditions (all must match).
|
|
192
|
-
*
|
|
193
|
-
* @param andConditions - Array of AND condition items (single conditions or OR groups)
|
|
194
|
-
* @returns Whether all conditions passed and all individual evaluation results
|
|
195
|
-
*/
|
|
196
|
-
evaluateAndConditions(andConditions) {
|
|
197
|
-
const allResults = [];
|
|
198
|
-
let allPassed = true;
|
|
199
|
-
for (const conditionItem of andConditions) {
|
|
200
|
-
const { passed, results } = this.evaluateAndConditionItem(conditionItem);
|
|
201
|
-
allResults.push(...results);
|
|
202
|
-
if (!passed) {
|
|
203
|
-
allPassed = false;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return { passed: allPassed, results: allResults };
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
exports.ConditionEvaluator = ConditionEvaluator;
|
|
210
|
-
//# sourceMappingURL=condition-evaluator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"condition-evaluator.js","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/condition-evaluator.ts"],"names":[],"mappings":";;;AAUA,iDAAyC;AACzC,uDAAiG;AA+BjG;;;GAGG;AACH,MAAa,kBAAkB;IAG3B;;;;OAIG;IACH,YAAY,OAAyB;QACjC,IAAI,CAAC,OAAO,GAAG;YACX,wFAAwF;YACxF,mGAAmG;YACnG,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM;YACxB,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,CAAC;IACN,CAAC;IAED;;;;;;OAMG;IACH,mBAAmB,CA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AAM,EAAE,CAAC;oBAChB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;gBACjD,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACK,qBAAqB,CAAC,aAAiC;QAI3D,MAAM,UAAU,GAA8B,EAAE,CAAC;QACjD,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,KAAK,MAAM,aAAa,IAAI,aAAa,EAAE,CAAC;YACxC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;YACzE,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;YAE5B,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,SAAS,GAAG,KAAK,CAAC;YACtB,CAAC;QACL,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACtD,CAAC;CACJ;AAxOD,gDAwOC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Definition } from 'typescript-json-schema';
|
|
2
|
-
import type { ExtensionLogger } from '@sap/ux-specification-types';
|
|
3
|
-
import type { App, AppSchema, Page } from '../../v4/sync-rules';
|
|
4
|
-
/**
|
|
5
|
-
* Combined context passed to Decorator and each DecoratorStep.
|
|
6
|
-
* Uses interfaces compatible with App and Page classes from sync-rules.
|
|
7
|
-
*/
|
|
8
|
-
export interface DecoratorContext {
|
|
9
|
-
/** App-level context (has config, getMinUI5Version) */
|
|
10
|
-
app?: App;
|
|
11
|
-
/** Page-level context (has config, target) */
|
|
12
|
-
page?: Page;
|
|
13
|
-
/** Custom context (e.g., table state, section state) */
|
|
14
|
-
custom?: Record<string, unknown>;
|
|
15
|
-
/** Schema context for definition lookup */
|
|
16
|
-
schema: AppSchema;
|
|
17
|
-
/** Logger for debugging and error reporting */
|
|
18
|
-
logger?: ExtensionLogger;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Interface for decorator processing steps.
|
|
22
|
-
* Each step handles a specific type of decorator metadata.
|
|
23
|
-
*
|
|
24
|
-
* Steps are executed in order: enums -> message -> hide
|
|
25
|
-
*/
|
|
26
|
-
export interface DecoratorStep {
|
|
27
|
-
/** Unique name for the step (used for disabling via options) */
|
|
28
|
-
readonly name: string;
|
|
29
|
-
/**
|
|
30
|
-
* Initialize this step's decorator logic for the schema definition.
|
|
31
|
-
*
|
|
32
|
-
* @param target - The class prototype containing decorator metadata
|
|
33
|
-
* @param definition - The schema definition to modify
|
|
34
|
-
* @param context - context for condition evaluation
|
|
35
|
-
*/
|
|
36
|
-
init(target: object, definition: Definition, context: DecoratorContext): void;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,uDAAuD;IACvD,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,8CAA8C;IAC9C,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,2CAA2C;IAC3C,MAAM,EAAE,SAAS,CAAC;IAClB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Definition } from 'typescript-json-schema';
|
|
2
|
-
import type { DecoratorStep, DecoratorContext } from '../interfaces';
|
|
3
|
-
/**
|
|
4
|
-
* Enums step - filters enum values based on conditions.
|
|
5
|
-
* If multiple @enums decorators exist on the same property, the first matching condition wins.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Enums implements DecoratorStep {
|
|
8
|
-
readonly name = "enums";
|
|
9
|
-
/**
|
|
10
|
-
* Applies enum filtering to all properties in the definition.
|
|
11
|
-
*
|
|
12
|
-
* @param target - The class prototype containing decorator metadata
|
|
13
|
-
* @param definition - The schema definition to modify
|
|
14
|
-
* @param context - Runtime context for condition evaluation
|
|
15
|
-
*/
|
|
16
|
-
init(target: object, definition: Definition, context: DecoratorContext): void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Enums.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Enums.d.ts","sourceRoot":"","sources":["../../../../../../../src/sync/common/decoration/steps/Enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKrE;;;GAGG;AACH,qBAAa,KAAM,YAAW,aAAa;IACvC,QAAQ,CAAC,IAAI,WAAW;IAExB;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;CA+BhF"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Enums = void 0;
|
|
4
|
-
const decorators_1 = require("../decorators");
|
|
5
|
-
const condition_evaluator_1 = require("../condition-evaluator");
|
|
6
|
-
const enum_utils_1 = require("./enum-utils");
|
|
7
|
-
/**
|
|
8
|
-
* Enums step - filters enum values based on conditions.
|
|
9
|
-
* If multiple @enums decorators exist on the same property, the first matching condition wins.
|
|
10
|
-
*/
|
|
11
|
-
class Enums {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.name = 'enums';
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Applies enum filtering to all properties in the definition.
|
|
17
|
-
*
|
|
18
|
-
* @param target - The class prototype containing decorator metadata
|
|
19
|
-
* @param definition - The schema definition to modify
|
|
20
|
-
* @param context - Runtime context for condition evaluation
|
|
21
|
-
*/
|
|
22
|
-
init(target, definition, context) {
|
|
23
|
-
if (!definition?.properties || !target) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const evaluator = new condition_evaluator_1.ConditionEvaluator(context);
|
|
27
|
-
for (const propertyName in definition.properties) {
|
|
28
|
-
const property = definition.properties[propertyName];
|
|
29
|
-
const enumsMetadataList = Reflect.getMetadata(decorators_1.metadataKeys.enums, target, propertyName);
|
|
30
|
-
if (!enumsMetadataList?.length) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
// Find first matching condition (first match wins)
|
|
34
|
-
for (const enumsMetadata of enumsMetadataList) {
|
|
35
|
-
const { passed } = evaluator.evaluate(enumsMetadata);
|
|
36
|
-
if (passed) {
|
|
37
|
-
const currentEnumValues = (0, enum_utils_1.resolveEnumFromProperty)(property, context);
|
|
38
|
-
if (currentEnumValues) {
|
|
39
|
-
// Filter to only allowed values that exist in original enum
|
|
40
|
-
const filteredValues = enumsMetadata.allowedValues.filter((v) => currentEnumValues.includes(v));
|
|
41
|
-
(0, enum_utils_1.applyFilteredEnumToProperty)(property, filteredValues, context);
|
|
42
|
-
}
|
|
43
|
-
break; // First match wins, stop processing
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.Enums = Enums;
|
|
50
|
-
//# sourceMappingURL=Enums.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Enums.js","sourceRoot":"","sources":["../../../../../../../src/sync/common/decoration/steps/Enums.ts"],"names":[],"mappings":";;;AAEA,8CAA6C;AAC7C,gEAA4D;AAC5D,6CAAoF;AAEpF;;;GAGG;AACH,MAAa,KAAK;IAAlB;QACa,SAAI,GAAG,OAAO,CAAC;IAwC5B,CAAC;IAtCG;;;;;;OAMG;IACH,IAAI,CAAC,MAAc,EAAE,UAAsB,EAAE,OAAyB;QAClE,IAAI,CAAC,UAAU,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,OAAO;QACX,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,wCAAkB,CAAC,OAAO,CAAC,CAAC;QAElD,KAAK,MAAM,YAAY,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;YAC/C,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,CAAC,YAAY,CAAe,CAAC;YACnE,MAAM,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,yBAAY,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YAExF,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;gBAC7B,SAAS;YACb,CAAC;YAED,mDAAmD;YACnD,KAAK,MAAM,aAAa,IAAI,iBAAiB,EAAE,CAAC;gBAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;gBAErD,IAAI,MAAM,EAAE,CAAC;oBACT,MAAM,iBAAiB,GAAG,IAAA,oCAAuB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;oBACrE,IAAI,iBAAiB,EAAE,CAAC;wBACpB,4DAA4D;wBAC5D,MAAM,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;wBAChG,IAAA,wCAA2B,EAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;oBACnE,CAAC;oBACD,MAAM,CAAC,oCAAoC;gBAC/C,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAzCD,sBAyCC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Definition } from 'typescript-json-schema';
|
|
2
|
-
import type { DecoratorStep, DecoratorContext } from '../interfaces';
|
|
3
|
-
/**
|
|
4
|
-
* Hide step - hides properties when their condition evaluates to true.
|
|
5
|
-
* Only hides if the message step did not add any messages to the property.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Hide implements DecoratorStep {
|
|
8
|
-
readonly name = "hide";
|
|
9
|
-
/**
|
|
10
|
-
* Hides properties whose hide condition evaluates to true and have no messages.
|
|
11
|
-
*
|
|
12
|
-
* @param target - The class prototype containing decorator metadata
|
|
13
|
-
* @param definition - The schema definition to modify
|
|
14
|
-
* @param context - Runtime context for condition evaluation
|
|
15
|
-
*/
|
|
16
|
-
init(target: object, definition: Definition, context: DecoratorContext): void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Hide.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Hide.d.ts","sourceRoot":"","sources":["../../../../../../../src/sync/common/decoration/steps/Hide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIrE;;;GAGG;AACH,qBAAa,IAAK,YAAW,aAAa;IACtC,QAAQ,CAAC,IAAI,UAAU;IAEvB;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;CA0BhF"}
|