@sap/ux-specification 1.136.12 → 1.136.13

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
  3. package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
  4. package/dist/documentation/v2/v2-ListReport.html +2 -2
  5. package/dist/documentation/v2/v2-ListReportNew.html +2 -2
  6. package/dist/documentation/v2/v2-ObjectPage.html +2 -2
  7. package/dist/documentation/v2/v2-OverviewPage.html +2 -2
  8. package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
  9. package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
  10. package/dist/documentation/v4/v4-FreestylePage.html +2 -2
  11. package/dist/documentation/v4/v4-ListReport.html +2 -2
  12. package/dist/documentation/v4/v4-ObjectPage.html +2 -2
  13. package/dist/index-min.js +233 -236
  14. package/dist/index-min.js.map +4 -4
  15. package/dist/schemas/v2/ApplicationV2.json +18 -9
  16. package/dist/schemas/v2/ListReportNewConfig.json +91 -0
  17. package/dist/schemas/v4/ApplicationV4.json +32 -16
  18. package/dist/schemas/v4/BuildingBlocksConfig.json +116 -52
  19. package/dist/specification/package.json +5 -5
  20. package/dist/specification/scripts/macros/schema.d.ts +7 -0
  21. package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
  22. package/dist/specification/scripts/macros/schema.js +61 -14
  23. package/dist/specification/scripts/macros/schema.js.map +1 -1
  24. package/dist/specification/scripts/macros/types.d.ts +1 -0
  25. package/dist/specification/scripts/macros/types.d.ts.map +1 -1
  26. package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
  27. package/dist/specification/scripts/schema/to-json-schema.js +54 -9
  28. package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
  29. package/dist/specification/src/sync/common/dist_tag.json +9 -5
  30. package/dist/specification/src/sync/common/i18n.json +6 -1
  31. package/dist/specification/src/sync/common/utils.d.ts +25 -0
  32. package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
  33. package/dist/specification/src/sync/common/utils.js +55 -0
  34. package/dist/specification/src/sync/common/utils.js.map +1 -1
  35. package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
  36. package/dist/specification/src/sync/v2/export/exportPageGeneric.js +1 -10
  37. package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
  38. package/dist/specification/src/sync/v2/generate/manifestPropertyUtils.d.ts +1 -2
  39. package/dist/specification/src/sync/v2/generate/manifestPropertyUtils.d.ts.map +1 -1
  40. package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts +1 -1
  41. package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
  42. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +4 -1
  43. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
  44. package/dist/specification/src/sync/v2/generate/stableIdUtils.d.ts +8 -0
  45. package/dist/specification/src/sync/v2/generate/stableIdUtils.d.ts.map +1 -1
  46. package/dist/specification/src/sync/v2/generate/stableIdUtils.js +1 -0
  47. package/dist/specification/src/sync/v2/generate/stableIdUtils.js.map +1 -1
  48. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.js +3 -2
  49. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.js.map +1 -1
  50. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.d.ts +78 -0
  51. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.d.ts.map +1 -0
  52. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.js +454 -0
  53. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiTable.js.map +1 -0
  54. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +54 -0
  55. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -0
  56. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +148 -0
  57. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -0
  58. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +2 -0
  59. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
  60. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +2 -0
  61. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js.map +1 -1
  62. package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.d.ts +4 -2
  63. package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.d.ts.map +1 -1
  64. package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.js +61 -23
  65. package/dist/specification/src/sync/v2/genericSchemaHandling/pages/ListReportNew.js.map +1 -1
  66. package/dist/specification/src/sync/v2/import/pages/overviewPage.d.ts.map +1 -1
  67. package/dist/specification/src/sync/v2/import/pages/overviewPage.js +28 -13
  68. package/dist/specification/src/sync/v2/import/pages/overviewPage.js.map +1 -1
  69. package/dist/specification/src/sync/v2/utils.d.ts +7 -0
  70. package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
  71. package/dist/specification/src/sync/v2/utils.js +10 -0
  72. package/dist/specification/src/sync/v2/utils.js.map +1 -1
  73. package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
  74. package/dist/specification/src/sync/v4/export/controls/Table.js +20 -23
  75. package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
  76. package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts.map +1 -1
  77. package/dist/specification/src/sync/v4/export/fpmCustomPage.js +13 -3
  78. package/dist/specification/src/sync/v4/export/fpmCustomPage.js.map +1 -1
  79. package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +1 -1
  80. package/dist/specification/src/sync/v4/generate/listReport.js +64 -0
  81. package/dist/specification/src/sync/v4/generate/listReport.js.map +1 -1
  82. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  83. package/dist/specification/src/sync/v4/generate/objectPage.js +51 -4
  84. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  85. package/dist/specification/src/sync/v4/utils/utils.d.ts +33 -0
  86. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  87. package/dist/specification/src/sync/v4/utils/utils.js +95 -0
  88. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  89. package/dist/types/src/common/types.d.ts +1 -0
  90. package/dist/types/src/common/types.d.ts.map +1 -1
  91. package/dist/types/src/common/types.js.map +1 -1
  92. package/package.json +5 -5
