@sap/ux-specification 1.136.14 → 1.136.16
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 +250 -146
- 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 +269 -266
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/AnalyticalListPageConfig.json +3 -3
- package/dist/schemas/v2/ListReportConfig.json +5 -5
- package/dist/schemas/v2/ListReportNewConfig.json +1 -1
- package/dist/schemas/v2/ObjectPageConfig.json +5 -5
- package/dist/schemas/v4/ApplicationV4.json +1 -1
- package/dist/schemas/v4/BuildingBlocksConfig.json +120 -41
- package/dist/schemas/v4/ListReportConfig.json +275 -34
- package/dist/schemas/v4/ObjectPageConfig.json +417 -138
- package/dist/specification/package.json +13 -11
- package/dist/specification/scripts/extractDocu.js +18 -1
- package/dist/specification/scripts/extractDocu.js.map +1 -1
- package/dist/specification/scripts/generate-validity-report.d.ts +15 -0
- package/dist/specification/scripts/generate-validity-report.d.ts.map +1 -0
- package/dist/specification/scripts/generate-validity-report.js +367 -0
- package/dist/specification/scripts/generate-validity-report.js.map +1 -0
- package/dist/specification/scripts/macros/corrections.d.ts +40 -0
- package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +98 -7
- 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 +11 -2
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/scripts/macros/types.d.ts +2 -0
- package/dist/specification/scripts/macros/types.d.ts.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js +2 -13
- 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 +2 -1
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/sync/common/DataFieldStrategy.d.ts +38 -8
- package/dist/specification/src/sync/common/DataFieldStrategy.d.ts.map +1 -1
- package/dist/specification/src/sync/common/DataFieldStrategy.js +64 -11
- package/dist/specification/src/sync/common/DataFieldStrategy.js.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +0 -4
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +0 -3
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -1
- package/dist/specification/src/sync/common/appProvider.d.ts +0 -1
- package/dist/specification/src/sync/common/appProvider.d.ts.map +1 -1
- package/dist/specification/src/sync/common/appProvider.js +0 -1
- package/dist/specification/src/sync/common/appProvider.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +503 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.js +497 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/decorators.d.ts +149 -23
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +369 -74
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.d.ts +1 -0
- package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.js +1 -0
- package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
- package/dist/specification/src/sync/common/dist_tag.json +8 -3
- package/dist/specification/src/sync/common/generate/objectPage.d.ts +0 -1
- package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +0 -3
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.d.ts +3 -3
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +6 -3
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +2 -1
- package/dist/specification/src/sync/common/import/utils.d.ts +0 -1
- package/dist/specification/src/sync/common/import/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/import/utils.js +0 -1
- package/dist/specification/src/sync/common/import/utils.js.map +1 -1
- package/dist/specification/src/sync/common/rules.js +0 -1
- package/dist/specification/src/sync/common/rules.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +35 -8
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +206 -22
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js +3 -13
- package/dist/specification/src/sync/v2/export/exportPageGeneric.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 +48 -0
- package/dist/specification/src/sync/v2/generate/analyticalListReport.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 +3 -1
- 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 +2 -0
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.d.ts +1 -9
- package/dist/specification/src/sync/v2/generate/overviewPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.js +30 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +28 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.js +2 -0
- package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.js +5 -6
- package/dist/specification/src/sync/v2/import/importPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts +2 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js +5 -0
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.d.ts +2 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.js +5 -0
- package/dist/specification/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.js +2 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/utils.d.ts +28 -1
- package/dist/specification/src/sync/v2/import/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/utils.js +37 -0
- package/dist/specification/src/sync/v2/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +12 -2
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +19 -2
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +21 -3
- 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/actions.d.ts +39 -0
- package/dist/specification/src/sync/v4/export/actions.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/export/actions.js +99 -0
- package/dist/specification/src/sync/v4/export/actions.js.map +1 -0
- 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 +4 -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 -3
- package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -0
- 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/ObjectPageForm.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.d.ts +2 -4
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.js +2 -21
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts +2 -2
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts +14 -3
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js +52 -9
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +0 -13
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +15 -3
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js +53 -10
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +24 -18
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +40 -49
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/TableColumn.js +2 -2
- package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +9 -2
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.js +39 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +17 -4
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +76 -19
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/export.d.ts +7 -0
- package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/export.js +125 -14
- package/dist/specification/src/sync/v4/export/export.js.map +1 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.js +1 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
- package/dist/specification/src/sync/v4/export/types.d.ts +2 -0
- package/dist/specification/src/sync/v4/export/types.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/actions.d.ts +35 -0
- package/dist/specification/src/sync/v4/generate/actions.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/actions.js +112 -0
- package/dist/specification/src/sync/v4/generate/actions.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +3 -3
- 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 +11 -3
- 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 +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 +3 -2
- 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 +25 -3
- 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 +11 -2
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/index.d.ts +1 -1
- package/dist/specification/src/sync/v4/generate/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/index.js +1 -1
- package/dist/specification/src/sync/v4/generate/index.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts +73 -0
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js +354 -0
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/{listReport.d.ts → list-report/listReport.d.ts} +46 -19
- package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/{listReport.js → list-report/listReport.js} +195 -316
- package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts +0 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +148 -56
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.js +2 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.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 +16 -3
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/utils.d.ts +0 -1
- package/dist/specification/src/sync/v4/import/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/utils.js +5 -4
- package/dist/specification/src/sync/v4/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts +9 -7
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js +4 -8
- 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 -9
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +2 -11
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +177 -46
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +498 -152
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +17 -22
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.js +15 -22
- package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts +1 -0
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js +17 -9
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/index.d.ts +5 -0
- package/dist/specification/src/sync/v4/sync-rules/index.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/index.js +21 -0
- package/dist/specification/src/sync/v4/sync-rules/index.js.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/utils.js +4 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/index.d.ts +2 -0
- package/dist/specification/src/sync/v4/utils/index.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/utils/index.js +18 -0
- package/dist/specification/src/sync/v4/utils/index.js.map +1 -0
- package/dist/specification/src/sync/v4/utils/utils.d.ts +112 -26
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +374 -46
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/specification/test/test-projects/v2sttaProdMan2/webapp/manifest.json +550 -0
- package/dist/specification/test/test-projects/v4new/webapp/manifest.json +147 -0
- package/dist/specification/test/test-utils/utils.d.ts +71 -0
- package/dist/specification/test/test-utils/utils.d.ts.map +1 -0
- package/dist/specification/test/test-utils/utils.js +400 -0
- package/dist/specification/test/test-utils/utils.js.map +1 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts +131 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts.map +1 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.js +661 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.js.map +1 -0
- package/dist/types/src/apiTypes.d.ts +5 -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 +162 -15
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +41 -2
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts +1 -1
- package/dist/types/src/v2/controls/Table.d.ts +1 -1
- package/dist/types/src/v4/controls/CustomAction.d.ts +133 -19
- package/dist/types/src/v4/controls/CustomAction.d.ts.map +1 -1
- package/dist/types/src/v4/controls/CustomAction.js.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageForm.d.ts +2 -2
- package/dist/types/src/v4/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageHeader.d.ts +22 -3
- package/dist/types/src/v4/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts +2 -2
- package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts.map +1 -1
- package/dist/types/src/v4/controls/Table.d.ts +3 -3
- package/dist/types/src/v4/controls/Table.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ToolBar.d.ts +3 -3
- package/dist/types/src/v4/controls/ToolBar.d.ts.map +1 -1
- package/package.json +14 -12
- package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +0 -107
- package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +0 -1
- package/dist/specification/src/sync/v4/generate/ListReportUtils.js +0 -392
- package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +0 -1
- package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +0 -1
- package/dist/specification/src/sync/v4/generate/listReport.js.map +0 -1
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Decorator = exports.BaseClass = void 0;
|
|
6
|
+
exports.Decorator = exports.BaseClass = exports.BaseConstruct = void 0;
|
|
7
7
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
8
8
|
const decoration_1 = require("../../common/decoration");
|
|
9
9
|
const i18next_1 = __importDefault(require("i18next"));
|
|
10
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
12
|
/**
|
|
12
13
|
* Adds a message to a schema element.
|
|
@@ -23,25 +24,67 @@ function addMessageToSchema(element, { text, deletable = false }) {
|
|
|
23
24
|
}
|
|
24
25
|
element[ux_specification_types_1.SchemaTag.messages].push({ text, deletable });
|
|
25
26
|
}
|
|
26
|
-
class
|
|
27
|
+
class BaseConstruct {
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Constructor for BaseConstruct.
|
|
29
30
|
*
|
|
30
|
-
* @param
|
|
31
|
+
* @param settings - General settings including appSchema, app, page, and logger
|
|
31
32
|
*/
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
33
|
+
constructor(settings) {
|
|
34
|
+
const { app, appSchema, page, logger } = settings || {};
|
|
35
|
+
// Define properties as non-enumerable to hide them from serialization and Object.keys()
|
|
34
36
|
Object.defineProperty(this, 'appSchema', {
|
|
35
37
|
value: appSchema,
|
|
36
|
-
writable:
|
|
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,
|
|
37
57
|
enumerable: false,
|
|
38
58
|
configurable: true
|
|
39
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);
|
|
40
84
|
const name = this.getClassName();
|
|
41
|
-
const definitions = appSchema?.definitions;
|
|
42
85
|
// Define base as non-enumerable to hide it from serialization and Object.keys()
|
|
43
86
|
Object.defineProperty(this, 'base', {
|
|
44
|
-
value: { name, definition: definitions?.[name] },
|
|
87
|
+
value: { name, definition: this.appSchema?.get().definitions?.[name] },
|
|
45
88
|
writable: true,
|
|
46
89
|
enumerable: false,
|
|
47
90
|
configurable: true
|
|
@@ -71,22 +114,6 @@ class BaseClass {
|
|
|
71
114
|
getBase() {
|
|
72
115
|
return this.base.definition;
|
|
73
116
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Sets the base definition and name.
|
|
76
|
-
*
|
|
77
|
-
* @param base - The base object containing name and definition
|
|
78
|
-
*/
|
|
79
|
-
setBase(base) {
|
|
80
|
-
this.base = base;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Gets the definitions from the app schema.
|
|
84
|
-
*
|
|
85
|
-
* @returns The definitions object or undefined
|
|
86
|
-
*/
|
|
87
|
-
getDefinitions() {
|
|
88
|
-
return this.appSchema?.definitions;
|
|
89
|
-
}
|
|
90
117
|
/**
|
|
91
118
|
* Creates an annotation path for schema based on entity type, term, and qualifier.
|
|
92
119
|
*
|
|
@@ -110,57 +137,106 @@ class BaseClass {
|
|
|
110
137
|
exports.BaseClass = BaseClass;
|
|
111
138
|
class Decorator extends BaseClass {
|
|
112
139
|
/**
|
|
113
|
-
*
|
|
114
|
-
* This enables nested decorators to access parent properties using the '../' prefix in @dependsOn.
|
|
140
|
+
* Creates an instance of Decorator.
|
|
115
141
|
*
|
|
116
|
-
* @param
|
|
117
|
-
* @returns this (for method chaining)
|
|
142
|
+
* @param settings - General settings including appSchema, app, page, and logger
|
|
118
143
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
+
});
|
|
122
153
|
}
|
|
123
154
|
/**
|
|
124
|
-
*
|
|
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
|
+
* });
|
|
125
175
|
*
|
|
126
|
-
*
|
|
176
|
+
* // With custom definition (for dynamically created definitions)
|
|
177
|
+
* decorator.init({ table: { type: 'GridTable' } }, customTableDefinition);
|
|
178
|
+
* ```
|
|
127
179
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
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);
|
|
130
189
|
}
|
|
131
190
|
/**
|
|
132
|
-
*
|
|
133
|
-
* Supports simple property names (e.g., 'visualFilters'), nested paths (e.g., 'settings.enabled'),
|
|
134
|
-
* and parent traversal (e.g., '../type' to access parent object's type property).
|
|
191
|
+
* Gets property value from the decorator context using a property path.
|
|
135
192
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
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
|
|
138
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
|
+
* ```
|
|
139
211
|
*/
|
|
140
|
-
getPropertyKeyValue(
|
|
141
|
-
if (!
|
|
212
|
+
getPropertyKeyValue(propertyPath) {
|
|
213
|
+
if (!propertyPath || !this.decoratorContext) {
|
|
142
214
|
return undefined;
|
|
143
215
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
let value = syncInstance;
|
|
156
|
-
for (const key of keys) {
|
|
157
|
-
if (value === null || value === undefined) {
|
|
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) {
|
|
158
227
|
return undefined;
|
|
159
228
|
}
|
|
160
|
-
|
|
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;
|
|
161
239
|
}
|
|
162
|
-
const key = keys[keys.length - 1];
|
|
163
|
-
return { key, value };
|
|
164
240
|
}
|
|
165
241
|
/**
|
|
166
242
|
* Evaluates a single dependency condition.
|
|
@@ -169,11 +245,17 @@ class Decorator extends BaseClass {
|
|
|
169
245
|
* @param condition.path - The property path to check
|
|
170
246
|
* @param condition.dependsOn - Optional custom condition function
|
|
171
247
|
* @param condition.expectedValue - Optional expected value for equality check
|
|
172
|
-
* @param
|
|
248
|
+
* @param condition.negate - Optional flag to invert the condition result
|
|
173
249
|
* @returns Object containing whether condition passed and the dependency value
|
|
174
250
|
*/
|
|
175
|
-
evaluateSingleCondition(condition
|
|
176
|
-
|
|
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;
|
|
177
259
|
let passed = false;
|
|
178
260
|
if (condition.dependsOn) {
|
|
179
261
|
// Use custom condition function
|
|
@@ -187,12 +269,16 @@ class Decorator extends BaseClass {
|
|
|
187
269
|
// Default: truthy check
|
|
188
270
|
passed = !!value;
|
|
189
271
|
}
|
|
272
|
+
// Apply negation if negate flag is set (from not() helper)
|
|
273
|
+
if (condition.negate) {
|
|
274
|
+
passed = !passed;
|
|
275
|
+
}
|
|
190
276
|
return { passed, value, key };
|
|
191
277
|
}
|
|
192
278
|
/**
|
|
193
279
|
* Helper method to add a message to the schema property based on value condition.
|
|
194
280
|
*
|
|
195
|
-
* @param condition - EnumValueCondition object containing condition details
|
|
281
|
+
* @param condition - DecoratorMetadata or EnumValueCondition object containing condition details
|
|
196
282
|
* @param syncRuleProviderInstance - The instance of the sync rule provider
|
|
197
283
|
* @param definition - The schema property definition
|
|
198
284
|
* @param i18nProperties - i18n properties for message translation
|
|
@@ -200,11 +286,58 @@ class Decorator extends BaseClass {
|
|
|
200
286
|
* @param i18nProperties.context - The context for the message
|
|
201
287
|
*/
|
|
202
288
|
addConditionalMessage(condition, syncRuleProviderInstance, definition, i18nProperties) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
+
}
|
|
206
316
|
addMessageToSchema(definition, { text: messageText, deletable: condition.message.deletable });
|
|
207
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
|
+
}
|
|
208
341
|
/**
|
|
209
342
|
* Gets the context message from evaluation results.
|
|
210
343
|
*
|
|
@@ -218,43 +351,217 @@ class Decorator extends BaseClass {
|
|
|
218
351
|
.join(', ');
|
|
219
352
|
}
|
|
220
353
|
/**
|
|
221
|
-
*
|
|
354
|
+
* Evaluates an AND condition item which can be either a single condition or a nested OR group.
|
|
222
355
|
*
|
|
223
|
-
* @param
|
|
224
|
-
* @
|
|
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
|
|
225
467
|
*/
|
|
226
|
-
|
|
227
|
-
if (!schemaDefinition?.properties || !
|
|
468
|
+
*iterateProperties(schemaDefinition, target) {
|
|
469
|
+
if (!schemaDefinition?.properties || !target) {
|
|
228
470
|
return;
|
|
229
471
|
}
|
|
230
472
|
for (const propertyName in schemaDefinition.properties) {
|
|
231
473
|
const property = schemaDefinition.properties[propertyName];
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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;
|
|
248
495
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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, {
|
|
252
514
|
propertyName,
|
|
253
515
|
context
|
|
254
516
|
});
|
|
255
517
|
}
|
|
256
|
-
|
|
257
|
-
|
|
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
|
|
258
565
|
}
|
|
259
566
|
}
|
|
260
567
|
}
|
|
@@ -273,6 +580,56 @@ class Decorator extends BaseClass {
|
|
|
273
580
|
}
|
|
274
581
|
return validityInfo;
|
|
275
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
|
+
}
|
|
276
633
|
/**
|
|
277
634
|
* Applies the validity decorator to the schema definition based on the sync rule provider instance and minimum UI5 version.
|
|
278
635
|
*
|
|
@@ -292,39 +649,46 @@ class Decorator extends BaseClass {
|
|
|
292
649
|
property[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
293
650
|
// possible message?
|
|
294
651
|
}
|
|
295
|
-
// Process
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
310
672
|
}
|
|
311
|
-
return false; // Version requirement not met
|
|
312
673
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
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
|
|
321
683
|
}
|
|
322
|
-
return false; // Dependency condition not met
|
|
323
684
|
}
|
|
685
|
+
return true;
|
|
686
|
+
});
|
|
687
|
+
// Only update if enum was actually filtered
|
|
688
|
+
if (filteredEnum.length !== enumValues.length) {
|
|
689
|
+
this.applyFilteredEnumToProperty(property, filteredEnum);
|
|
324
690
|
}
|
|
325
|
-
|
|
326
|
-
});
|
|
327
|
-
property.enum = filteredEnum;
|
|
691
|
+
}
|
|
328
692
|
}
|
|
329
693
|
}
|
|
330
694
|
}
|
|
@@ -355,40 +719,16 @@ class Decorator extends BaseClass {
|
|
|
355
719
|
schemaDefinition.description = description;
|
|
356
720
|
}
|
|
357
721
|
}
|
|
358
|
-
/**
|
|
359
|
-
* Applies the hidden decorator to the schema definition.
|
|
360
|
-
*
|
|
361
|
-
* @param schemaDefinition - The schema definition to apply the decorator to
|
|
362
|
-
* @param target - The target object or function
|
|
363
|
-
* @param propertyName - The property name (optional)
|
|
364
|
-
*/
|
|
365
|
-
applyHiddenDecorator(schemaDefinition, target, propertyName) {
|
|
366
|
-
const hiddenCondition = Reflect.getMetadata(decoration_1.metadataKeys.hidden, target, propertyName);
|
|
367
|
-
if (typeof hiddenCondition === 'function') {
|
|
368
|
-
const shouldHide = hiddenCondition(this);
|
|
369
|
-
if (shouldHide) {
|
|
370
|
-
schemaDefinition[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
else if (hiddenCondition === true) {
|
|
374
|
-
schemaDefinition[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
375
|
-
}
|
|
376
|
-
if (!schemaDefinition?.properties) {
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
for (const propertyName in schemaDefinition.properties) {
|
|
380
|
-
this.applyHiddenDecorator(schemaDefinition.properties[propertyName], target, propertyName);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
722
|
/**
|
|
384
723
|
* Applies all decorators to the schema definition.
|
|
385
724
|
*
|
|
386
725
|
* @param minUi5Version - The minimum UI5 version (optional)
|
|
387
726
|
* @param propertyName - The property name (optional)
|
|
727
|
+
* @param customDefinition - Optional custom definition to apply decorators to (overrides getBase())
|
|
388
728
|
* @returns Object containing the definition
|
|
389
729
|
*/
|
|
390
|
-
applyDecorators(minUi5Version, propertyName) {
|
|
391
|
-
const definition = this.
|
|
730
|
+
applyDecorators(minUi5Version, propertyName, customDefinition) {
|
|
731
|
+
const definition = customDefinition ?? this.getBase();
|
|
392
732
|
if (!definition) {
|
|
393
733
|
return;
|
|
394
734
|
}
|
|
@@ -399,10 +739,16 @@ class Decorator extends BaseClass {
|
|
|
399
739
|
this.applyIsViewNodeDecorator(definition, target, propertyName);
|
|
400
740
|
// Apply validity decorator (for properties)
|
|
401
741
|
this.applyValidityDecorator(definition, this, minUi5Version);
|
|
402
|
-
// Apply
|
|
403
|
-
this.
|
|
404
|
-
// Apply
|
|
405
|
-
|
|
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);
|
|
406
752
|
return { definition };
|
|
407
753
|
}
|
|
408
754
|
}
|