@sap/ux-specification 1.142.2 → 1.142.3
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 +86 -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 +265 -261
- 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 +13 -1
- package/dist/schemas/v4/ListReportConfig.json +24 -6
- package/dist/schemas/v4/ObjectPageConfig.json +32 -8
- 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.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +3 -0
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/src/api.js +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.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/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 +2 -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/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 +20 -2
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +27 -2
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js +2 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts +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 +24 -15
- 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 -46
- 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 +2 -1
- 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.js +1 -1
- 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} +22 -15
- 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} +115 -69
- 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 +142 -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 +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 +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,12 +1,19 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
import type { SyncRule, PageLayoutInformation, ValidityInformation, SyncRuleProvider, Validity,
|
|
2
|
+
import type { SyncRule, PageLayoutInformation, ValidityInformation, SyncRuleProvider, Validity, DependsOnCondition } from '@sap/ux-specification-types';
|
|
3
|
+
import { type ConditionInput, type MessageConfig } from './decorator-paths';
|
|
4
|
+
/**
|
|
5
|
+
* Metadata keys for schema post-processing.
|
|
6
|
+
* Used by decorators to store metadata that is processed during schema generation.
|
|
7
|
+
*/
|
|
3
8
|
export declare const metadataKeys: {
|
|
4
9
|
description: symbol;
|
|
5
|
-
hidden: symbol;
|
|
6
10
|
isViewNode: symbol;
|
|
7
11
|
syncRule: symbol;
|
|
8
|
-
dependsOn: symbol;
|
|
9
12
|
validity: symbol;
|
|
13
|
+
hide: symbol;
|
|
14
|
+
message: symbol;
|
|
15
|
+
readonly: symbol;
|
|
16
|
+
enums: symbol;
|
|
10
17
|
};
|
|
11
18
|
export declare const syncRule: (propSpec: SyncRule) => any;
|
|
12
19
|
/**
|
|
@@ -54,39 +61,158 @@ export declare function isViewNode(target: Function): void;
|
|
|
54
61
|
*/
|
|
55
62
|
export declare function description(text: string): (target: Function) => void;
|
|
56
63
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
64
|
+
* Internal metadata structure stored by decorators.
|
|
65
|
+
* Extends DependsOnCondition with optional message configuration.
|
|
66
|
+
*/
|
|
67
|
+
export interface DecoratorMetadata extends DependsOnCondition {
|
|
68
|
+
messageConfig?: MessageConfig;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Decorator to conditionally hide a property based on conditions.
|
|
72
|
+
* The property will be hidden if the condition(s) are NOT met (inverted logic).
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* import { page, custom, when, and, or } from './decorator-paths';
|
|
77
|
+
*
|
|
78
|
+
* // Truthy check - hide if page.isALP is falsy
|
|
79
|
+
* @hide(page.isALP)
|
|
59
80
|
*
|
|
60
|
-
*
|
|
61
|
-
* @
|
|
81
|
+
* // Equality check - hide if page.type !== 'GridTable'
|
|
82
|
+
* @hide(when(page.type, 'GridTable'))
|
|
83
|
+
*
|
|
84
|
+
* // Custom function - hide if type === 'GridTable'
|
|
85
|
+
* @hide(when(page.type, (type) => type !== 'GridTable'))
|
|
86
|
+
*
|
|
87
|
+
* // Always hide
|
|
88
|
+
* @hide(true)
|
|
89
|
+
*
|
|
90
|
+
* // AND logic - hide if not (isALP AND type === 'GridTable')
|
|
91
|
+
* @hide(and(page.isALP, when(page.type, 'GridTable')))
|
|
92
|
+
*
|
|
93
|
+
* // OR logic - hide if not (actionType === 'Bound' OR actionType === 'Custom')
|
|
94
|
+
* @hide(or(when(page.actionType, 'Bound'), when(page.actionType, 'Custom')))
|
|
95
|
+
* ```
|
|
96
|
+
* @param condition - The condition to evaluate
|
|
97
|
+
* @returns PropertyDecorator
|
|
62
98
|
*/
|
|
63
|
-
export declare function
|
|
99
|
+
export declare function hide(condition: ConditionInput): PropertyDecorator;
|
|
64
100
|
/**
|
|
65
|
-
*
|
|
101
|
+
* Retrieves the hide metadata associated with a specific property of a target object.
|
|
102
|
+
*
|
|
103
|
+
* @param target - The object containing the property.
|
|
104
|
+
* @param propertyName - The name of the property whose hide metadata is to be retrieved.
|
|
105
|
+
* @returns The hide information of the property, or undefined if no metadata is found.
|
|
106
|
+
*/
|
|
107
|
+
export declare function getHideMetadata(target: object, propertyName: string): DecoratorMetadata | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Decorator to conditionally display a message based on conditions.
|
|
110
|
+
* A message will be shown when the condition(s) are met.
|
|
111
|
+
* Multiple @message decorators can be applied to the same property - all matching conditions will show their messages.
|
|
112
|
+
*
|
|
113
|
+
* @param condition - The condition to evaluate
|
|
114
|
+
* @param messageConfig - The message configuration (use msg() helper)
|
|
115
|
+
* @returns PropertyDecorator
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* import { page, when, msg } from './decorator-paths';
|
|
119
|
+
*
|
|
120
|
+
* // Simple message
|
|
121
|
+
* @message(page.betaFeature, msg('BETA_WARNING'))
|
|
122
|
+
*
|
|
123
|
+
* // Message with parameters
|
|
124
|
+
* @message(when(page.type, 'GridTable'), msg('TABLE_WARNING', { type: 'GridTable' }))
|
|
125
|
+
*
|
|
126
|
+
* // Deletable message
|
|
127
|
+
* @message(page.deprecated, msg('DEPRECATED', { since: '1.96' }, { deletable: true }))
|
|
128
|
+
*
|
|
129
|
+
* // With AND/OR conditions
|
|
130
|
+
* @message(and(page.isALP, when(page.type, 'GridTable')), msg('ALP_GRID_INFO'))
|
|
66
131
|
*
|
|
67
|
-
*
|
|
68
|
-
* @
|
|
69
|
-
* @
|
|
132
|
+
* // Multiple messages on same property
|
|
133
|
+
* @message(when(page.type, 'AnalyticalTable'), msg('ANALYTICAL_WARNING'))
|
|
134
|
+
* @message(when(page.mode, 'edit'), msg('EDIT_MODE_WARNING'))
|
|
135
|
+
* ```
|
|
70
136
|
*/
|
|
71
|
-
export declare
|
|
137
|
+
export declare function message(condition: ConditionInput, messageConfig: MessageConfig): PropertyDecorator;
|
|
72
138
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
139
|
+
* Retrieves the message metadata associated with a specific property of a target object.
|
|
140
|
+
* Returns an array of DecoratorMetadata since multiple @message decorators can be applied.
|
|
141
|
+
*
|
|
142
|
+
* @param target - The object containing the property.
|
|
143
|
+
* @param propertyName - The name of the property whose message metadata is to be retrieved.
|
|
144
|
+
* @returns An array of message metadata, or undefined if no metadata is found.
|
|
145
|
+
*/
|
|
146
|
+
export declare function getMessageMetadata(target: object, propertyName: string): DecoratorMetadata[] | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Decorator to conditionally mark a property as readonly based on conditions.
|
|
149
|
+
* The property will be readonly when the condition(s) are met.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* import { page, custom, when } from './decorator-paths';
|
|
154
|
+
*
|
|
155
|
+
* // Truthy check - readonly if page.isLocked is truthy
|
|
156
|
+
* @readonly(page.isLocked)
|
|
157
|
+
*
|
|
158
|
+
* // Equality check - readonly if mode === 'view'
|
|
159
|
+
* @readonly(when(page.mode, 'view'))
|
|
160
|
+
*
|
|
161
|
+
* // Custom function - readonly if role is 'viewer'
|
|
162
|
+
* @readonly(when(custom.user.role, (role) => role === 'viewer'))
|
|
163
|
+
* ```
|
|
164
|
+
* @param condition - The condition to evaluate
|
|
165
|
+
* @returns PropertyDecorator
|
|
166
|
+
*/
|
|
167
|
+
export declare function readonly(condition: ConditionInput): PropertyDecorator;
|
|
168
|
+
/**
|
|
169
|
+
* Retrieves the readonly metadata associated with a specific property of a target object.
|
|
170
|
+
*
|
|
171
|
+
* @param target - The object containing the property.
|
|
172
|
+
* @param propertyName - The name of the property whose readonly metadata is to be retrieved.
|
|
173
|
+
* @returns The readonly information of the property, or undefined if no metadata is found.
|
|
174
|
+
*/
|
|
175
|
+
export declare function getReadonlyMetadata(target: object, propertyName: string): DecoratorMetadata | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Metadata structure for the @enums decorator.
|
|
178
|
+
* Extends DecoratorMetadata with the list of allowed enum values.
|
|
179
|
+
*/
|
|
180
|
+
export interface EnumsDecoratorMetadata extends DecoratorMetadata {
|
|
181
|
+
/** The allowed enum values when the condition is met */
|
|
182
|
+
allowedValues: string[];
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Decorator to conditionally restrict enum values based on conditions.
|
|
186
|
+
* When the condition is met, only the specified allowedValues will be available.
|
|
187
|
+
* If multiple @enums decorators exist on the same property, the first matching condition wins.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* import { custom, when } from './decorator-paths';
|
|
192
|
+
*
|
|
193
|
+
* // Restrict to specific values when table type is TreeTable
|
|
194
|
+
* @enums(when(custom.table.type, 'TreeTable'), ['Inline', 'NewPage', 'CreationDialog'])
|
|
195
|
+
*
|
|
196
|
+
* // Different values for other table types
|
|
197
|
+
* @enums(when(custom.table.type, 'ResponsiveTable'), ['Inline', 'InlineCreationRows', 'NewPage', 'CreationDialog', 'External'])
|
|
75
198
|
*
|
|
76
|
-
*
|
|
77
|
-
* @
|
|
78
|
-
*
|
|
199
|
+
* // Default values when no other condition matches
|
|
200
|
+
* @enums(true, ['NewPage', 'CreationDialog'])
|
|
201
|
+
* ```
|
|
202
|
+
* @param condition - The condition to evaluate
|
|
203
|
+
* @param allowedValues - Array of allowed enum values when condition is met
|
|
79
204
|
* @returns PropertyDecorator
|
|
80
205
|
*/
|
|
81
|
-
export declare function
|
|
206
|
+
export declare function enums(condition: ConditionInput, allowedValues: string[]): PropertyDecorator;
|
|
82
207
|
/**
|
|
83
|
-
* Retrieves the
|
|
208
|
+
* Retrieves the enums metadata associated with a specific property of a target object.
|
|
209
|
+
* Returns an array of EnumsDecoratorMetadata since multiple @enums decorators can be applied.
|
|
84
210
|
*
|
|
85
211
|
* @param target - The object containing the property.
|
|
86
|
-
* @param propertyName - The name of the property whose
|
|
87
|
-
* @returns
|
|
212
|
+
* @param propertyName - The name of the property whose enums metadata is to be retrieved.
|
|
213
|
+
* @returns An array of enums metadata, or undefined if no metadata is found.
|
|
88
214
|
*/
|
|
89
|
-
export declare function
|
|
215
|
+
export declare function getEnumsMetadata(target: object, propertyName: string): EnumsDecoratorMetadata[] | undefined;
|
|
90
216
|
/**
|
|
91
217
|
* Generates a deprecation message for a given key, optionally including additional validity information.
|
|
92
218
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACR,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACR,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAIrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAQH,KAAK,cAAc,EAEnB,KAAK,aAAa,EAErB,MAAM,mBAAmB,CAAC;AAM3B;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;CASxB,CAAC;AAMF,eAAO,MAAM,QAAQ,GAAI,UAAU,QAAQ,KAAG,GAE7C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAM7F;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,QAAQ,GAAG,SAAS,CAMlF;AAMD,eAAO,MAAM,qBAAqB,GAC7B,UAAU,qBAAqB,MAC/B,aAAa,QAAQ,KAAG,IAExB,CAAC;AAGN,eAAO,MAAM,OAAO,G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