@@ -0,0 +1,454 @@
1
+ "use strict";
2
+ /**
3
+ * @file This file is a helper class for its sibling class Table.ts. It provides the logic needed to support the multi-view multi-table scenario (in LR and ALP).
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
22
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
25
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
26
+ };
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.MultiViewsDefinition = exports.MultiViewsVariants = void 0;
49
+ exports.getSyncRuleForMultiTableManifestProperty = getSyncRuleForMultiTableManifestProperty;
50
+ const i18next_1 = __importDefault(require("i18next"));
51
+ const ux_specification_types_1 = require("@sap/ux-specification-types");
52
+ const v2 = __importStar(require("@sap/ux-specification-types/src/v2/genericSchemaHandling/controls/Table"));
53
+ const extensionLogger_1 = require("../../../../extensionLogger");
54
+ const decoration_1 = require("../../../common/decoration");
55
+ const utils_1 = require("../../utils");
56
+ const utils_2 = require("../../generate/utils");
57
+ const manifestPropertyUtils_1 = require("../../generate/manifestPropertyUtils");
58
+ const stableIdUtils_1 = require("../../generate/stableIdUtils");
59
+ const Table_1 = require("./Table");
60
+ const common_1 = require("../../../common");
61
+ // MultiViewsVariants
62
+ let MultiViewsVariants = class MultiViewsVariants {
63
+ };
64
+ exports.MultiViewsVariants = MultiViewsVariants;
65
+ exports.MultiViewsVariants = MultiViewsVariants = __decorate([
66
+ (0, decoration_1.syncRule)({
67
+ // Task of this function is to process the list of views (provided in MultiTableAllVariantsInfo.variantsToInfo) and transform them into properties
68
+ // of processingRule.element. Moreover, the further processing of these child properties is prepared by creating a suitable ProcessingRulesAdapter.
69
+ processingRuleAdapter(processingRule, schemaHandlingParams) {
70
+ const multiTableAllVariantsInfo = schemaHandlingParams.specificParams;
71
+ const properties = {};
72
+ let i = 1;
73
+ for (const key in multiTableAllVariantsInfo.variantsToInfo) {
74
+ const variantInfo = multiTableAllVariantsInfo.variantsToInfo[key];
75
+ const propertyDefinition = {
76
+ $ref: common_1.DEFINITION_LINK_PREFIX + 'Table'
77
+ };
78
+ propertyDefinition[ux_specification_types_1.SchemaTag.propertyIndex] = i;
79
+ propertyDefinition[ux_specification_types_1.SchemaTag.descriptionSrcURL] =
80
+ 'https://ui5.sap.com/sdk/#/topic/37aeed74e17a42caa2cba3123f0c15fc';
81
+ propertyDefinition[ux_specification_types_1.SchemaTag.icon] = variantInfo.isChart ? 'Chart' : 'Table';
82
+ propertyDefinition[ux_specification_types_1.SchemaTag.deletable] = true;
83
+ propertyDefinition.description = variantInfo.description;
84
+ properties[key] = propertyDefinition;
85
+ i++;
86
+ }
87
+ processingRule.element.additionalProperties = false;
88
+ processingRule.element.properties = properties;
89
+ const processingRulesAdapter = function (property, processingRule) {
90
+ const tableParams = { ...multiTableAllVariantsInfo.tableParams };
91
+ const variantInfo = multiTableAllVariantsInfo.variantsToInfo[property];
92
+ tableParams.multiTableInfo = {
93
+ usedTableTypes: tableParams.multiTableInfo.usedTableTypes,
94
+ variantInfo
95
+ };
96
+ processingRule.referenceAdaptation = {
97
+ suffix: `View-${variantInfo.iconTabFilterKey}`, // ensure that a specific copy of type Table will be created in the specific schema
98
+ syncRuleProvider: Table_1.Table,
99
+ specificParams: tableParams
100
+ };
101
+ };
102
+ processingRule.referenceAdaptation = {
103
+ processingRulesAdapter
104
+ };
105
+ }
106
+ })
107
+ ], MultiViewsVariants);
108
+ /**
109
+ * The syncRule for all manifest based direct child properties of quickVariantSelectionX.
110
+ */
111
+ const syncRuleForQuickVariantSelectionXProperty = {
112
+ manifest: {},
113
+ processingRuleAdapter(processingRule, schemaHandlingParams) {
114
+ processingRule.manifestPath = (0, utils_1.getManifestPathToPageSettings)(schemaHandlingParams.pageInfo.pagePath, [
115
+ 'quickVariantSelectionX'
116
+ ]);
117
+ }
118
+ };
119
+ /**
120
+ * Gets the entity type definition for a view.
121
+ *
122
+ * @param variantDefinition - definition of the view from the manifest
123
+ * @param entityType - the entity type of the entity set which is defined for this LR (used for all views which do not explicitly use a different entity set)
124
+ * @param generateParameters - list of API input parameters
125
+ * @returns the definition of the relevant entity type (or undefined when no entity type could be determined)
126
+ */
127
+ function getEntityDefinition(variantDefinition, entityType, generateParameters) {
128
+ if ((0, manifestPropertyUtils_1.hasPropertyTypeError)(variantDefinition, 'entitySet', generateParameters.logger, 'string')) {
129
+ // problem is already logged by helper method
130
+ return;
131
+ }
132
+ const entitySetName = variantDefinition['entitySet']; // if undefined the main entity set of the LR is used
133
+ const entitySetDefinition = entitySetName
134
+ ? generateParameters.serviceAVT.entitySets.find((entitySetDefinition) => entitySetDefinition.name === entitySetName)
135
+ : undefined;
136
+ if (entitySetName && !entitySetDefinition) {
137
+ // illegal entity set specified in the manifest
138
+ (0, extensionLogger_1.log)(generateParameters.logger, {
139
+ severity: "error" /* LogSeverity.Error */,
140
+ message: i18next_1.default.t('NOENTITYTYPE4SET', { property: entitySetName })
141
+ });
142
+ return;
143
+ }
144
+ const entityTypeDefinition = entitySetDefinition ? entitySetDefinition.entityType : entityType;
145
+ return { entitySetDefinition, entityTypeDefinition };
146
+ }
147
+ /**
148
+ * This function retrieves the annotation based information for a view that has been defined in the manifest (under quickVariantSelectionX.variants).
149
+ * Note that the logic needs to be consistent with the corresponding logic in Fiori Elements.
150
+ * In Fiori Elements this logic is spread around and partially redundant.
151
+ * A starting point may be function getLineItemFromVariant in sap.suite.ui.generic.template.js.preparationHelper.
152
+ *
153
+ * @param variant - the view definition from the manifest
154
+ * @param getUiAnnotation - function to retrieve ui annotations based on their path
155
+ * @returns - variantDescription: human readable description of this view
156
+ * - isChart: is this view a chart?
157
+ * - lineItemName: name of the line item annotation used for this view (undefined if the view is a chart)
158
+ */
159
+ function retrieveInfoForVariant(variant, getUiAnnotation) {
160
+ const annotationPath = variant['annotationPath'];
161
+ let variantDescription;
162
+ let isChart = false;
163
+ let lineItemName;
164
+ if (annotationPath) {
165
+ const uiAnnotation = getUiAnnotation(annotationPath);
166
+ if (uiAnnotation) {
167
+ variantDescription = uiAnnotation['Text'];
168
+ let presentationVariant = uiAnnotation[ux_specification_types_1.FacetBase.PresentationVariant];
169
+ if (presentationVariant?.Path) {
170
+ presentationVariant = getUiAnnotation(presentationVariant.Path);
171
+ }
172
+ if (presentationVariant) {
173
+ const visualizations = presentationVariant.Visualizations;
174
+ // In multi-table scenarios Fiori Elements only considers the first visualization entry
175
+ const relevantVisualization = visualizations && visualizations[0];
176
+ if (relevantVisualization) {
177
+ const chartName = (0, utils_2.retrieveNameWithoutVocabularyFromVisualization)(ux_specification_types_1.FacetBase.Chart, relevantVisualization);
178
+ if (chartName) {
179
+ isChart = true;
180
+ }
181
+ else {
182
+ lineItemName = (0, utils_2.retrieveNameWithoutVocabularyFromVisualization)(ux_specification_types_1.FacetBase.LineItem, relevantVisualization);
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ if (!isChart) {
189
+ lineItemName = lineItemName || ux_specification_types_1.FacetBase.LineItem;
190
+ }
191
+ variantDescription = variantDescription || variant['key']; // take the Text from the annotation and use the specified key as a fallback
192
+ return { variantDescription, isChart, lineItemName };
193
+ }
194
+ /**
195
+ * Provide the VariantInfo instance for a view defined in the manifest.
196
+ *
197
+ * @param variantSelector - the property name in manifest which is used to address the view
198
+ * @param variantDefinition - the definition of the view from the manifest
199
+ * @param usedTableTypes - reference to the object collecting the usage information of different table types
200
+ * @param generateParameters - parameters used for generating the app schema
201
+ * @param tableParams - parameters for the table view node hosting the collection of views
202
+ * @param defaultTableSettings - the page global tableSettings object from the manifest, resp. an empty object if not defined
203
+ * @returns the instance of VariantInfo representing the view
204
+ */
205
+ function getVariantInfo(variantSelector, variantDefinition, usedTableTypes, generateParameters, tableParams, defaultTableSettings) {
206
+ // Note that the id of SmartTable and SmartChart in the multi-table case are built in the same way.
207
+ // For SmartTable this is defined in sap.suite.ui.generic.template.ListReport.view.fragments.SmartTable.fragment.xml together with
208
+ // sap.suite.ui.generic.template.lib.StableIdDefinition, type: ListReport, subType: SmartTable.
209
+ // Note that sap.suite.ui.generic.template.js.StableIdHelper.getStableId will not call escapeIdParameter on the parameter (sQuickVariantKey),
210
+ // since the definition provides a value function.
211
+ // For charts the same pattern is used. In this case it is defined in sap.suite.ui.generic.template.ListReport.view.fragments.SmartChart.fragment.xml
212
+ // using function getSuffixFromIconTabFilterKey in class sap.suite.ui.generic.template.js.AnnotationHelper which also does not perform any escaping.
213
+ const smartControlId = `${tableParams.tableId}-${variantDefinition['key']}`;
214
+ const metaInfo = getEntityDefinition(variantDefinition, tableParams.entityType, generateParameters);
215
+ const entityTypeDefinition = metaInfo?.entityTypeDefinition;
216
+ if (!entityTypeDefinition || !entityTypeDefinition?.annotations?.UI) {
217
+ return {
218
+ accessor: variantSelector,
219
+ iconTabFilterKey: (0, stableIdUtils_1.replaceSpecialCharsInId)(variantDefinition['key'], generateParameters),
220
+ variantDefinition,
221
+ isChart: false,
222
+ smartControlId,
223
+ description: variantDefinition['key']
224
+ };
225
+ }
226
+ // convenience function for accessing the ui annotations (removing unwanted prefixes)
227
+ const getUiAnnotation = function (path) {
228
+ if (!path) {
229
+ return;
230
+ }
231
+ const accessor = path.replace(ux_specification_types_1.UIVOCABULARYDOT, '');
232
+ return entityTypeDefinition.annotations.UI[accessor];
233
+ };
234
+ const { variantDescription, isChart, lineItemName } = retrieveInfoForVariant(variantDefinition, getUiAnnotation);
235
+ let lineItemInfo;
236
+ let tableType;
237
+ if (!isChart) {
238
+ if ((0, manifestPropertyUtils_1.hasPropertyTypeError)(variantDefinition, 'tableSettings', generateParameters.logger, 'object')) {
239
+ return {
240
+ accessor: variantSelector,
241
+ iconTabFilterKey: (0, stableIdUtils_1.replaceSpecialCharsInId)(variantDefinition['key'], generateParameters),
242
+ variantDefinition: variantDefinition,
243
+ isChart: false,
244
+ smartControlId,
245
+ description: variantDescription
246
+ };
247
+ }
248
+ const variantTableSettings = variantDefinition['tableSettings'] || undefined;
249
+ if (variantTableSettings) {
250
+ if ((0, manifestPropertyUtils_1.hasPropertyTypeError)(variantTableSettings, 'type', generateParameters.logger, 'string') ||
251
+ !(0, Table_1.checkTableType)(variantTableSettings['type'], generateParameters.logger)) {
252
+ return {
253
+ accessor: variantSelector,
254
+ iconTabFilterKey: (0, stableIdUtils_1.replaceSpecialCharsInId)(variantDefinition['key'], generateParameters),
255
+ variantDefinition: variantDefinition,
256
+ isChart: false,
257
+ smartControlId,
258
+ description: variantDescription
259
+ };
260
+ }
261
+ tableType = variantTableSettings['type'];
262
+ }
263
+ tableType = tableType || defaultTableSettings['type'] || (0, Table_1.getDefaultTableType)(entityTypeDefinition);
264
+ if (tableType === v2.TableTypeV2Enum.ResponsiveTable) {
265
+ usedTableTypes.responsive = usedTableTypes.responsive + 1;
266
+ }
267
+ else {
268
+ usedTableTypes.nonResponsive = usedTableTypes.nonResponsive + 1;
269
+ }
270
+ const lineItemDefinition = getUiAnnotation(lineItemName);
271
+ if (lineItemDefinition) {
272
+ lineItemInfo = (0, utils_2.getLineItemInfo)(lineItemName, lineItemDefinition, entityTypeDefinition, tableType, generateParameters, false);
273
+ }
274
+ }
275
+ const entitySetDefinition = metaInfo.entitySetDefinition; // if metaInfo would have been undefined we would have returned already
276
+ return {
277
+ accessor: variantSelector,
278
+ iconTabFilterKey: (0, stableIdUtils_1.replaceSpecialCharsInId)(variantDefinition['key'], generateParameters),
279
+ variantDefinition,
280
+ isChart,
281
+ smartControlId,
282
+ description: variantDescription,
283
+ lineItemInfo,
284
+ entityTypeDefinition,
285
+ entitySetDefinition,
286
+ tableType
287
+ };
288
+ }
289
+ /**
290
+ * This function analyses all views defined in the manifest and collects information about them.
291
+ *
292
+ * @param variants - the views defined in the manifest
293
+ * @param generateParameters - parameters used for generating the app schema
294
+ * @param tableParams - parameters for the table view node hosting the collection of views
295
+ * @param defaultTableSettings - the page global tableSettings object from the manifest, resp. an empty object if not defined
296
+ * @returns the instance of VariantInfo representing the views and the usage information of different table types.
297
+ * Note that variantsToInfo will be undefined in case there is a severe inconsistency in the manifest definition of the views.
298
+ * In this case an error will also have been logged.
299
+ */
300
+ function getVariantsToInfo(variants, generateParameters, tableParams, defaultTableSettings) {
301
+ const variantsToInfo = {};
302
+ const usedTableTypes = {
303
+ responsive: 0,
304
+ nonResponsive: 0
305
+ };
306
+ const hasErrors = Object.keys(variants).some(function (variantSelector) {
307
+ if ((0, manifestPropertyUtils_1.hasPropertyTypeError)(variants, variantSelector, generateParameters.logger, 'object', true)) {
308
+ return true;
309
+ }
310
+ const variantDefinition = variants[variantSelector]; // the variant definition from the manifest
311
+ if (!variantDefinition['key']) {
312
+ (0, extensionLogger_1.log)(generateParameters.logger, {
313
+ severity: "error" /* LogSeverity.Error */,
314
+ message: i18next_1.default.t('NOKEY4VIEW', { property: variantSelector })
315
+ });
316
+ return true;
317
+ }
318
+ const variantInfo = getVariantInfo(variantSelector, variantDefinition, usedTableTypes, generateParameters, tableParams, defaultTableSettings);
319
+ variantsToInfo[variantSelector] = variantInfo;
320
+ });
321
+ return { variantsToInfo: hasErrors ? undefined : variantsToInfo, usedTableTypes };
322
+ }
323
+ /**
324
+ * Retrieves the information about all views defined in the manifest for a multi-view multi-table scenario and returns them as instance of MultiTableAllVariantsInfo.
325
+ *
326
+ * @param tableParams - parameters for the table view node hosting the collection of views
327
+ * @param generateParameters - parameters used for generating the app schema
328
+ * @returns the instance of MultiTableAllVariantsInfo representing the views. Undefined in case there is a severe inconsistency in the manifest definition of the views.
329
+ * In this case an error will also have been logged.
330
+ */
331
+ function getMultiTableAllVariantsInfo(tableParams, generateParameters) {
332
+ const quickVariantSelectionX = tableParams.settings.quickVariantSelectionX;
333
+ if ((0, manifestPropertyUtils_1.hasPropertyTypeError)(quickVariantSelectionX, 'variants', generateParameters.logger, 'object', true)) {
334
+ return undefined;
335
+ }
336
+ const defaultTableSettings = (tableParams.settings?.tableSettings || {});
337
+ const { variantsToInfo, usedTableTypes } = getVariantsToInfo(quickVariantSelectionX['variants'], generateParameters, tableParams, defaultTableSettings);
338
+ if (!variantsToInfo) {
339
+ return undefined;
340
+ }
341
+ const multiTableParams = { ...tableParams };
342
+ multiTableParams.multiTableInfo = {
343
+ usedTableTypes
344
+ };
345
+ return {
346
+ tableParams: multiTableParams,
347
+ variantsToInfo
348
+ };
349
+ }
350
+ class MultiViewsDefinition {
351
+ }
352
+ exports.MultiViewsDefinition = MultiViewsDefinition;
353
+ __decorate([
354
+ (0, decoration_1.syncRule)(syncRuleForQuickVariantSelectionXProperty)
355
+ ], MultiViewsDefinition.prototype, "enableAutoBinding", void 0);
356
+ __decorate([
357
+ (0, decoration_1.syncRule)(syncRuleForQuickVariantSelectionXProperty)
358
+ ], MultiViewsDefinition.prototype, "showCounts", void 0);
359
+ __decorate([
360
+ (0, decoration_1.syncRule)({
361
+ processingRuleAdapter(processingRule, schemaHandlingParams, generateParameters) {
362
+ const tableParams = schemaHandlingParams.specificParams;
363
+ const multiTableAllVariantsInfo = getMultiTableAllVariantsInfo(tableParams, generateParameters);
364
+ if (multiTableAllVariantsInfo) {
365
+ processingRule.referenceAdaptation = {
366
+ specificParams: multiTableAllVariantsInfo,
367
+ syncRuleProvider: MultiViewsVariants
368
+ };
369
+ }
370
+ else {
371
+ delete processingRule.element;
372
+ }
373
+ }
374
+ })
375
+ ], MultiViewsDefinition.prototype, "variants", void 0);
376
+ /**
377
+ * This Map collects the SyncRules for those properties of class Table that are only relevant in the multi-view multi-table scenario.
378
+ * They are exposed via function getSyncRuleForMultiTableManifestProperty (and used in class Table).
379
+ */
380
+ const syncRulesForMultiTable = new Map();
381
+ // Define SyncRule for property 'views'
382
+ syncRulesForMultiTable.set('views', {
383
+ processingRuleAdapter(processingRule, schemaHandlingParams, generateParameters) {
384
+ // The views node should only be there when we are indeed in a multi-view multi-table scenario and we are still on the top level (not on the level of a view).
385
+ const tableParams = schemaHandlingParams.specificParams;
386
+ if (tableParams.multiTableInfo && !tableParams.multiTableInfo.variantInfo) {
387
+ processingRule.referenceAdaptation = {
388
+ syncRuleProvider: MultiViewsDefinition
389
+ };
390
+ }
391
+ else {
392
+ delete processingRule.element;
393
+ }
394
+ }
395
+ });
396
+ /**
397
+ * Define a SyncRule for one of the properties of Table that are only relevant for the single views but not for the top level table node.
398
+ *
399
+ * @param property - name of the property
400
+ * @param adapt - function that adapts the schema element
401
+ * @param onlyChartI18nKey - if provided this property will only be valid for chart variants. The value is the i18n key for the message that will be shown if the property has been set for a non-chart view.
402
+ */
403
+ function setQuickVariantSelectionXOnlySyncRule(property, adapt, onlyChartI18nKey) {
404
+ // Build the analyze-function for getSyncRuleForManifestProperty:
405
+ const analyze = function (element, schemaHandlingParams) {
406
+ const tableParams = schemaHandlingParams.specificParams;
407
+ let manifestPath;
408
+ let disallowedReason;
409
+ if (tableParams.multiTableInfo?.variantInfo) {
410
+ // If we are on the level of a variant
411
+ manifestPath = (0, utils_1.getManifestPathToPageSettings)(schemaHandlingParams.pageInfo.pagePath, [
412
+ 'quickVariantSelectionX',
413
+ 'variants',
414
+ tableParams.multiTableInfo.variantInfo.accessor
415
+ ]);
416
+ if (onlyChartI18nKey && !tableParams.multiTableInfo.variantInfo.isChart) {
417
+ disallowedReason = i18next_1.default.t(onlyChartI18nKey);
418
+ }
419
+ }
420
+ else {
421
+ disallowedReason = manifestPropertyUtils_1.DISALLOWED_WITHOUT_EXPLANATION; // As this property is only valid for quickVariantSelectionX variants we simply ignore it on top table level
422
+ }
423
+ return { manifestPath, disallowedReason };
424
+ };
425
+ syncRulesForMultiTable.set(property, (0, manifestPropertyUtils_1.getSyncRuleForManifestProperty)(property, analyze, adapt));
426
+ }
427
+ // Define SyncRule for property 'entitySet'
428
+ setQuickVariantSelectionXOnlySyncRule('entitySet',
429
+ // adapt:
430
+ function (element, schemaHandlingParams, generateParameters) {
431
+ const possibleEntitySets = generateParameters.serviceAVT.entitySets.map((entitySet) => entitySet.name);
432
+ (0, common_1.addEnumToSchema)(possibleEntitySets, element);
433
+ } // adapt
434
+ );
435
+ // Define SyncRule for property 'annotationPath'
436
+ setQuickVariantSelectionXOnlySyncRule('annotationPath',
437
+ // adapt:
438
+ function (element, schemaHandlingParams) {
439
+ const tableParams = schemaHandlingParams.specificParams;
440
+ (0, common_1.addEnumForValidAnnotations)(tableParams.multiTableInfo.variantInfo.entityTypeDefinition, ["com.sap.vocabularies.UI.v1.SelectionPresentationVariant" /* UIAnnotationTerms.SelectionPresentationVariant */, "com.sap.vocabularies.UI.v1.SelectionVariant" /* UIAnnotationTerms.SelectionVariant */], element);
441
+ } // adapt
442
+ );
443
+ // Define SyncRule for property 'showItemNavigationOnChart'
444
+ setQuickVariantSelectionXOnlySyncRule('showItemNavigationOnChart', undefined, 'SHOWITEMNAVIGATIONONCHARTONLYCHART');
445
+ /**
446
+ * Expose SyncRules for those properties of class Table that are only relevant in the multi-view multi-table scenario.
447
+ *
448
+ * @param property - name of the property
449
+ * @returns the SyncRule for the given property (if the property is relevant in multi-view multi-table scenario), undefined otherwise
450
+ */
451
+ function getSyncRuleForMultiTableManifestProperty(property) {
452
+ return syncRulesForMultiTable.get(property);
453
+ }
454
+ //# sourceMappingURL=MultiTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiTable.js","sourceRoot":"","sources":["../../../../../../../src/sync/v2/genericSchemaHandling/controls/MultiTable.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAykBH,4FAEC;AAxkBD,sDAA8B;AAK9B,wEAAiG;AAQjG,4GAA8F;AAC9F,iEAAkD;AAClD,2DAAsD;AACtD,uCAA4D;AAC5D,gDAI8B;AAC9B,gFAI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implementing the interfaces defined in the corresponding types file.
3
+ * Note that the logic for dealing with the multi-table scenario is implemented in the sibling file MultiTable.ts.
4
+ */
5
+ import type { smarttable } from 'sap/ui/comp/library';
6
+ import type * as Edm from '@sap-ux/vocabularies-types/Edm';
7
+ import type { ExtensionLogger } from '@sap/ux-specification-types';
8
+ import * as v2 from '@sap/ux-specification-types/src/v2/genericSchemaHandling/controls/Table';
9
+ import type { SapUiGenericAppPageSettings } from '@sap/ux-specification-types/src/common';
10
+ import type { LineItemInfo } from '../../generate/utils';
11
+ import type { MultiTableInfo } from './MultiTable';
12
+ /**
13
+ * Specific params applicable to the current table passed to the ProcessingRuleAdapter.
14
+ *
15
+ * @property settings - the component settings from the manifest
16
+ * @property tableType - the type of the table
17
+ * @property tableId - the control id of the smart table
18
+ * @property multiTableInfo - Information about multi-table scenario if applicable, undefined if quickVariantSelectionX is not defined in the manifest
19
+ * @property lineItemInfo - the line item this table is built on. For the instance representing the multi-table case as a whole it is the line item which is used as fallback.
20
+ * @property entityType - the entity type this table is built for. For the instance representing the multi-table case as a whole it is the entityType of the main entitySet.
21
+ */
22
+ export type TableParams = {
23
+ settings?: SapUiGenericAppPageSettings;
24
+ tableType: v2.TableTypeV2Enum;
25
+ tableId: string;
26
+ multiTableInfo?: MultiTableInfo;
27
+ lineItemInfo?: LineItemInfo;
28
+ entityType: Edm.EntityType;
29
+ };
30
+ /**
31
+ * Returns the default table type used for tables for the given entity type (i.e. the table type which will be used by Fiori Elements if no manifest setting for the table type is available).
32
+ *
33
+ * @param entityTypeDefinition - the entity type for which the table is created
34
+ * @returns the default table type for the given entity type
35
+ */
36
+ export declare function getDefaultTableType(entityTypeDefinition: Edm.EntityType): v2.TableTypeV2Enum;
37
+ /**
38
+ * Checks whether a given table type is valid. Thereby undefined and empty string are also considered as valid (they represent the default table type).
39
+ *
40
+ * @param tableType - the table type to be checked
41
+ * @param logger - would log an error if tableType is invalid
42
+ * @returns - information whether the tableType is valid
43
+ */
44
+ export declare function checkTableType(tableType: string | undefined, logger?: ExtensionLogger): boolean;
45
+ export declare class Table implements v2.Table {
46
+ entitySet?: string;
47
+ annotationPath?: string;
48
+ showItemNavigationOnChart?: boolean;
49
+ views?: v2.MultiViewsDefinition;
50
+ showTablePersonalisation?: boolean;
51
+ exportType?: smarttable.ExportType;
52
+ useExportToExcel?: boolean;
53
+ }
54
+ //# sourceMappingURL=Table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../../../src/sync/v2/genericSchemaHandling/controls/Table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAG3D,OAAO,KAAK,EAAE,eAAe,EAAkD,MAAM,6BAA6B,CAAC;AACnH,OAAO,KAAK,EAAE,MAAM,yEAAyE,CAAC;AAC9F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAG1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC;CAE9B,CAAC;AAcF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,oBAAoB,EAAE,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,eAAe,CAG5F;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS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