@sap/ux-specification 1.142.2 → 1.142.4
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 +117 -43
- 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 +288 -282
- 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 +128 -42
- package/dist/schemas/v4/ListReportConfig.json +24 -6
- package/dist/schemas/v4/ObjectPageConfig.json +32 -8
- package/dist/specification/package.json +14 -12
- 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.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +36 -1
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
- package/dist/specification/scripts/macros/schema.js +13 -0
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/src/api.js +1 -1
- package/dist/specification/src/i18n/i18n.d.ts.map +1 -1
- package/dist/specification/src/i18n/i18n.js +2 -1
- package/dist/specification/src/i18n/i18n.js.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +8 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +10 -7
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-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 +116 -24
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +308 -78
- 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.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +3 -1
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +2 -1
- package/dist/specification/src/sync/common/rules.d.ts +25 -0
- package/dist/specification/src/sync/common/rules.d.ts.map +1 -1
- package/dist/specification/src/sync/common/rules.js +27 -2
- package/dist/specification/src/sync/common/rules.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +22 -6
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +122 -18
- package/dist/specification/src/sync/common/utils.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 +9 -7
- 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 +58 -2
- 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/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/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 +31 -2
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +44 -4
- 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 +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/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/Table.d.ts +32 -17
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +90 -60
- 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/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 +4 -3
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/export.js +25 -3
- 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/generate/actions.d.ts +1 -1
- package/dist/specification/src/sync/v4/generate/actions.d.ts.map +1 -1
- 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 +20 -12
- 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/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +10 -1
- 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} +27 -16
- 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} +194 -164
- package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +145 -44
- 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/utils.js +5 -3
- 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 +219 -96
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +557 -211
- 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 +9 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +17 -2
- 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 +2 -3
- package/dist/types/src/apiTypes.d.ts.map +1 -1
- package/dist/types/src/apiTypes.js.map +1 -1
- package/dist/types/src/common/types.d.ts +119 -13
- package/dist/types/src/common/types.d.ts.map +1 -1
- 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/ObjectPageTable.d.ts +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.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/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 -394
- 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
|
@@ -1,171 +1,294 @@
|
|
|
1
1
|
import type { Definition } from 'typescript-json-schema';
|
|
2
|
+
import type { ExtensionLogger } from '@sap/ux-specification-types';
|
|
3
|
+
import type { App } from './App';
|
|
4
|
+
import type { Page } from './Page';
|
|
5
|
+
import type { AppSchema } from './AppSchema';
|
|
6
|
+
export type GeneralSettings<PageWithConfig extends Page = Page> = {
|
|
7
|
+
appSchema: AppSchema;
|
|
8
|
+
app: App;
|
|
9
|
+
page: PageWithConfig;
|
|
10
|
+
logger?: ExtensionLogger;
|
|
11
|
+
};
|
|
12
|
+
export declare class BaseConstruct {
|
|
13
|
+
protected readonly appSchema: AppSchema;
|
|
14
|
+
protected readonly app: App;
|
|
15
|
+
protected readonly page: Page;
|
|
16
|
+
protected readonly logger?: ExtensionLogger;
|
|
17
|
+
/**
|
|
18
|
+
* Creates the base construct with access to the app schema, app/page configuration, and logger.
|
|
19
|
+
*
|
|
20
|
+
* @param settings - Shared context (appSchema, app, page, logger) passed to all decorator classes
|
|
21
|
+
*/
|
|
22
|
+
constructor(settings?: GeneralSettings);
|
|
23
|
+
/**
|
|
24
|
+
* Returns the shared context (appSchema, app, page, logger) for use by subclasses or callers.
|
|
25
|
+
*
|
|
26
|
+
* @returns The current settings object
|
|
27
|
+
*/
|
|
28
|
+
getSettings(): GeneralSettings;
|
|
29
|
+
}
|
|
2
30
|
export interface Base {
|
|
3
31
|
name: string;
|
|
4
32
|
definition: Definition;
|
|
5
33
|
}
|
|
6
|
-
export declare class BaseClass {
|
|
7
|
-
private
|
|
8
|
-
private base;
|
|
34
|
+
export declare class BaseClass extends BaseConstruct {
|
|
35
|
+
private readonly base;
|
|
9
36
|
/**
|
|
10
|
-
*
|
|
37
|
+
* Looks up the matching schema definition by class name and stores it as the base.
|
|
11
38
|
*
|
|
12
|
-
* @param
|
|
39
|
+
* @param settings - Shared context (appSchema, app, page, logger) passed to all decorator classes
|
|
13
40
|
*/
|
|
14
|
-
constructor(
|
|
41
|
+
constructor(settings?: GeneralSettings);
|
|
15
42
|
/**
|
|
16
|
-
*
|
|
43
|
+
* Returns the class name used to look up the matching schema definition.
|
|
17
44
|
*
|
|
18
|
-
* @returns The name of
|
|
45
|
+
* @returns The constructor name of this class
|
|
19
46
|
*/
|
|
20
47
|
getClassName(): string;
|
|
21
48
|
/**
|
|
22
|
-
*
|
|
49
|
+
* Returns the name stored at construction time for the schema definition lookup.
|
|
23
50
|
*
|
|
24
|
-
* @returns The base name
|
|
51
|
+
* @returns The base definition name
|
|
25
52
|
*/
|
|
26
53
|
getBaseName(): string;
|
|
27
54
|
/**
|
|
28
|
-
*
|
|
55
|
+
* Returns the schema definition that decorators are applied to.
|
|
29
56
|
*
|
|
30
|
-
* @returns The
|
|
57
|
+
* @returns The JSON schema definition for this class
|
|
31
58
|
*/
|
|
32
59
|
getBase(): Definition;
|
|
33
60
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @param base - The base object containing name and definition
|
|
37
|
-
*/
|
|
38
|
-
setBase(base: Base): void;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the definitions from the app schema.
|
|
41
|
-
*
|
|
42
|
-
* @returns The definitions object or undefined
|
|
43
|
-
*/
|
|
44
|
-
getDefinitions(): Definition | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Creates an annotation path for schema based on entity type, term, and qualifier.
|
|
61
|
+
* Builds an annotation path like `/<EntityType>/@<Term>#<Qualifier>` and stores it on the schema definition.
|
|
47
62
|
*
|
|
48
|
-
* @param entityTypeName -
|
|
49
|
-
* @param term -
|
|
50
|
-
* @param qualifier -
|
|
51
|
-
* @returns
|
|
63
|
+
* @param entityTypeName - The OData entity type name (e.g. "SalesOrderItem")
|
|
64
|
+
* @param term - The annotation term (e.g. "com.sap.vocabularies.UI.v1.LineItem")
|
|
65
|
+
* @param qualifier - Optional qualifier to disambiguate multiple annotations of the same term
|
|
66
|
+
* @returns The built annotation path, or undefined if entityTypeName is empty
|
|
52
67
|
*/
|
|
53
68
|
createAnnotationPath(entityTypeName: string, term: string, qualifier?: string): string | undefined;
|
|
54
69
|
}
|
|
55
70
|
export declare class Decorator extends BaseClass {
|
|
56
71
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
72
|
+
* Evaluation context built from app config, page config, and optional custom values.
|
|
73
|
+
* Non-enumerable to stay hidden from serialization.
|
|
59
74
|
*/
|
|
60
|
-
private
|
|
75
|
+
private decoratorContext;
|
|
61
76
|
/**
|
|
62
|
-
* Sets the
|
|
63
|
-
* This enables nested decorators to access parent properties using the '../' prefix in @dependsOn.
|
|
77
|
+
* Sets up the decorator context as non-enumerable so it stays hidden from serialization.
|
|
64
78
|
*
|
|
65
|
-
* @param
|
|
66
|
-
* @returns this (for method chaining)
|
|
79
|
+
* @param settings - Shared context (appSchema, app, page, logger) passed to all decorator classes
|
|
67
80
|
*/
|
|
68
|
-
|
|
81
|
+
constructor(settings?: GeneralSettings);
|
|
69
82
|
/**
|
|
70
|
-
*
|
|
83
|
+
* Builds the decorator context from app, page, and custom values, then applies all
|
|
84
|
+
* decorators (enums, message, hide, readonly) to the schema definition.
|
|
71
85
|
*
|
|
72
|
-
* @
|
|
86
|
+
* @param customContext - Specific values (e.g. table state, section state) used for condition evaluation
|
|
87
|
+
* @param definition - Override the schema definition to decorate (defaults to getBase())
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* // Basic initialization (app and page auto-injected)
|
|
91
|
+
* decorator.init();
|
|
92
|
+
*
|
|
93
|
+
* // With custom context for table-specific conditions
|
|
94
|
+
* decorator.init({
|
|
95
|
+
* table: { type: 'GridTable', views: [] }
|
|
96
|
+
* });
|
|
97
|
+
*
|
|
98
|
+
* // With custom definition (for dynamically created definitions)
|
|
99
|
+
* decorator.init({ table: { type: 'GridTable' } }, customTableDefinition);
|
|
100
|
+
* ```
|
|
73
101
|
*/
|
|
74
|
-
|
|
102
|
+
init(customContext?: Record<string, unknown>, definition?: Definition): void;
|
|
75
103
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
104
|
+
* Resolves a dotted property path (e.g. `page.isALP`, `custom.items[0].name`) against
|
|
105
|
+
* the decorator context using JSONPath. The path must start with a known source prefix
|
|
106
|
+
* (`app`, `page`, or `custom`).
|
|
79
107
|
*
|
|
80
|
-
* @param
|
|
81
|
-
* @
|
|
82
|
-
* @
|
|
108
|
+
* @param propertyPath - Dotted path with source prefix, supports full JSONPath syntax
|
|
109
|
+
* @returns The resolved `{ key, value }` pair, or undefined if the path does not resolve
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* // With decoratorContext = {
|
|
113
|
+
* // app: { manifest: { 'sap.ui5': { routing: {...} } } },
|
|
114
|
+
* // page: { isALP: true },
|
|
115
|
+
* // custom: { type: 'GridTable', items: [{ name: 'Item1' }, { name: 'Item2' }] }
|
|
116
|
+
* // }
|
|
117
|
+
* getPropertyKeyValue('page.isALP') // { key: 'isALP', value: true }
|
|
118
|
+
* getPropertyKeyValue('custom.items[0]') // { key: '0', value: { name: 'Item1' } }
|
|
119
|
+
* getPropertyKeyValue('custom.items[1].name') // { key: 'name', value: 'Item2' }
|
|
120
|
+
* getPropertyKeyValue('app.manifest["sap.ui5"]') // Access property with dot in name
|
|
121
|
+
* getPropertyKeyValue('$.app.manifest["sap.ui5"].routing') // JSONPath with root reference
|
|
122
|
+
* getPropertyKeyValue('$app["manifest"]["sap.ui5"]') // Alternative JSONPath format
|
|
123
|
+
* ```
|
|
83
124
|
*/
|
|
84
125
|
private getPropertyKeyValue;
|
|
85
126
|
/**
|
|
86
|
-
* Evaluates
|
|
127
|
+
* Evaluates one condition: resolves the path, applies the check (custom function,
|
|
128
|
+
* equality, or truthy), and optionally negates the result (for `not()` conditions).
|
|
87
129
|
*
|
|
88
|
-
* @param condition -
|
|
89
|
-
* @
|
|
90
|
-
* @param condition.dependsOn - Optional custom condition function
|
|
91
|
-
* @param condition.expectedValue - Optional expected value for equality check
|
|
92
|
-
* @param syncRuleProviderInstance - The sync rule provider instance
|
|
93
|
-
* @returns Object containing whether condition passed and the dependency value
|
|
130
|
+
* @param condition - A single condition with path, expected value, and optional negate flag
|
|
131
|
+
* @returns Whether the condition passed along with the resolved value and key
|
|
94
132
|
*/
|
|
95
133
|
private evaluateSingleCondition;
|
|
96
134
|
/**
|
|
97
|
-
*
|
|
135
|
+
* Translates and attaches a message to a schema property.
|
|
136
|
+
* Supports both the new `MessageConfig` format (from `msg()` helper) and the legacy `DependsOnMessage` format.
|
|
98
137
|
*
|
|
99
|
-
* @param condition -
|
|
100
|
-
* @param
|
|
101
|
-
* @param definition - The schema property definition
|
|
102
|
-
* @param i18nProperties - i18n
|
|
103
|
-
* @param i18nProperties.propertyName - The property name
|
|
104
|
-
* @param i18nProperties.context - The context
|
|
138
|
+
* @param condition - The decorator metadata or enum value condition containing the message definition
|
|
139
|
+
* @param decoratedClass - The decorated class instance, used for legacy function-based message text
|
|
140
|
+
* @param definition - The schema property definition to attach the message to
|
|
141
|
+
* @param i18nProperties - Context for i18n translation (propertyName, evaluation context)
|
|
142
|
+
* @param i18nProperties.propertyName - The property name used as i18n parameter
|
|
143
|
+
* @param i18nProperties.context - The evaluation context string used as i18n parameter
|
|
105
144
|
*/
|
|
106
145
|
private addConditionalMessage;
|
|
107
146
|
/**
|
|
108
|
-
*
|
|
147
|
+
* Resolves any `PathNode` values in message params to their actual values from the decorator context.
|
|
109
148
|
*
|
|
110
|
-
* @param
|
|
111
|
-
* @returns
|
|
149
|
+
* @param params - Message parameters that may contain PathNode references
|
|
150
|
+
* @returns A new params object with PathNode values replaced by their resolved context values
|
|
151
|
+
*/
|
|
152
|
+
private resolveMessageParams;
|
|
153
|
+
/**
|
|
154
|
+
* Builds a human-readable context string from the evaluation results that did not pass.
|
|
155
|
+
* Used for diagnostic messages showing which conditions were unmet.
|
|
156
|
+
*
|
|
157
|
+
* @param results - The condition evaluation results to summarize
|
|
158
|
+
* @returns A comma-separated string of `key: value` pairs for failed conditions
|
|
112
159
|
*/
|
|
113
160
|
private getContextForMessage;
|
|
114
161
|
/**
|
|
115
|
-
*
|
|
162
|
+
* Evaluates one item inside an AND group — either a single condition or a nested OR group.
|
|
116
163
|
*
|
|
117
|
-
* @param
|
|
118
|
-
* @
|
|
164
|
+
* @param conditionItem - A single condition or a nested `{ __orConditions }` group
|
|
165
|
+
* @returns Whether the item passed and the detailed evaluation results
|
|
119
166
|
*/
|
|
120
|
-
private
|
|
167
|
+
private evaluateAndConditionItem;
|
|
121
168
|
/**
|
|
122
|
-
*
|
|
169
|
+
* Evaluates OR conditions — passes when at least one item (single condition or nested AND group) matches.
|
|
170
|
+
* Short-circuits on the first passing item.
|
|
123
171
|
*
|
|
124
|
-
* @param
|
|
125
|
-
* @
|
|
126
|
-
|
|
172
|
+
* @param orConditions - Array of conditions or nested AND groups to evaluate
|
|
173
|
+
* @returns Whether any condition passed and the collected evaluation results
|
|
174
|
+
*/
|
|
175
|
+
private evaluateOrConditions;
|
|
176
|
+
/**
|
|
177
|
+
* Evaluates AND conditions — passes only when every item (single condition or nested OR group) matches.
|
|
178
|
+
* Continues even after a failure to collect all results for diagnostic context.
|
|
179
|
+
*
|
|
180
|
+
* @param andConditions - Array of conditions or nested OR groups that must all pass
|
|
181
|
+
* @returns Whether all conditions passed and the collected evaluation results
|
|
182
|
+
*/
|
|
183
|
+
private evaluateAndConditions;
|
|
184
|
+
/**
|
|
185
|
+
* Entry point for condition evaluation. Dispatches to OR, AND, or single evaluation
|
|
186
|
+
* depending on the shape of the condition metadata.
|
|
187
|
+
*
|
|
188
|
+
* @param conditionInfo - The decorator condition metadata (single, AND, or OR)
|
|
189
|
+
* @returns Whether the condition passed and a diagnostic context string
|
|
190
|
+
*/
|
|
191
|
+
private evaluateCondition;
|
|
192
|
+
/**
|
|
193
|
+
* Yields each property from a schema definition for decorator processing.
|
|
194
|
+
* Returns early if the definition has no properties or the target is falsy.
|
|
195
|
+
*
|
|
196
|
+
* @param schemaDefinition - The schema definition whose properties to iterate
|
|
197
|
+
* @param target - Guard object — iteration is skipped if falsy
|
|
198
|
+
* @yields Property name and its definition for each property in the schema
|
|
199
|
+
*/
|
|
200
|
+
private iterateProperties;
|
|
201
|
+
/**
|
|
202
|
+
* Hides properties whose `@hide` conditions pass.
|
|
203
|
+
* Multiple `@hide` decorators use OR semantics — any passing condition hides the property.
|
|
204
|
+
* Skipped when the `@message` decorator already added messages to the property.
|
|
205
|
+
*
|
|
206
|
+
* @param schemaDefinition - The schema definition to process
|
|
207
|
+
* @param decoratedClass - The decorated class instance carrying `@hide` metadata
|
|
208
|
+
*/
|
|
209
|
+
private applyHideDecorator;
|
|
210
|
+
/**
|
|
211
|
+
* Shows messages on properties whose `@message` conditions pass.
|
|
212
|
+
* Must run before `applyHideDecorator` so hide can detect existing messages.
|
|
213
|
+
*
|
|
214
|
+
* @param schemaDefinition - The schema definition to process
|
|
215
|
+
* @param decoratedClass - The decorated class instance carrying `@message` metadata
|
|
216
|
+
*/
|
|
217
|
+
private applyMessageDecorator;
|
|
218
|
+
/**
|
|
219
|
+
* Marks properties as read-only whose `@readonly` conditions pass.
|
|
220
|
+
* Multiple `@readonly` decorators use OR semantics — any passing condition makes the property read-only.
|
|
221
|
+
*
|
|
222
|
+
* @param schemaDefinition - The schema definition to process
|
|
223
|
+
* @param decoratedClass - The decorated class instance carrying `@readonly` metadata
|
|
224
|
+
*/
|
|
225
|
+
private applyReadonlyDecorator;
|
|
226
|
+
/**
|
|
227
|
+
* Restricts enum values on properties whose `@enums` conditions pass.
|
|
228
|
+
* When multiple `@enums` decorators exist on the same property, the first matching condition wins.
|
|
229
|
+
*
|
|
230
|
+
* @param schemaDefinition - The schema definition to process
|
|
231
|
+
* @param decoratedClass - The decorated class instance carrying `@enums` metadata
|
|
232
|
+
*/
|
|
233
|
+
private applyEnumsDecorator;
|
|
234
|
+
/**
|
|
235
|
+
* Reads the `@validity` metadata stored on a property of the decorated class.
|
|
236
|
+
*
|
|
237
|
+
* @param target - The decorated class instance
|
|
238
|
+
* @param propertyName - The property to read validity metadata from
|
|
239
|
+
* @returns The validity constraints (since, enum restrictions), or undefined if none
|
|
127
240
|
*/
|
|
128
241
|
private getValidityMetadata;
|
|
129
242
|
/**
|
|
130
|
-
*
|
|
243
|
+
* Returns the enum values from a property definition, resolving `$ref` to a shared enum definition if needed.
|
|
131
244
|
*
|
|
132
|
-
* @param
|
|
133
|
-
* @
|
|
134
|
-
* @param minUI5Version The minimum UI5 version to consider for validity checks
|
|
245
|
+
* @param property - The schema property definition (may have inline `enum` or a `$ref`)
|
|
246
|
+
* @returns The enum values array, or undefined if the property is not an enum
|
|
135
247
|
*/
|
|
136
|
-
private
|
|
248
|
+
private resolveEnumFromProperty;
|
|
137
249
|
/**
|
|
138
|
-
*
|
|
250
|
+
* Writes filtered enum values to a property definition.
|
|
251
|
+
* For `$ref` properties, inlines the enum, copies the type, and removes the `$ref`.
|
|
139
252
|
*
|
|
140
|
-
* @param
|
|
141
|
-
* @param
|
|
142
|
-
* @param propertyName The property name (optional)
|
|
253
|
+
* @param property - The schema property definition to update
|
|
254
|
+
* @param filteredEnum - The allowed enum values after filtering
|
|
143
255
|
*/
|
|
144
|
-
private
|
|
256
|
+
private applyFilteredEnumToProperty;
|
|
145
257
|
/**
|
|
146
|
-
*
|
|
258
|
+
* Hides properties and filters enum values that require a UI5 version higher than the app's minimum.
|
|
147
259
|
*
|
|
148
|
-
* @param schemaDefinition - The schema definition to
|
|
149
|
-
* @param
|
|
150
|
-
* @param
|
|
260
|
+
* @param schemaDefinition - The schema definition to process
|
|
261
|
+
* @param decoratedClass - The decorated class instance carrying `@validity` metadata
|
|
262
|
+
* @param minUI5Version - The app's minimum UI5 version to check against
|
|
151
263
|
*/
|
|
152
|
-
private
|
|
264
|
+
private applyValidityDecorator;
|
|
265
|
+
/**
|
|
266
|
+
* Marks the schema definition as a view node if the `@isViewNode` decorator is present on the target.
|
|
267
|
+
*
|
|
268
|
+
* @param schemaDefinition - The schema definition to tag
|
|
269
|
+
* @param target - The class constructor or prototype carrying the decorator
|
|
270
|
+
* @param propertyName - Optional property name for property-level decorators
|
|
271
|
+
*/
|
|
272
|
+
private applyIsViewNodeDecorator;
|
|
153
273
|
/**
|
|
154
|
-
*
|
|
274
|
+
* Sets the schema `description` field from the `@description` decorator if present on the target.
|
|
155
275
|
*
|
|
156
|
-
* @param schemaDefinition - The schema definition to
|
|
157
|
-
* @param target - The
|
|
158
|
-
* @param propertyName -
|
|
276
|
+
* @param schemaDefinition - The schema definition to update
|
|
277
|
+
* @param target - The class constructor or prototype carrying the decorator
|
|
278
|
+
* @param propertyName - Optional property name for property-level decorators
|
|
159
279
|
*/
|
|
160
|
-
private
|
|
280
|
+
private applyDescriptionDecorator;
|
|
161
281
|
/**
|
|
162
|
-
* Applies all decorators to the schema
|
|
282
|
+
* Applies all decorators to the schema in the correct order:
|
|
283
|
+
* description → isViewNode → validity → enums → message → hide → readonly.
|
|
284
|
+
* Message runs before hide so that hide can skip properties that already have messages.
|
|
163
285
|
*
|
|
164
|
-
* @param minUi5Version - The minimum UI5 version
|
|
165
|
-
* @param propertyName -
|
|
166
|
-
* @
|
|
286
|
+
* @param minUi5Version - The app's minimum UI5 version for validity checks
|
|
287
|
+
* @param propertyName - Optional property name when decorating a single property
|
|
288
|
+
* @param customDefinition - Override the schema definition (defaults to `getBase()`)
|
|
289
|
+
* @returns The decorated schema definition
|
|
167
290
|
*/
|
|
168
|
-
applyDecorators(minUi5Version?: string, propertyName?: string): {
|
|
291
|
+
applyDecorators(minUi5Version?: string, propertyName?: string, customDefinition?: Definition): {
|
|
169
292
|
definition: Definition;
|
|
170
293
|
};
|
|
171
294
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoratorClass.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v4/sync-rules/DecoratorClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"DecoratorClass.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v4/sync-rules/DecoratorClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAGR,eAAe,EAKlB,MA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