@sap/ux-specification 1.124.19 → 1.124.21
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 +30 -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 +73 -0
- 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 +112 -112
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/ListReportNewConfig.json +16 -0
- package/dist/schemas/v4/ListReportConfig.json +18 -0
- package/dist/schemas/v4/ObjectPageConfig.json +27 -0
- package/dist/specification/package.json +4 -4
- package/dist/specification/scripts/schema/to-json-schema.d.ts +4 -0
- package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js +25 -1
- package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
- package/dist/specification/src/api.js +2 -1
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/sync/common/DataFieldStrategy.d.ts +63 -0
- package/dist/specification/src/sync/common/DataFieldStrategy.d.ts.map +1 -0
- package/dist/specification/src/sync/common/DataFieldStrategy.js +357 -0
- package/dist/specification/src/sync/common/DataFieldStrategy.js.map +1 -0
- package/dist/specification/src/sync/common/generate/objectPage.d.ts +62 -1
- package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +172 -59
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.d.ts +19 -1
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +45 -0
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +2 -1
- package/dist/specification/src/sync/common/index.d.ts +1 -0
- package/dist/specification/src/sync/common/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/index.js +1 -0
- package/dist/specification/src/sync/common/index.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +25 -5
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +40 -65
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.d.ts +10 -1
- package/dist/specification/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.js +9 -2
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts +2 -2
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/generate.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/generate.js +5 -2
- package/dist/specification/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/index.d.ts +1 -1
- package/dist/specification/src/sync/v2/generate/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/index.js +5 -2
- package/dist/specification/src/sync/v2/generate/index.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.d.ts +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.js +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts +5 -2
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.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/pages/ListReportNew.d.ts +27 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.d.ts.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.js +60 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.js.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.d.ts +84 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.d.ts.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js +262 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/pages/pageAccess.js.map +1 -0
- package/dist/specification/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.js +6 -2
- package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.d.ts +2 -2
- package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +2 -2
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts +4 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js +4 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts +2 -2
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts +3 -0
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js +4 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +6 -0
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js +7 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +2 -2
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +6 -0
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +7 -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 +11 -1
- package/dist/specification/src/sync/v4/export/export.js.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 +2 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts +21 -0
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +44 -36
- 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 +13 -5
- package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.js +36 -38
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/StableIdHelper.d.ts +21 -0
- package/dist/specification/src/sync/v4/utils/StableIdHelper.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js +24 -53
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts +71 -2
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +289 -123
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/types/src/common/types.d.ts +5 -0
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +5 -0
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageForm.d.ts +4 -1
- package/dist/types/src/v4/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageHeader.d.ts +4 -1
- package/dist/types/src/v4/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts +4 -1
- package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ToolBar.d.ts +8 -2
- package/dist/types/src/v4/controls/ToolBar.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataFieldStrategyContext = exports.DataFieldStrategyContext = exports.DataFieldStrategy = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const StableIdHelper_1 = require("../v4/utils/StableIdHelper");
|
|
6
|
+
const objectPage_1 = require("./generate/objectPage");
|
|
7
|
+
const utils_2 = require("../v4/utils/utils");
|
|
8
|
+
class DataFieldStrategy {
|
|
9
|
+
/**
|
|
10
|
+
* Adds a new definition based on the provided parameters.
|
|
11
|
+
*
|
|
12
|
+
* @param {AddDefinitionParams} data - An object containing the parameters required to add the definition.
|
|
13
|
+
* @returns {void}
|
|
14
|
+
*/
|
|
15
|
+
addDefinition(data) {
|
|
16
|
+
(0, objectPage_1.addDataFieldDefinition)(data);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Adds a new line item definition to the system based on the provided parameters.
|
|
20
|
+
*
|
|
21
|
+
* @param {AddLineItemDefinitionParams} data - The parameters used to define the new line item.
|
|
22
|
+
* @returns {void} Does not return a value.
|
|
23
|
+
*/
|
|
24
|
+
addLineItemDefinition(data) {
|
|
25
|
+
(0, utils_2.addLineItemRecordToSchema)(data);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.DataFieldStrategy = DataFieldStrategy;
|
|
29
|
+
class DataFieldForActionStrategy extends DataFieldStrategy {
|
|
30
|
+
/**
|
|
31
|
+
* Generates a stable identifier based on the given data field.
|
|
32
|
+
*
|
|
33
|
+
* @param {DataFieldForActionAbstractTypes} dataField - The data field used to generate the stable identifier.
|
|
34
|
+
* @returns {string} A stable identifier string derived from the provided data field.
|
|
35
|
+
*/
|
|
36
|
+
generateStableId(dataField) {
|
|
37
|
+
return (0, StableIdHelper_1.prepareId)('DataFieldForAction::' + dataField.Action);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Generates a description for the provided data field based on its label and context.
|
|
41
|
+
*
|
|
42
|
+
* @param {DataFieldForActionAbstractTypes} dataField - The data field for which the description is generated.
|
|
43
|
+
* @param {EntityType} entityType - The type of the entity associated with the data field.
|
|
44
|
+
* @returns {string} The generated description for the specified data field.
|
|
45
|
+
*/
|
|
46
|
+
generateDescription(dataField, entityType) {
|
|
47
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
48
|
+
return (0, utils_1.getDescriptionForActionBasedDataFields)(dataField, dataFieldLabel);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Adds a new definition for an action.
|
|
52
|
+
* This method processes the given data and integrates it into the action definition structure.
|
|
53
|
+
*
|
|
54
|
+
* @param {AddDefinitionParams} data - An object containing the necessary parameters for the action definition.
|
|
55
|
+
* @returns {void} This method does not return a value.
|
|
56
|
+
*/
|
|
57
|
+
addDefinition(data) {
|
|
58
|
+
(0, objectPage_1.addDataFieldForActionAndActionGroupDefinition)(data);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Adds a line item definition to the schema based on the provided data.
|
|
62
|
+
* Determines the appropriate action based on the properties of the line item record.
|
|
63
|
+
*
|
|
64
|
+
* @param {object} data - The parameters for adding the line item definition.
|
|
65
|
+
* @param {object} data.lineItemRecord - The line item record object containing specific properties.
|
|
66
|
+
* @param {object} data.lineItemDefinition - The line item definition object.
|
|
67
|
+
* @returns {void} This method does not return a value.
|
|
68
|
+
*/
|
|
69
|
+
addLineItemDefinition(data) {
|
|
70
|
+
(0, utils_2.addLineItemActionDefinition)(data);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
class DataFieldForActionGroupStrategy extends DataFieldStrategy {
|
|
74
|
+
/**
|
|
75
|
+
* Generates a stable identifier for a given data field.
|
|
76
|
+
*
|
|
77
|
+
* @param {DataFieldForActionGroupTypes} dataField - The data field object containing necessary details for generating the stable ID.
|
|
78
|
+
* @returns {string} A stable identifier string based on the provided data field.
|
|
79
|
+
*/
|
|
80
|
+
generateStableId(dataField) {
|
|
81
|
+
return (0, StableIdHelper_1.prepareId)('DataFieldForActionGroup::' + dataField.ID);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Generates a description based on the provided data field, entity type, and label.
|
|
85
|
+
*
|
|
86
|
+
* @param {DataFieldForActionGroupTypes} dataField - The data field object used to generate the description.
|
|
87
|
+
* @param {EntityType} entityType - The entity type associated with the data field.
|
|
88
|
+
* @returns {string} The generated description, which will be the data field's label, ID, or the provided default label.
|
|
89
|
+
*/
|
|
90
|
+
generateDescription(dataField, entityType) {
|
|
91
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
92
|
+
return dataField.Label ?? dataField.ID ?? dataFieldLabel;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Adds a definition using the given data.
|
|
96
|
+
*
|
|
97
|
+
* @param {AddDefinitionParams} data - The data object containing the definition details to be added.
|
|
98
|
+
* @returns {void} Does not return a value.
|
|
99
|
+
*/
|
|
100
|
+
addDefinition(data) {
|
|
101
|
+
(0, objectPage_1.addDataFieldForActionAndActionGroupDefinition)(data);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Adds a new line item definition to the schema.
|
|
105
|
+
*
|
|
106
|
+
* @param {AddLineItemDefinitionParams} data - The data for the line item definition to be added.
|
|
107
|
+
* @returns {void}
|
|
108
|
+
*/
|
|
109
|
+
addLineItemDefinition(data) {
|
|
110
|
+
// Action definitions in the Macro table do not use references, so group actions are written directly to the schema
|
|
111
|
+
(0, utils_2.addGroupActionRecordToSchema)(data, !data.lineItemData?.isMacro);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
class DataFieldForIntentBasedNavigationStrategy extends DataFieldStrategy {
|
|
115
|
+
/**
|
|
116
|
+
* Generates a stable ID for the given data field by concatenating a prefix with a part derived
|
|
117
|
+
* from the semantic object and action of the data field.
|
|
118
|
+
*
|
|
119
|
+
* @param {DataFieldForActionAbstractTypes} dataField - The data field for which the stable ID is to be generated.
|
|
120
|
+
* @returns {string} The generated stable ID as a string.
|
|
121
|
+
*/
|
|
122
|
+
generateStableId(dataField) {
|
|
123
|
+
return 'DataFieldForIntentBasedNavigation::' + (0, StableIdHelper_1.getStableIdPartFromSemanticObjectAndAction)(dataField);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Generates a description for the given data field based on the provided entity type and label.
|
|
127
|
+
*
|
|
128
|
+
* @param {DataFieldForActionAbstractTypes} dataField - The data field for which the description is to be generated.
|
|
129
|
+
* @param {EntityType} entityType - The type of the entity associated with the data field.
|
|
130
|
+
* @returns {string} The generated description for the given data field.
|
|
131
|
+
*/
|
|
132
|
+
generateDescription(dataField, entityType) {
|
|
133
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
134
|
+
return (0, utils_1.getDescriptionForActionBasedDataFields)(dataField, dataFieldLabel);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Adds a new definition based on the provided data.
|
|
138
|
+
*
|
|
139
|
+
* @param {AddDefinitionParams} data - The data used to create the new definition.
|
|
140
|
+
* @returns {void} - Does not return a value.
|
|
141
|
+
*/
|
|
142
|
+
addDefinition(data) {
|
|
143
|
+
(0, objectPage_1.addDataFieldForActionAndActionGroupDefinition)(data);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Adds a line item definition to the schema based on the provided data.
|
|
147
|
+
* Determines the appropriate action based on the properties of the line item record.
|
|
148
|
+
*
|
|
149
|
+
* @param {object} data - The parameters for adding the line item definition.
|
|
150
|
+
* @param {object} data.lineItemRecord - The line item record object containing specific properties.
|
|
151
|
+
* @param {object} data.lineItemDefinition - The line item definition object.
|
|
152
|
+
* @returns {void} This method does not return a value.
|
|
153
|
+
*/
|
|
154
|
+
addLineItemDefinition(data) {
|
|
155
|
+
(0, utils_2.addLineItemActionDefinition)(data);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
class DataFieldForAnnotationStrategy extends DataFieldStrategy {
|
|
159
|
+
/**
|
|
160
|
+
* Generates a stable identifier for a given data field.
|
|
161
|
+
*
|
|
162
|
+
* @param {DataFieldForAnnotationTypes} dataField - The data field for which the stable identifier will be generated.
|
|
163
|
+
* This parameter includes information about annotations and target paths related to the field.
|
|
164
|
+
* @returns {string} The stable identifier created by combining specific parts of the data field's annotation path.
|
|
165
|
+
*/
|
|
166
|
+
generateStableId(dataField) {
|
|
167
|
+
const annotationPath = dataField.Target?.$AnnotationPath ?? dataField.Target?.value ?? '';
|
|
168
|
+
return 'DataFieldForAnnotation::' + (0, StableIdHelper_1.prepareId)(annotationPath);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Generates a description for a given data field based on its label, common label, or target metadata.
|
|
172
|
+
*
|
|
173
|
+
* @param {DataFieldForAnnotationTypes} dataField - The data field object containing metadata for the data annotation.
|
|
174
|
+
* @param {EntityType} entityType - The entity type associated with the data field.
|
|
175
|
+
* @returns {string} A string representing the generated description based on the provided data field and entity type.
|
|
176
|
+
*/
|
|
177
|
+
generateDescription(dataField, entityType) {
|
|
178
|
+
const propertyCommonLabel = (0, utils_1.getLabelForDataField)(dataField, entityType);
|
|
179
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
180
|
+
return (dataFieldLabel ||
|
|
181
|
+
propertyCommonLabel ||
|
|
182
|
+
dataField?.Target?.$target?.Title ||
|
|
183
|
+
dataField?.Target?.value?.split('UI.v1.')[1]);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
class DataFieldWithActionStrategy extends DataFieldStrategy {
|
|
187
|
+
/**
|
|
188
|
+
* Generates a stable identifier for a given data field with action.
|
|
189
|
+
* The stable ID is constructed based on the Value property of the data field
|
|
190
|
+
* (if it exists) and the Action property of the data field.
|
|
191
|
+
*
|
|
192
|
+
* @param {DataFieldForActionAbstractTypes} dataField - The data field containing
|
|
193
|
+
* the action and optionally a value, used to generate the stable identifier.
|
|
194
|
+
* @returns {string} A stable identifier string constructed based on the data field's
|
|
195
|
+
* Value and Action properties.
|
|
196
|
+
*/
|
|
197
|
+
generateStableId(dataField) {
|
|
198
|
+
let sIdPart = 'DataFieldWithAction::';
|
|
199
|
+
if ('Value' in dataField && dataField.Value) {
|
|
200
|
+
sIdPart += (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value) + '::';
|
|
201
|
+
}
|
|
202
|
+
sIdPart += dataField.Action;
|
|
203
|
+
return (0, StableIdHelper_1.prepareId)(sIdPart);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Generates a description based on the provided data field, entity type, and data field label.
|
|
207
|
+
*
|
|
208
|
+
* @param {DataFieldForActionAbstractTypes} dataField - The data field for which the description is to be generated.
|
|
209
|
+
* @param {EntityType} entityType - The entity type that is associated with the data field.
|
|
210
|
+
* @returns {string} The generated description for the specified data field and entity type.
|
|
211
|
+
*/
|
|
212
|
+
generateDescription(dataField, entityType) {
|
|
213
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
214
|
+
return (0, utils_1.getDescriptionForActionBasedDataFields)(dataField, dataFieldLabel);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
class DataFieldStrategyDefault extends DataFieldStrategy {
|
|
218
|
+
/**
|
|
219
|
+
* Generates a stable identifier string for a provided data field.
|
|
220
|
+
*
|
|
221
|
+
* @param {DataField} dataField - The data field object containing the value to generate the stable identifier from.
|
|
222
|
+
* @returns {string} A stable identifier string derived from the data field value.
|
|
223
|
+
*/
|
|
224
|
+
generateStableId(dataField) {
|
|
225
|
+
return (0, StableIdHelper_1.prepareId)('DataField::' + (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value));
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Generates a descriptive title for the given data field.
|
|
229
|
+
*
|
|
230
|
+
* @param {DataField} dataField - The data field for which the description will be generated.
|
|
231
|
+
* @param {EntityType} entityType - The entity type associated with the data field.
|
|
232
|
+
* @returns {string} The generated description for the data field.
|
|
233
|
+
*/
|
|
234
|
+
generateDescription(dataField, entityType) {
|
|
235
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
236
|
+
return (0, utils_1.getTitleForDataField)(dataField, entityType, dataFieldLabel);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
class DataFieldWithIntentBasedNavigationStrategy extends DataFieldStrategy {
|
|
240
|
+
/**
|
|
241
|
+
* Generates a stable ID for a given DataFieldWithIntentBasedNavigationTypes object.
|
|
242
|
+
*
|
|
243
|
+
* @param {DataFieldWithIntentBasedNavigationTypes} dataField - The data field object containing information for intent-based navigation.
|
|
244
|
+
* @returns {string} A stable ID string created based on the provided data field.
|
|
245
|
+
*/
|
|
246
|
+
generateStableId(dataField) {
|
|
247
|
+
let sIdPart = 'DataFieldWithIntentBasedNavigation::';
|
|
248
|
+
sIdPart += (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value) + '::';
|
|
249
|
+
sIdPart += (0, StableIdHelper_1.getStableIdPartFromSemanticObjectAndAction)(dataField);
|
|
250
|
+
return (0, StableIdHelper_1.prepareId)(sIdPart);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Generates a description for the given data field based on its intent-based navigation or common label.
|
|
254
|
+
*
|
|
255
|
+
* @param {DataFieldWithIntentBasedNavigationTypes} dataField - The data field for which the description is to be generated.
|
|
256
|
+
* @param {EntityType} entityType - The entity type to be used for retrieving the label of the data field.
|
|
257
|
+
* @returns {string} The generated description, either derived from the common label or the value path of the data field.
|
|
258
|
+
*/
|
|
259
|
+
generateDescription(dataField, entityType) {
|
|
260
|
+
const propertyCommonLabel = (0, utils_1.getLabelForDataField)(dataField, entityType);
|
|
261
|
+
return propertyCommonLabel || dataField.Value.path;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
class DataFieldWithNavigationPathStrategy extends DataFieldStrategy {
|
|
265
|
+
/**
|
|
266
|
+
* Generates a stable ID based on the given DataFieldWithNavigationPath object.
|
|
267
|
+
*
|
|
268
|
+
* @param {DataFieldWithNavigationPath} dataField - The data field from which the stable ID will be generated. It should include properties like Value and optionally Target with a $NavigationPropertyPath.
|
|
269
|
+
* @returns {string} The generated stable ID as a string.
|
|
270
|
+
*/
|
|
271
|
+
generateStableId(dataField) {
|
|
272
|
+
let sIdPart = 'DataFieldWithNavigationPath::' + (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value);
|
|
273
|
+
if (dataField.Target && dataField.Target['$NavigationPropertyPath']) {
|
|
274
|
+
sIdPart += '::' + dataField.Target['$NavigationPropertyPath'];
|
|
275
|
+
}
|
|
276
|
+
return (0, StableIdHelper_1.prepareId)(sIdPart);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Generates a description for a given data field based on the entity type and label provided.
|
|
280
|
+
*
|
|
281
|
+
* @param {DataField} dataField - The data field for which the description is being generated.
|
|
282
|
+
* @param {EntityType} entityType - The type of the entity associated with the data field.
|
|
283
|
+
* @returns {string} The generated description for the data field.
|
|
284
|
+
*/
|
|
285
|
+
generateDescription(dataField, entityType) {
|
|
286
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
287
|
+
return (0, utils_1.getTitleForDataField)(dataField, entityType, dataFieldLabel);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
class DataFieldWithUrlStrategy extends DataFieldStrategy {
|
|
291
|
+
/**
|
|
292
|
+
* Generates a stable ID based on the provided data field.
|
|
293
|
+
*
|
|
294
|
+
* @param {DataFieldWithUrl} dataField - An object containing the data field information, including a URL and a value used to generate the ID.
|
|
295
|
+
* @returns {string} A stable and unique string ID derived from the data field's value.
|
|
296
|
+
*/
|
|
297
|
+
generateStableId(dataField) {
|
|
298
|
+
return (0, StableIdHelper_1.prepareId)('DataFieldWithUrl::' + (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Generates a description based on the provided data field, entity type, and label.
|
|
302
|
+
*
|
|
303
|
+
* @param {DataFieldWithUrl} dataField - The data field containing the information needed to generate the description.
|
|
304
|
+
* @param {EntityType} entityType - The type of entity associated with the data field.
|
|
305
|
+
* @returns {string} The generated description, which is determined by the provided label, the common label for the data field, or the data field's value.
|
|
306
|
+
*/
|
|
307
|
+
generateDescription(dataField, entityType) {
|
|
308
|
+
const propertyCommonLabel = (0, utils_1.getLabelForDataField)(dataField, entityType);
|
|
309
|
+
const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
|
|
310
|
+
return (dataFieldLabel ||
|
|
311
|
+
propertyCommonLabel ||
|
|
312
|
+
(typeof dataField.Value === 'string' ? dataField.Value : dataField.Value.path));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
class DataFieldStrategyContext {
|
|
316
|
+
/**
|
|
317
|
+
* Constructor to initialize the strategies map with various UIAnnotationTypes and their corresponding strategies.
|
|
318
|
+
* It registers predefined strategies to handle different UI annotation types by mapping each type
|
|
319
|
+
* to the appropriate strategy instance.
|
|
320
|
+
*
|
|
321
|
+
* @returns {void} Initializes the strategies map with registered strategies. Does not return any value.
|
|
322
|
+
*/
|
|
323
|
+
constructor() {
|
|
324
|
+
this.strategies = new Map();
|
|
325
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */, new DataFieldForActionStrategy());
|
|
326
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForActionGroup" /* UIAnnotationTypes.DataFieldForActionGroup */, new DataFieldForActionGroupStrategy());
|
|
327
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* UIAnnotationTypes.DataFieldForIntentBasedNavigation */, new DataFieldForIntentBasedNavigationStrategy());
|
|
328
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */, new DataFieldForAnnotationStrategy());
|
|
329
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithAction" /* UIAnnotationTypes.DataFieldWithAction */, new DataFieldWithActionStrategy());
|
|
330
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataField" /* UIAnnotationTypes.DataField */, new DataFieldStrategyDefault());
|
|
331
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* UIAnnotationTypes.DataFieldWithIntentBasedNavigation */, new DataFieldWithIntentBasedNavigationStrategy());
|
|
332
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* UIAnnotationTypes.DataFieldWithNavigationPath */, new DataFieldWithNavigationPathStrategy());
|
|
333
|
+
this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* UIAnnotationTypes.DataFieldWithUrl */, new DataFieldWithUrlStrategy());
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Registers a strategy for a specific type of data field.
|
|
337
|
+
*
|
|
338
|
+
* @param {string} type - The type of data field to associate with the strategy.
|
|
339
|
+
* @param {DataFieldStrategy} strategy - The strategy to be registered for the specified type.
|
|
340
|
+
* @returns {void} This method does not return a value.
|
|
341
|
+
*/
|
|
342
|
+
registerStrategy(type, strategy) {
|
|
343
|
+
this.strategies.set(type, strategy);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Retrieves the strategy associated with the given type.
|
|
347
|
+
*
|
|
348
|
+
* @param {string} type - The key representing the type of strategy to retrieve.
|
|
349
|
+
* @returns {DataFieldStrategy | undefined} The strategy corresponding to the provided type, or undefined if no strategy is found.
|
|
350
|
+
*/
|
|
351
|
+
getStrategy(type) {
|
|
352
|
+
return this.strategies.get(type);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
exports.DataFieldStrategyContext = DataFieldStrategyContext;
|
|
356
|
+
exports.dataFieldStrategyContext = new DataFieldStrategyContext();
|
|
357
|
+
//# sourceMappingURL=DataFieldStrategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataFieldStrategy.js","sourceRoot":"","sources":["../../../../../src/sync/common/DataFieldStrategy.ts"],"names":[],"mappings":";;;AAYA,mCAAuH;AACvH,+DAIoC;AACpC,sDAI+B;AAC/B,6CAK2B;AAE3B,MAAsB,iBAAiB;IAiBnC;;;;;OAKG;I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mCAAmC,EAAE,CAAC,CAAC;QAChH,IAAI,CAAC,gBAAgB,yFAAqC,IAAI,wBAAwB,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAuB,EAAE,QAA2B;QACjE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,IAAuB;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACJ;AAlDD,4DAkDC;AAEY,QAAA,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import type { ConvertedMetadata, EntitySet, EntityType } from '@sap-ux/vocabularies-types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DataFieldAbstractTypes } from '@sap-ux/vocabularies-types/vocabularies/UI';
|
|
3
|
+
import type { FacetConfig, GenerateAppSchemaParameters, SchemaDefinition } from '@sap/ux-specification-types';
|
|
3
4
|
import { FioriElementsVersion, SectionType, v2 } from '@sap/ux-specification-types';
|
|
4
5
|
import type { Definition } from 'typescript-json-schema';
|
|
5
6
|
import type { SapUiAppPageV4 } from '@sap/ux-specification-types/src/v4';
|
|
7
|
+
type DefinitionsProperties = {
|
|
8
|
+
[key: string]: SchemaDefinition;
|
|
9
|
+
};
|
|
10
|
+
export interface AddDefinitionParams {
|
|
11
|
+
appSchema: Definition;
|
|
12
|
+
withActions: boolean;
|
|
13
|
+
sectionType: SectionType;
|
|
14
|
+
field: DataFieldAbstractTypes;
|
|
15
|
+
targetID: string;
|
|
16
|
+
containersSchema: FieldsContainerSchema;
|
|
17
|
+
key: string;
|
|
18
|
+
version: FioriElementsVersion;
|
|
19
|
+
section: FacetConfig;
|
|
20
|
+
entityTypeName: string;
|
|
21
|
+
}
|
|
22
|
+
interface FieldsContainerSchema {
|
|
23
|
+
fields?: DefinitionsProperties;
|
|
24
|
+
actions?: DefinitionsProperties;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves the modified field reference based on the specified Fiori Elements version
|
|
28
|
+
* and the provided field reference identifier.
|
|
29
|
+
*
|
|
30
|
+
* @param {FioriElementsVersion} version - The Fiori Elements version (e.g., v2, v4).
|
|
31
|
+
* @param {string} fieldReferenceId - The identifier for the field reference to be processed.
|
|
32
|
+
* @returns {string} The transformed field reference if the version is v2 and the identifier contains '::',
|
|
33
|
+
* otherwise returns the original field reference identifier.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getFieldReference(version: FioriElementsVersion, fieldReferenceId: string): string;
|
|
6
36
|
/**
|
|
7
37
|
* Adds definitions for forms in object page sections to the app schema.
|
|
8
38
|
*
|
|
@@ -71,4 +101,35 @@ export declare function addCommonHeaderSchema(appSchema: Definition, entityType:
|
|
|
71
101
|
* @returns the entity set as defined in AVT, if found
|
|
72
102
|
*/
|
|
73
103
|
export declare function determineEntitySetOfEntityType(entityType: EntityType, serviceAVT: ConvertedMetadata): EntitySet | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Adds a data field definition to the application schema based on the provided parameters.
|
|
106
|
+
*
|
|
107
|
+
* @param {AddDefinitionParams} data - An object containing the parameters necessary to define and add the data field.
|
|
108
|
+
* This includes:
|
|
109
|
+
* - `appSchema`: The application schema to which the definition is added
|
|
110
|
+
* - `section`: The section in which the field resides
|
|
111
|
+
* - `sectionType`: The type of the section
|
|
112
|
+
* - `field`: The specific field to be added
|
|
113
|
+
* - `targetID`: The target identifier for the field
|
|
114
|
+
* - `containersSchema`: The schema container for fields
|
|
115
|
+
* - `key`: The key that determines the order of the field
|
|
116
|
+
* - `version`: The version of the schema
|
|
117
|
+
*/
|
|
118
|
+
export declare function addDataFieldDefinition(data: AddDefinitionParams): void;
|
|
119
|
+
/**
|
|
120
|
+
* Adds a data field to the schema definition for action and action group configurations.
|
|
121
|
+
*
|
|
122
|
+
* @param {AddDefinitionParams} data - The input data required to add the data field, including:
|
|
123
|
+
* - appSchema: The application schema to be updated.
|
|
124
|
+
* - withActions: A flag indicating whether actions are included.
|
|
125
|
+
* - sectionType: The type of the section (e.g., Section).
|
|
126
|
+
* - field: The data field to be added.
|
|
127
|
+
* - targetID: The identifier of the target.
|
|
128
|
+
* - containersSchema: The schema containing action and action groups configurations.
|
|
129
|
+
* - key: The key used for the property's index.
|
|
130
|
+
* - version: The schema version information.
|
|
131
|
+
* @returns {void} The function does not return a value.
|
|
132
|
+
*/
|
|
133
|
+
export declare function addDataFieldForActionAndActionGroupDefinition(data: AddDefinitionParams): void;
|
|
134
|
+
export {};
|
|
74
135
|
//# sourceMappingURL=objectPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectPage.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/generate/objectPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"objectPage.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/generate/objectPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,KAAK,EACR,sBAAsB,EAGzB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC9G,OAAO,EAGH,oBAAoB,EAIpB,WAAW,EAEX,EAAE,EACL,MAAM,6BAA6B,CAAC;AAWrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,KAAK,qBAAqB,GAAG;IAAE,CAAC,GAAG,EAAE,MAA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