@sap/ux-specification 1.96.105 → 1.96.107
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 +61 -0
- package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
- package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
- package/dist/documentation/v2/v2-ListReport.html +2 -2
- package/dist/documentation/v2/v2-ListReportNew.html +2 -2
- package/dist/documentation/v2/v2-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
- package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
- package/dist/documentation/v4/v4-FreestylePage.html +2 -2
- package/dist/documentation/v4/v4-ListReport.html +2 -2
- package/dist/documentation/v4/v4-ObjectPage.html +2 -2
- package/dist/index-min.js +278 -269
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/ListReportNewConfig.json +165 -7
- package/dist/schemas/v4/BuildingBlocksConfig.json +227 -1
- package/dist/specification/package.json +10 -10
- package/dist/specification/scripts/generate-validity-report.js +1 -1
- package/dist/specification/scripts/generate-validity-report.js.map +1 -1
- package/dist/specification/scripts/macros/corrections.d.ts +1 -0
- package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +124 -4
- 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 +36 -10
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
- package/dist/specification/src/api.d.ts.map +1 -1
- package/dist/specification/src/api.js +39 -3
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/ftfs/ftfs.d.ts +8 -0
- package/dist/specification/src/ftfs/ftfs.d.ts.map +1 -1
- package/dist/specification/src/ftfs/ftfs.js +1 -0
- package/dist/specification/src/ftfs/ftfs.js.map +1 -1
- package/dist/specification/src/ftfs/index.d.ts +1 -1
- package/dist/specification/src/ftfs/index.d.ts.map +1 -1
- package/dist/specification/src/ftfs/index.js +2 -1
- package/dist/specification/src/ftfs/index.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.js +3 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.js.map +1 -1
- package/dist/specification/src/i18n/i18n.d.ts.map +1 -1
- package/dist/specification/src/i18n/i18n.js +2 -1
- package/dist/specification/src/i18n/i18n.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/Decorator.d.ts +91 -0
- package/dist/specification/src/sync/common/decoration/Decorator.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/Decorator.js +139 -0
- package/dist/specification/src/sync/common/decoration/Decorator.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.d.ts +95 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.js +210 -0
- package/dist/specification/src/sync/common/decoration/condition-evaluator.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +5 -22
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.d.ts +6 -48
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +26 -106
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.d.ts +4 -0
- package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.js +4 -0
- package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/interfaces.d.ts +38 -0
- package/dist/specification/src/sync/common/decoration/interfaces.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/interfaces.js +3 -0
- package/dist/specification/src/sync/common/decoration/interfaces.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.js +50 -0
- package/dist/specification/src/sync/common/decoration/steps/Enums.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.js +46 -0
- package/dist/specification/src/sync/common/decoration/steps/Hide.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.d.ts +26 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.js +77 -0
- package/dist/specification/src/sync/common/decoration/steps/Message.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.js +43 -0
- package/dist/specification/src/sync/common/decoration/steps/Readonly.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.d.ts +18 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.js +68 -0
- package/dist/specification/src/sync/common/decoration/steps/Validity.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.d.ts +19 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.js +48 -0
- package/dist/specification/src/sync/common/decoration/steps/enum-utils.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/index.d.ts +6 -0
- package/dist/specification/src/sync/common/decoration/steps/index.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/steps/index.js +14 -0
- package/dist/specification/src/sync/common/decoration/steps/index.js.map +1 -0
- package/dist/specification/src/sync/common/i18n.json +18 -0
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts +4 -5
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.js +29 -20
- package/dist/specification/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/specification/src/sync/v2/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/export.js +3 -2
- package/dist/specification/src/sync/v2/export/export.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.js +48 -19
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts +2 -0
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js +17 -6
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts +54 -6
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.js +106 -12
- package/dist/specification/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +7 -7
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.js +56 -2
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +2 -2
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.js +4 -4
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.js +3 -3
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +57 -2
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +567 -7
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js +29 -6
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js.map +1 -1
- package/dist/specification/src/sync/v2/types.d.ts +2 -0
- package/dist/specification/src/sync/v2/types.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/types.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +25 -0
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +28 -4
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +11 -0
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +16 -1
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +3 -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 +10 -7
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts +1 -0
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js +212 -46
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +13 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +93 -13
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js +4 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +32 -28
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +12 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +17 -23
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js +20 -0
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts +2 -4
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js +2 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +2 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +3 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +119 -127
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +168 -168
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +5 -0
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.d.ts +19 -0
- package/dist/specification/src/sync/v4/utils/macros.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.js +34 -0
- package/dist/specification/src/sync/v4/utils/macros.js.map +1 -1
- package/dist/specification/test/test-utils/utils.d.ts.map +1 -1
- package/dist/specification/test/test-utils/utils.js +4 -0
- package/dist/specification/test/test-utils/utils.js.map +1 -1
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts +66 -197
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts.map +1 -1
- package/dist/specification/test/unit/decorators/validity-test-utils.js +378 -280
- package/dist/specification/test/unit/decorators/validity-test-utils.js.map +1 -1
- package/dist/templates/AnalyticalTableColumnsExtension.xml +3 -3
- package/dist/templates/GridTableColumnsExtension.xml +3 -3
- package/dist/templates/ResponsiveTableColumnsExtension.xml +2 -2
- package/dist/templates/TreeTableColumnsExtension.xml +4 -4
- package/dist/templates/fragment.xml +3 -3
- package/dist/templates/view.xml +3 -3
- package/dist/types/src/apiTypes.d.ts +15 -5
- package/dist/types/src/apiTypes.d.ts.map +1 -1
- package/dist/types/src/apiTypes.js +1 -0
- package/dist/types/src/apiTypes.js.map +1 -1
- package/dist/types/src/common/types.d.ts +1 -0
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionEvaluator = void 0;
|
|
4
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
5
|
+
const decorator_paths_1 = require("./decorator-paths");
|
|
6
|
+
/**
|
|
7
|
+
* Evaluates decorator conditions against runtime context.
|
|
8
|
+
* Supports single conditions, AND conditions, and OR conditions with nesting.
|
|
9
|
+
*/
|
|
10
|
+
class ConditionEvaluator {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new ConditionEvaluator with the given decorator context.
|
|
13
|
+
*
|
|
14
|
+
* @param context - The decorator context containing app, page, and custom runtime data
|
|
15
|
+
*/
|
|
16
|
+
constructor(context) {
|
|
17
|
+
this.context = {
|
|
18
|
+
// Use app.config (plain AppContext) for JSONPath evaluation, not the full App instance.
|
|
19
|
+
// app.config holds manifest and other plain data that path builders reference (e.g. app.manifest).
|
|
20
|
+
app: context.app?.config,
|
|
21
|
+
page: context.page?.config,
|
|
22
|
+
custom: context.custom
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets property value from the decorator context using a property path.
|
|
27
|
+
* Supports JSONPath syntax for complex paths.
|
|
28
|
+
*
|
|
29
|
+
* @param propertyPath - JSONPath-style path to resolve (e.g. 'page.isALP', 'custom.type')
|
|
30
|
+
* @returns The key/value pair at the resolved path, or undefined if not found
|
|
31
|
+
*/
|
|
32
|
+
getPropertyKeyValue(propertyPath) {
|
|
33
|
+
if (!propertyPath || !this.context) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const jsonPath = propertyPath.startsWith('$') ? propertyPath : `$.${propertyPath}`;
|
|
38
|
+
const results = (0, jsonpath_plus_1.JSONPath)({
|
|
39
|
+
path: jsonPath,
|
|
40
|
+
json: this.context,
|
|
41
|
+
resultType: 'all'
|
|
42
|
+
});
|
|
43
|
+
if (!results || results.length === 0) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const result = results[0];
|
|
47
|
+
const key = String(result.parentProperty);
|
|
48
|
+
const value = result.value;
|
|
49
|
+
return { key, value };
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolves PathNode values in message params to their actual values.
|
|
57
|
+
*
|
|
58
|
+
* @param params - Optional map of parameter names to values (may contain PathNodes)
|
|
59
|
+
* @returns Resolved params with PathNodes replaced by their runtime values
|
|
60
|
+
*/
|
|
61
|
+
resolveMessageParams(params) {
|
|
62
|
+
if (!params) {
|
|
63
|
+
return params;
|
|
64
|
+
}
|
|
65
|
+
const resolved = {};
|
|
66
|
+
for (const [key, value] of Object.entries(params)) {
|
|
67
|
+
if ((0, decorator_paths_1.isPathNode)(value)) {
|
|
68
|
+
const result = this.getPropertyKeyValue((0, decorator_paths_1.getPath)(value));
|
|
69
|
+
resolved[key] = result?.value ?? '';
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
resolved[key] = value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return resolved;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Evaluates a condition and returns whether it passed and context for messages.
|
|
79
|
+
*
|
|
80
|
+
* @param conditionInfo - The condition to evaluate (single, AND, or OR)
|
|
81
|
+
* @returns Whether the condition passed and a context string for message interpolation
|
|
82
|
+
*/
|
|
83
|
+
evaluate(conditionInfo) {
|
|
84
|
+
let passed = false;
|
|
85
|
+
let context = '';
|
|
86
|
+
if (conditionInfo.orConditions && Array.isArray(conditionInfo.orConditions)) {
|
|
87
|
+
const result = this.evaluateOrConditions(conditionInfo.orConditions);
|
|
88
|
+
passed = result.passed;
|
|
89
|
+
context = this.getContextForMessage(result.results);
|
|
90
|
+
}
|
|
91
|
+
else if (conditionInfo.conditions && Array.isArray(conditionInfo.conditions)) {
|
|
92
|
+
const result = this.evaluateAndConditions(conditionInfo.conditions);
|
|
93
|
+
passed = result.passed;
|
|
94
|
+
context = this.getContextForMessage(result.results);
|
|
95
|
+
}
|
|
96
|
+
else if (conditionInfo.path) {
|
|
97
|
+
const result = this.evaluateSingleCondition(conditionInfo);
|
|
98
|
+
passed = result.passed;
|
|
99
|
+
context = this.getContextForMessage([result]);
|
|
100
|
+
}
|
|
101
|
+
return { passed, context };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Evaluates a single dependency condition.
|
|
105
|
+
*
|
|
106
|
+
* @param condition - A single condition with path, optional expectedValue, and optional negate
|
|
107
|
+
* @returns The evaluation result with passed flag, resolved value, and key
|
|
108
|
+
*/
|
|
109
|
+
evaluateSingleCondition(condition) {
|
|
110
|
+
if (condition.path === '__always__') {
|
|
111
|
+
return { passed: true, value: true, key: '__always__' };
|
|
112
|
+
}
|
|
113
|
+
const result = this.getPropertyKeyValue(condition.path);
|
|
114
|
+
const key = result?.key ?? condition.path;
|
|
115
|
+
const value = result?.value;
|
|
116
|
+
let passed = false;
|
|
117
|
+
if (condition.dependsOn) {
|
|
118
|
+
passed = condition.dependsOn(value);
|
|
119
|
+
}
|
|
120
|
+
else if (condition.expectedValue !== undefined) {
|
|
121
|
+
passed = value === condition.expectedValue;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
passed = !!value;
|
|
125
|
+
}
|
|
126
|
+
if (condition.negate) {
|
|
127
|
+
passed = !passed;
|
|
128
|
+
}
|
|
129
|
+
return { passed, value, key };
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Gets the context message from evaluation results.
|
|
133
|
+
*
|
|
134
|
+
* @param results - Array of evaluation results to summarize
|
|
135
|
+
* @returns A comma-separated string of failed condition key/value pairs
|
|
136
|
+
*/
|
|
137
|
+
getContextForMessage(results) {
|
|
138
|
+
return results
|
|
139
|
+
.filter((result) => !result.passed)
|
|
140
|
+
.map((result) => `${result.key}: ${result.value}`)
|
|
141
|
+
.join(', ');
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Evaluates an AND condition item which can be a single condition or nested OR group.
|
|
145
|
+
*
|
|
146
|
+
* @param conditionItem - A single condition or an OR group nested inside AND
|
|
147
|
+
* @returns Whether the item passed and the individual evaluation results
|
|
148
|
+
*/
|
|
149
|
+
evaluateAndConditionItem(conditionItem) {
|
|
150
|
+
if ((0, decorator_paths_1.isOrConditionGroup)(conditionItem)) {
|
|
151
|
+
return this.evaluateOrConditions(conditionItem.__orConditions);
|
|
152
|
+
}
|
|
153
|
+
const result = this.evaluateSingleCondition(conditionItem);
|
|
154
|
+
return { passed: result.passed, results: [result] };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Evaluates OR conditions (at least one must match).
|
|
158
|
+
*
|
|
159
|
+
* @param orConditions - Array of OR condition items (single conditions or AND groups)
|
|
160
|
+
* @returns Whether any condition passed and all individual evaluation results
|
|
161
|
+
*/
|
|
162
|
+
evaluateOrConditions(orConditions) {
|
|
163
|
+
const allResults = [];
|
|
164
|
+
for (const conditionItem of orConditions) {
|
|
165
|
+
if ((0, decorator_paths_1.isAndConditionGroup)(conditionItem)) {
|
|
166
|
+
const andResults = [];
|
|
167
|
+
let allAndPassed = true;
|
|
168
|
+
for (const andItem of conditionItem.__andConditions) {
|
|
169
|
+
const { passed, results } = this.evaluateAndConditionItem(andItem);
|
|
170
|
+
andResults.push(...results);
|
|
171
|
+
if (!passed) {
|
|
172
|
+
allAndPassed = false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
allResults.push(...andResults);
|
|
176
|
+
if (allAndPassed) {
|
|
177
|
+
return { passed: true, results: allResults };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
const result = this.evaluateSingleCondition(conditionItem);
|
|
182
|
+
allResults.push(result);
|
|
183
|
+
if (result.passed) {
|
|
184
|
+
return { passed: true, results: allResults };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return { passed: false, results: allResults };
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Evaluates AND conditions (all must match).
|
|
192
|
+
*
|
|
193
|
+
* @param andConditions - Array of AND condition items (single conditions or OR groups)
|
|
194
|
+
* @returns Whether all conditions passed and all individual evaluation results
|
|
195
|
+
*/
|
|
196
|
+
evaluateAndConditions(andConditions) {
|
|
197
|
+
const allResults = [];
|
|
198
|
+
let allPassed = true;
|
|
199
|
+
for (const conditionItem of andConditions) {
|
|
200
|
+
const { passed, results } = this.evaluateAndConditionItem(conditionItem);
|
|
201
|
+
allResults.push(...results);
|
|
202
|
+
if (!passed) {
|
|
203
|
+
allPassed = false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return { passed: allPassed, results: allResults };
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
exports.ConditionEvaluator = ConditionEvaluator;
|
|
210
|
+
//# sourceMappingURL=condition-evaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition-evaluator.js","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/condition-evaluator.ts"],"names":[],"mappings":";;;AAUA,iDAAyC;AACzC,uDAAiG;AA+BjG;;;GAGG;AACH,MAAa,kBAAkB;IAG3B;;;;OAIG;IACH,YAAY,OAAyB;QACjC,IAAI,CAAC,OAAO,GAAG;YACX,wFAAwF;YACxF,mGAAmG;YACnG,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM;YACxB,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,CAAC;IACN,CAAC;IAED;;;;;;OAMG;IACH,mBAAmB,CAAC,YAAoB;QACpC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,OAAO,SAAS,CAAC;QACrB,CAAC;QAED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L,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACK,qBAAqB,CAAC,aAAiC;QAI3D,MAAM,UAAU,GAA8B,EAAE,CAAC;QACjD,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,KAAK,MAAM,aAAa,IAAI,aAAa,EAAE,CAAC;YACxC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;YACzE,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;YAE5B,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,SAAS,GAAG,KAAK,CAAC;YACtB,CAAC;QACL,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACtD,CAAC;CACJ;AAxOD,gDAwOC"}
|
|
@@ -56,6 +56,8 @@ import type { Manifest, v4, AndConditionItem, OrConditionItem, AndConditionGroup
|
|
|
56
56
|
export type AppContext = {
|
|
57
57
|
/** The application manifest */
|
|
58
58
|
manifest: Manifest;
|
|
59
|
+
/** Returns the minimum UI5 version for the application */
|
|
60
|
+
minUI5Version: string;
|
|
59
61
|
};
|
|
60
62
|
/**
|
|
61
63
|
* Page context (sourced from page.config).
|
|
@@ -64,7 +66,9 @@ export type AppContext = {
|
|
|
64
66
|
* These properties are determined by the Page class and its configuration.
|
|
65
67
|
* Extend this type when new config properties are added to Page.
|
|
66
68
|
*/
|
|
67
|
-
export type PageContext = {
|
|
69
|
+
export type PageContext = {
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
68
72
|
/**
|
|
69
73
|
* Settings for the Table Class context, taken from manifest.
|
|
70
74
|
*
|
|
@@ -476,26 +480,5 @@ export declare function isOrConditionGroup(item: AndConditionItem): item is OrCo
|
|
|
476
480
|
* @returns True if item is an AndConditionGroup
|
|
477
481
|
*/
|
|
478
482
|
export declare function isAndConditionGroup(item: OrConditionItem): item is AndConditionGroup;
|
|
479
|
-
/**
|
|
480
|
-
* The complete decorator context type used internally.
|
|
481
|
-
* Contains app, page and custom context.
|
|
482
|
-
*/
|
|
483
|
-
export type DecoratorContextType = {
|
|
484
|
-
/**
|
|
485
|
-
* App context - auto-injected from app.config.
|
|
486
|
-
* Provides access to manifest and other app-level properties.
|
|
487
|
-
*/
|
|
488
|
-
app?: Partial<AppContext>;
|
|
489
|
-
/**
|
|
490
|
-
* Page context - auto-injected from page.config.
|
|
491
|
-
* Provides access to page-level properties like isALP, visualization, etc.
|
|
492
|
-
*/
|
|
493
|
-
page?: Partial<PageContext>;
|
|
494
|
-
/**
|
|
495
|
-
* Custom context - provided via init().
|
|
496
|
-
* Use for runtime-specific conditions like table state, section state, etc.
|
|
497
|
-
*/
|
|
498
|
-
custom?: Record<string, unknown>;
|
|
499
|
-
};
|
|
500
483
|
export {};
|
|
501
484
|
//# sourceMappingURL=decorator-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator-paths.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/decorator-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EACR,QAAQ,EACR,EAAE,EACF,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACnB,MAAM,6BAA6B,CAAC;AAMrC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,+BAA+B;IAC/B,QAAQ,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"decorator-paths.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/decorator-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO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"decorator-paths.js","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/decorator-paths.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;
|
|
1
|
+
{"version":3,"file":"decorator-paths.js","sourceRoot":"","sources":["../../../../../../src/sync/common/decoration/decorator-paths.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;AAsIH,0BAEC;AAQD,gCAEC;AAwHD,0CAEC;AAuBD,oBAMC;AAgCD,wCAEC;AA8BD,kBAkBC;AA2BD,wBAEC;AAoCD,0CAEC;AA0BD,kBAWC;AA4DD,kBAKC;AAgBD,gBAKC;AAQD,wCAEC;AAQD,sCAEC;AAQD,4CAEC;AAYD,gDAEC;AAQD,kDAEC;AAlkBD,+CAA+C;AAC/C,2BAA2B;AAC3B,+CAA+C;AAE/C;;;;;;GAMG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AA6B5D;;;;;;;;;;;;;;;GAeG;AACH,SAAS,iBAAiB,CACtB,MAAc;IAEd,MAAM,OAAO,GAAyB;QAClC,GAAG,CAAC,CAAC,EAAE,IAAqB;YACxB,IAAI,IAAI,KAAK,mBAAW,EAAE,CAAC;gBACvB,OAAO,MAAM,CAAC;YAClB,CAAC;YACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3B,OAAO,iBAAiB,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,gEAAgE;QAChE,GAAG,CAAC,CAAC,EAAE,IAAqB;YACxB,OAAO,IAAI,KAAK,mBAAW,CAAC;QAChC,CAAC;KACJ,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAkE,CAAC;AACnG,CA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AI,KAAK,QAAQ,IAAI,iBAAiB,IAAI,IAAI,CAAC;AAClF,CAAC"}
|
|
@@ -39,14 +39,6 @@ export declare const descriptionUrlMetadataKey: unique symbol;
|
|
|
39
39
|
export declare const descriptionSrcURL: (id: string) => any;
|
|
40
40
|
export declare const getDescriptionSrcURL: (target: any, propertyName: string) => string;
|
|
41
41
|
export declare const validity: (validity: Validity) => any;
|
|
42
|
-
/**
|
|
43
|
-
* Retrieves the validity metadata associated with a specific property of a target object.
|
|
44
|
-
*
|
|
45
|
-
* @param target - The object containing the property.
|
|
46
|
-
* @param propertyName - The name of the property whose validity metadata is to be retrieved.
|
|
47
|
-
* @returns The validity information of the property, or undefined if no metadata is found.
|
|
48
|
-
*/
|
|
49
|
-
export declare function getValidityMetadata(target: object, propertyName: string): ValidityInformation | undefined;
|
|
50
42
|
/**
|
|
51
43
|
* Mark the target class with a metadata flag indicating it is a view node.
|
|
52
44
|
*
|
|
@@ -69,42 +61,34 @@ export interface DecoratorMetadata extends DependsOnCondition {
|
|
|
69
61
|
}
|
|
70
62
|
/**
|
|
71
63
|
* Decorator to conditionally hide a property based on conditions.
|
|
72
|
-
* The property will be hidden
|
|
64
|
+
* The property will be hidden when the condition(s) ARE met.
|
|
73
65
|
*
|
|
74
66
|
* @example
|
|
75
67
|
* ```typescript
|
|
76
68
|
* import { page, custom, when, and, or } from './decorator-paths';
|
|
77
69
|
*
|
|
78
|
-
* // Truthy check - hide
|
|
70
|
+
* // Truthy check - hide when page.isALP is truthy
|
|
79
71
|
* @hide(page.isALP)
|
|
80
72
|
*
|
|
81
|
-
* // Equality check - hide
|
|
73
|
+
* // Equality check - hide when page.type === 'GridTable'
|
|
82
74
|
* @hide(when(page.type, 'GridTable'))
|
|
83
75
|
*
|
|
84
|
-
* // Custom function - hide
|
|
76
|
+
* // Custom function - hide when function returns true (type !== 'GridTable')
|
|
85
77
|
* @hide(when(page.type, (type) => type !== 'GridTable'))
|
|
86
78
|
*
|
|
87
79
|
* // Always hide
|
|
88
80
|
* @hide(true)
|
|
89
81
|
*
|
|
90
|
-
* // AND logic - hide
|
|
82
|
+
* // AND logic - hide when isALP is truthy AND type === 'GridTable'
|
|
91
83
|
* @hide(and(page.isALP, when(page.type, 'GridTable')))
|
|
92
84
|
*
|
|
93
|
-
* // OR logic - hide
|
|
85
|
+
* // OR logic - hide when actionType === 'Bound' OR actionType === 'Custom'
|
|
94
86
|
* @hide(or(when(page.actionType, 'Bound'), when(page.actionType, 'Custom')))
|
|
95
87
|
* ```
|
|
96
88
|
* @param condition - The condition to evaluate
|
|
97
89
|
* @returns PropertyDecorator
|
|
98
90
|
*/
|
|
99
91
|
export declare function hide(condition: ConditionInput): PropertyDecorator;
|
|
100
|
-
/**
|
|
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
92
|
/**
|
|
109
93
|
* Decorator to conditionally display a message based on conditions.
|
|
110
94
|
* A message will be shown when the condition(s) are met.
|
|
@@ -135,15 +119,6 @@ export declare function getHideMetadata(target: object, propertyName: string): D
|
|
|
135
119
|
* ```
|
|
136
120
|
*/
|
|
137
121
|
export declare function message(condition: ConditionInput, messageConfig: MessageConfig): PropertyDecorator;
|
|
138
|
-
/**
|
|
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
122
|
/**
|
|
148
123
|
* Decorator to conditionally mark a property as readonly based on conditions.
|
|
149
124
|
* The property will be readonly when the condition(s) are met.
|
|
@@ -165,14 +140,6 @@ export declare function getMessageMetadata(target: object, propertyName: string)
|
|
|
165
140
|
* @returns PropertyDecorator
|
|
166
141
|
*/
|
|
167
142
|
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
143
|
/**
|
|
177
144
|
* Metadata structure for the @enums decorator.
|
|
178
145
|
* Extends DecoratorMetadata with the list of allowed enum values.
|
|
@@ -204,15 +171,6 @@ export interface EnumsDecoratorMetadata extends DecoratorMetadata {
|
|
|
204
171
|
* @returns PropertyDecorator
|
|
205
172
|
*/
|
|
206
173
|
export declare function enums(condition: ConditionInput, allowedValues: string[]): PropertyDecorator;
|
|
207
|
-
/**
|
|
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.
|
|
210
|
-
*
|
|
211
|
-
* @param target - The object containing the property.
|
|
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.
|
|
214
|
-
*/
|
|
215
|
-
export declare function getEnumsMetadata(target: object, propertyName: string): EnumsDecoratorMetadata[] | undefined;
|
|
216
174
|
/**
|
|
217
175
|
* Generates a deprecation message for a given key, optionally including additional validity information.
|
|
218
176
|
*
|
|
@@ -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,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;
|
|
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;AAoBF,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,GAAI,IAAI,MAAM,KAAG,GAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAQ,GAAG,EAAE,cAAc,MAAM,KAAG,MAE9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B,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAQnG"}
|
|
@@ -3,17 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validity = exports.getDescriptionSrcURL = exports.descriptionSrcURL = exports.descriptionUrlMetadataKey = exports.getPageLayoutInformation = exports.getChildId = exports.childId = exports.pageLayoutInformation = exports.syncRule = exports.metadataKeys = void 0;
|
|
4
4
|
exports.getReflectMetadata = getReflectMetadata;
|
|
5
5
|
exports.getReflectTypeMetadata = getReflectTypeMetadata;
|
|
6
|
-
exports.getValidityMetadata = getValidityMetadata;
|
|
7
6
|
exports.isViewNode = isViewNode;
|
|
8
7
|
exports.description = description;
|
|
9
8
|
exports.hide = hide;
|
|
10
|
-
exports.getHideMetadata = getHideMetadata;
|
|
11
9
|
exports.message = message;
|
|
12
|
-
exports.getMessageMetadata = getMessageMetadata;
|
|
13
10
|
exports.readonly = readonly;
|
|
14
|
-
exports.getReadonlyMetadata = getReadonlyMetadata;
|
|
15
11
|
exports.enums = enums;
|
|
16
|
-
exports.getEnumsMetadata = getEnumsMetadata;
|
|
17
12
|
exports.getTextForDeprecated = getTextForDeprecated;
|
|
18
13
|
require("reflect-metadata");
|
|
19
14
|
const decorator_paths_1 = require("./decorator-paths");
|
|
@@ -34,6 +29,19 @@ exports.metadataKeys = {
|
|
|
34
29
|
readonly: Symbol('generate:readonly'),
|
|
35
30
|
enums: Symbol('generate:enums')
|
|
36
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Appends a decorator condition entry to the metadata array stored on a property.
|
|
34
|
+
*
|
|
35
|
+
* @param key - The metadata key identifying the decorator type (hide, message, readonly, enums)
|
|
36
|
+
* @param instance - The class instance that owns the decorated property
|
|
37
|
+
* @param propertyKey - The name of the decorated property
|
|
38
|
+
* @param entry - The parsed condition to append
|
|
39
|
+
*/
|
|
40
|
+
function appendCondition(key, instance, propertyKey, entry) {
|
|
41
|
+
const existing = Reflect.getMetadata(key, instance, propertyKey) || [];
|
|
42
|
+
existing.push(entry);
|
|
43
|
+
Reflect.defineMetadata(key, existing, instance, propertyKey);
|
|
44
|
+
}
|
|
37
45
|
// ============================================
|
|
38
46
|
// SYNC RULE DECORATORS
|
|
39
47
|
// ============================================
|
|
@@ -107,20 +115,6 @@ const validity = (validity) => {
|
|
|
107
115
|
return Reflect.metadata(exports.metadataKeys.validity, validity);
|
|
108
116
|
};
|
|
109
117
|
exports.validity = validity;
|
|
110
|
-
/**
|
|
111
|
-
* Retrieves the validity metadata associated with a specific property of a target object.
|
|
112
|
-
*
|
|
113
|
-
* @param target - The object containing the property.
|
|
114
|
-
* @param propertyName - The name of the property whose validity metadata is to be retrieved.
|
|
115
|
-
* @returns The validity information of the property, or undefined if no metadata is found.
|
|
116
|
-
*/
|
|
117
|
-
function getValidityMetadata(target, propertyName) {
|
|
118
|
-
let validityInfo;
|
|
119
|
-
if (target) {
|
|
120
|
-
validityInfo = Reflect.getMetadata(exports.metadataKeys.validity, target, propertyName);
|
|
121
|
-
}
|
|
122
|
-
return validityInfo;
|
|
123
|
-
}
|
|
124
118
|
// ============================================
|
|
125
119
|
// VIEW NODE DECORATOR
|
|
126
120
|
// ============================================
|
|
@@ -302,52 +296,35 @@ function parseCondition(condition) {
|
|
|
302
296
|
// ============================================
|
|
303
297
|
/**
|
|
304
298
|
* Decorator to conditionally hide a property based on conditions.
|
|
305
|
-
* The property will be hidden
|
|
299
|
+
* The property will be hidden when the condition(s) ARE met.
|
|
306
300
|
*
|
|
307
301
|
* @example
|
|
308
302
|
* ```typescript
|
|
309
303
|
* import { page, custom, when, and, or } from './decorator-paths';
|
|
310
304
|
*
|
|
311
|
-
* // Truthy check - hide
|
|
305
|
+
* // Truthy check - hide when page.isALP is truthy
|
|
312
306
|
* @hide(page.isALP)
|
|
313
307
|
*
|
|
314
|
-
* // Equality check - hide
|
|
308
|
+
* // Equality check - hide when page.type === 'GridTable'
|
|
315
309
|
* @hide(when(page.type, 'GridTable'))
|
|
316
310
|
*
|
|
317
|
-
* // Custom function - hide
|
|
311
|
+
* // Custom function - hide when function returns true (type !== 'GridTable')
|
|
318
312
|
* @hide(when(page.type, (type) => type !== 'GridTable'))
|
|
319
313
|
*
|
|
320
314
|
* // Always hide
|
|
321
315
|
* @hide(true)
|
|
322
316
|
*
|
|
323
|
-
* // AND logic - hide
|
|
317
|
+
* // AND logic - hide when isALP is truthy AND type === 'GridTable'
|
|
324
318
|
* @hide(and(page.isALP, when(page.type, 'GridTable')))
|
|
325
319
|
*
|
|
326
|
-
* // OR logic - hide
|
|
320
|
+
* // OR logic - hide when actionType === 'Bound' OR actionType === 'Custom'
|
|
327
321
|
* @hide(or(when(page.actionType, 'Bound'), when(page.actionType, 'Custom')))
|
|
328
322
|
* ```
|
|
329
323
|
* @param condition - The condition to evaluate
|
|
330
324
|
* @returns PropertyDecorator
|
|
331
325
|
*/
|
|
332
326
|
function hide(condition) {
|
|
333
|
-
return (
|
|
334
|
-
const hideInfo = parseCondition(condition);
|
|
335
|
-
Reflect.defineMetadata(exports.metadataKeys.hide, hideInfo, target, propertyKey);
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Retrieves the hide metadata associated with a specific property of a target object.
|
|
340
|
-
*
|
|
341
|
-
* @param target - The object containing the property.
|
|
342
|
-
* @param propertyName - The name of the property whose hide metadata is to be retrieved.
|
|
343
|
-
* @returns The hide information of the property, or undefined if no metadata is found.
|
|
344
|
-
*/
|
|
345
|
-
function getHideMetadata(target, propertyName) {
|
|
346
|
-
let hideInfo;
|
|
347
|
-
if (target) {
|
|
348
|
-
hideInfo = Reflect.getMetadata(exports.metadataKeys.hide, target, propertyName);
|
|
349
|
-
}
|
|
350
|
-
return hideInfo;
|
|
327
|
+
return (instance, propertyKey) => appendCondition(exports.metadataKeys.hide, instance, propertyKey, parseCondition(condition));
|
|
351
328
|
}
|
|
352
329
|
// ============================================
|
|
353
330
|
// MESSAGE DECORATOR
|
|
@@ -382,29 +359,12 @@ function getHideMetadata(target, propertyName) {
|
|
|
382
359
|
* ```
|
|
383
360
|
*/
|
|
384
361
|
function message(condition, messageConfig) {
|
|
385
|
-
return (
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
const existing = Reflect.getMetadata(exports.metadataKeys.message, target, propertyKey) || [];
|
|
390
|
-
existing.push(messageInfo);
|
|
391
|
-
Reflect.defineMetadata(exports.metadataKeys.message, existing, target, propertyKey);
|
|
362
|
+
return (instance, propertyKey) => {
|
|
363
|
+
const info = parseCondition(condition);
|
|
364
|
+
info.messageConfig = messageConfig;
|
|
365
|
+
appendCondition(exports.metadataKeys.message, instance, propertyKey, info);
|
|
392
366
|
};
|
|
393
367
|
}
|
|
394
|
-
/**
|
|
395
|
-
* Retrieves the message metadata associated with a specific property of a target object.
|
|
396
|
-
* Returns an array of DecoratorMetadata since multiple @message decorators can be applied.
|
|
397
|
-
*
|
|
398
|
-
* @param target - The object containing the property.
|
|
399
|
-
* @param propertyName - The name of the property whose message metadata is to be retrieved.
|
|
400
|
-
* @returns An array of message metadata, or undefined if no metadata is found.
|
|
401
|
-
*/
|
|
402
|
-
function getMessageMetadata(target, propertyName) {
|
|
403
|
-
if (target) {
|
|
404
|
-
return Reflect.getMetadata(exports.metadataKeys.message, target, propertyName);
|
|
405
|
-
}
|
|
406
|
-
return undefined;
|
|
407
|
-
}
|
|
408
368
|
// ============================================
|
|
409
369
|
// READONLY DECORATOR
|
|
410
370
|
// ============================================
|
|
@@ -429,24 +389,7 @@ function getMessageMetadata(target, propertyName) {
|
|
|
429
389
|
* @returns PropertyDecorator
|
|
430
390
|
*/
|
|
431
391
|
function readonly(condition) {
|
|
432
|
-
return (
|
|
433
|
-
const readonlyInfo = parseCondition(condition);
|
|
434
|
-
Reflect.defineMetadata(exports.metadataKeys.readonly, readonlyInfo, target, propertyKey);
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Retrieves the readonly metadata associated with a specific property of a target object.
|
|
439
|
-
*
|
|
440
|
-
* @param target - The object containing the property.
|
|
441
|
-
* @param propertyName - The name of the property whose readonly metadata is to be retrieved.
|
|
442
|
-
* @returns The readonly information of the property, or undefined if no metadata is found.
|
|
443
|
-
*/
|
|
444
|
-
function getReadonlyMetadata(target, propertyName) {
|
|
445
|
-
let readonlyInfo;
|
|
446
|
-
if (target) {
|
|
447
|
-
readonlyInfo = Reflect.getMetadata(exports.metadataKeys.readonly, target, propertyName);
|
|
448
|
-
}
|
|
449
|
-
return readonlyInfo;
|
|
392
|
+
return (instance, propertyKey) => appendCondition(exports.metadataKeys.readonly, instance, propertyKey, parseCondition(condition));
|
|
450
393
|
}
|
|
451
394
|
/**
|
|
452
395
|
* Decorator to conditionally restrict enum values based on conditions.
|
|
@@ -471,30 +414,7 @@ function getReadonlyMetadata(target, propertyName) {
|
|
|
471
414
|
* @returns PropertyDecorator
|
|
472
415
|
*/
|
|
473
416
|
function enums(condition, allowedValues) {
|
|
474
|
-
return (
|
|
475
|
-
const enumsInfo = {
|
|
476
|
-
...parseCondition(condition),
|
|
477
|
-
allowedValues
|
|
478
|
-
};
|
|
479
|
-
// Support multiple @enums decorators - store as array, first match wins
|
|
480
|
-
const existing = Reflect.getMetadata(exports.metadataKeys.enums, target, propertyKey) || [];
|
|
481
|
-
existing.push(enumsInfo);
|
|
482
|
-
Reflect.defineMetadata(exports.metadataKeys.enums, existing, target, propertyKey);
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* Retrieves the enums metadata associated with a specific property of a target object.
|
|
487
|
-
* Returns an array of EnumsDecoratorMetadata since multiple @enums decorators can be applied.
|
|
488
|
-
*
|
|
489
|
-
* @param target - The object containing the property.
|
|
490
|
-
* @param propertyName - The name of the property whose enums metadata is to be retrieved.
|
|
491
|
-
* @returns An array of enums metadata, or undefined if no metadata is found.
|
|
492
|
-
*/
|
|
493
|
-
function getEnumsMetadata(target, propertyName) {
|
|
494
|
-
if (target) {
|
|
495
|
-
return Reflect.getMetadata(exports.metadataKeys.enums, target, propertyName);
|
|
496
|
-
}
|
|
497
|
-
return undefined;
|
|
417
|
+
return (instance, propertyKey) => appendCondition(exports.metadataKeys.enums, instance, propertyKey, { ...parseCondition(condition), allowedValues });
|
|
498
418
|
}
|
|
499
419
|
// ============================================
|
|
500
420
|
// DEPRECATION HELPER
|