@sap/ux-specification 1.142.8 → 1.142.10

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 (203) hide show
  1. package/CHANGELOG.md +46 -4
  2. package/dist/documentation/runDocu-min.mjs +28 -0
  3. package/dist/documentation/{runDocu-min.js.map → runDocu-min.mjs.map} +2 -2
  4. package/dist/documentation/v2/v2-AnalyticalListPage.html +4 -4
  5. package/dist/documentation/v2/v2-ApplicationV2.html +4 -4
  6. package/dist/documentation/v2/v2-ListReport.html +4 -4
  7. package/dist/documentation/v2/v2-ListReportNew.html +4 -4
  8. package/dist/documentation/v2/v2-ObjectPage.html +4 -4
  9. package/dist/documentation/v2/v2-OverviewPage.html +4 -4
  10. package/dist/documentation/v4/v4-ApplicationV4.html +4 -4
  11. package/dist/documentation/v4/v4-BuildingBlocks.html +4 -4
  12. package/dist/documentation/v4/v4-FreestylePage.html +4 -4
  13. package/dist/documentation/v4/v4-ListReport.html +4 -4
  14. package/dist/documentation/v4/v4-ObjectPage.html +4 -4
  15. package/dist/index-min.mjs +1364 -0
  16. package/dist/index-min.mjs.map +7 -0
  17. package/dist/schemas/v4/ApplicationV4.json +37 -0
  18. package/dist/schemas/v4/BuildingBlocksConfig.json +0 -1
  19. package/dist/schemas/v4/ListReportConfig.json +40 -30
  20. package/dist/schemas/v4/ObjectPageConfig.json +83 -1
  21. package/dist/specification/package.json +22 -15
  22. package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
  23. package/dist/specification/scripts/macros/corrections.js +0 -6
  24. package/dist/specification/scripts/macros/corrections.js.map +1 -1
  25. package/dist/specification/src/api.d.ts.map +1 -1
  26. package/dist/specification/src/api.js +6 -6
  27. package/dist/specification/src/api.js.map +1 -1
  28. package/dist/specification/src/ftfs/ftfs.d.ts.map +1 -1
  29. package/dist/specification/src/ftfs/ftfs.js +25 -1
  30. package/dist/specification/src/ftfs/ftfs.js.map +1 -1
  31. package/dist/specification/src/i18n/i18n.js +35 -2
  32. package/dist/specification/src/i18n/i18n.js.map +1 -1
  33. package/dist/specification/src/index.d.ts +1 -0
  34. package/dist/specification/src/index.d.ts.map +1 -1
  35. package/dist/specification/src/index.js +4 -0
  36. package/dist/specification/src/index.js.map +1 -1
  37. package/dist/specification/src/sync/common/DataFieldStrategy.d.ts +11 -3
  38. package/dist/specification/src/sync/common/DataFieldStrategy.d.ts.map +1 -1
  39. package/dist/specification/src/sync/common/DataFieldStrategy.js +35 -7
  40. package/dist/specification/src/sync/common/DataFieldStrategy.js.map +1 -1
  41. package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +37 -3
  42. package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -1
  43. package/dist/specification/src/sync/common/decoration/decorator-paths.js +18 -1
  44. package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -1
  45. package/dist/specification/src/sync/common/decoration/decorators.d.ts +8 -5
  46. package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
  47. package/dist/specification/src/sync/common/decoration/decorators.js +4 -1
  48. package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
  49. package/dist/specification/src/sync/common/decoration/steps/Enums.d.ts.map +1 -1
  50. package/dist/specification/src/sync/common/decoration/steps/Enums.js +47 -8
  51. package/dist/specification/src/sync/common/decoration/steps/Enums.js.map +1 -1
  52. package/dist/specification/src/sync/common/i18n.json +3 -1
  53. package/dist/specification/src/sync/v4/application.d.ts +2 -0
  54. package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
  55. package/dist/specification/src/sync/v4/application.js +21 -0
  56. package/dist/specification/src/sync/v4/application.js.map +1 -1
  57. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +13 -0
  58. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
  59. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js +92 -1
  60. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
  61. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
  62. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +25 -11
  63. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
  64. package/dist/specification/src/sync/v4/export/controls/Table.d.ts +2 -2
  65. package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
  66. package/dist/specification/src/sync/v4/export/controls/Table.js +21 -9
  67. package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
  68. package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +8 -1
  69. package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
  70. package/dist/specification/src/sync/v4/export/controls/ToolBar.js +7 -1
  71. package/dist/specification/src/sync/v4/export/controls/ToolBar.js.map +1 -1
  72. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +4 -0
  73. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
  74. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +24 -1
  75. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
  76. package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
  77. package/dist/specification/src/sync/v4/export/export.js +21 -6
  78. package/dist/specification/src/sync/v4/export/export.js.map +1 -1
  79. package/dist/specification/src/sync/v4/export/factory.d.ts.map +1 -1
  80. package/dist/specification/src/sync/v4/export/factory.js +1 -0
  81. package/dist/specification/src/sync/v4/export/factory.js.map +1 -1
  82. package/dist/specification/src/sync/v4/export/pages/ListReport.d.ts +2 -2
  83. package/dist/specification/src/sync/v4/export/pages/ListReport.d.ts.map +1 -1
  84. package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
  85. package/dist/specification/src/sync/v4/generate/actions.d.ts +2 -2
  86. package/dist/specification/src/sync/v4/generate/actions.d.ts.map +1 -1
  87. package/dist/specification/src/sync/v4/generate/actions.js +4 -2
  88. package/dist/specification/src/sync/v4/generate/actions.js.map +1 -1
  89. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +4 -4
  90. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
  91. package/dist/specification/src/sync/v4/generate/generate.d.ts +4 -2
  92. package/dist/specification/src/sync/v4/generate/generate.d.ts.map +1 -1
  93. package/dist/specification/src/sync/v4/generate/generate.js +8 -4
  94. package/dist/specification/src/sync/v4/generate/generate.js.map +1 -1
  95. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts +3 -3
  96. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts.map +1 -1
  97. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js +12 -13
  98. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js.map +1 -1
  99. package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts +27 -13
  100. package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts.map +1 -1
  101. package/dist/specification/src/sync/v4/generate/list-report/listReport.js +196 -93
  102. package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -1
  103. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  104. package/dist/specification/src/sync/v4/generate/objectPage.js +106 -6
  105. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  106. package/dist/specification/src/sync/v4/generate/utils/inlineEdit.d.ts +3 -3
  107. package/dist/specification/src/sync/v4/generate/utils/inlineEdit.d.ts.map +1 -1
  108. package/dist/specification/src/sync/v4/generate/utils/inlineEdit.js +3 -3
  109. package/dist/specification/src/sync/v4/generate/utils/inlineEdit.js.map +1 -1
  110. package/dist/specification/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
  111. package/dist/specification/src/sync/v4/import/pages/listReport.js +66 -3
  112. package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
  113. package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
  114. package/dist/specification/src/sync/v4/import/pages/objectPage.js +14 -0
  115. package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
  116. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +6 -0
  117. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
  118. package/dist/specification/src/sync/v4/sync-rules/Page.js +8 -0
  119. package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
  120. package/dist/specification/src/sync/v4/utils/utils.d.ts +186 -51
  121. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  122. package/dist/specification/src/sync/v4/utils/utils.js +363 -90
  123. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  124. package/dist/templates/action/manifest.action-menu.json +10 -0
  125. package/dist/templates/action/manifest.action.json +13 -0
  126. package/dist/templates/app/Component.js +13 -0
  127. package/dist/templates/app/Component.ts +11 -0
  128. package/dist/templates/building-block/action/View.xml +30 -0
  129. package/dist/templates/building-block/chart/View.xml +9 -0
  130. package/dist/templates/building-block/common/manifest.json +7 -0
  131. package/dist/templates/building-block/custom-column/View.xml +5 -0
  132. package/dist/templates/building-block/custom-filter-field/View.xml +12 -0
  133. package/dist/templates/building-block/custom-form-field/View.xml +12 -0
  134. package/dist/templates/building-block/field/View.xml +8 -0
  135. package/dist/templates/building-block/filter-bar/View.xml +10 -0
  136. package/dist/templates/building-block/form/View.xml +4 -0
  137. package/dist/templates/building-block/page/View.xml +5 -0
  138. package/dist/templates/building-block/rich-text-editor/View.xml +3 -0
  139. package/dist/templates/building-block/rich-text-editor-button-groups/View.xml +18 -0
  140. package/dist/templates/building-block/table/View.xml +19 -0
  141. package/dist/templates/column/1.84/manifest.json +28 -0
  142. package/dist/templates/column/1.85/manifest.json +31 -0
  143. package/dist/templates/column/1.86/manifest.json +43 -0
  144. package/dist/templates/common/EventHandler.js +25 -0
  145. package/dist/templates/common/EventHandler.ts +28 -0
  146. package/dist/templates/common/Fragment.xml +3 -0
  147. package/dist/templates/common/FragmentWithForm.xml +7 -0
  148. package/dist/templates/common/FragmentWithVBox.xml +5 -0
  149. package/dist/templates/common/sap.fe.d.ts +43 -0
  150. package/dist/templates/controller-extension/Controller.js +18 -0
  151. package/dist/templates/controller-extension/Controller.ts +20 -0
  152. package/dist/templates/controller-extension/ControllerExtension.d.ts +11 -0
  153. package/dist/templates/controller-extension/manifest.json +14 -0
  154. package/dist/templates/field/manifest.json +32 -0
  155. package/dist/templates/filter/Controller.js +21 -0
  156. package/dist/templates/filter/Controller.ts +24 -0
  157. package/dist/templates/filter/fragment.xml +15 -0
  158. package/dist/templates/filter/manifest.json +12 -0
  159. package/dist/templates/header-section/1.85/manifest.json +43 -0
  160. package/dist/templates/header-section/1.86/manifest.json +45 -0
  161. package/dist/templates/page/custom/1.84/ext/Controller.js +45 -0
  162. package/dist/templates/page/custom/1.84/ext/Controller.ts +42 -0
  163. package/dist/templates/page/custom/1.84/ext/View.xml +6 -0
  164. package/dist/templates/page/custom/1.84/i18n/i18n.properties +2 -0
  165. package/dist/templates/page/custom/1.84/manifest.json +32 -0
  166. package/dist/templates/page/custom/1.94/ext/Controller.js +45 -0
  167. package/dist/templates/page/custom/1.94/ext/Controller.ts +42 -0
  168. package/dist/templates/page/custom/1.94/ext/View.xml +6 -0
  169. package/dist/templates/page/custom/1.94/i18n/i18n.properties +2 -0
  170. package/dist/templates/page/custom/1.94/manifest.json +33 -0
  171. package/dist/templates/page/custom/i18n/i18n.properties +2 -0
  172. package/dist/templates/page/list/manifest.json +20 -0
  173. package/dist/templates/page/object/manifest.json +33 -0
  174. package/dist/templates/section/1.85/manifest.json +33 -0
  175. package/dist/templates/section/1.86/manifest.json +32 -0
  176. package/dist/templates/subsection/1.85/manifest.json +37 -0
  177. package/dist/templates/subsection/1.86/manifest.json +36 -0
  178. package/dist/templates/view/ext/CustomViewWithTable.xml +3 -0
  179. package/dist/templates/view/manifest.json +41 -0
  180. package/dist/types/src/apiTypes.d.ts +3 -0
  181. package/dist/types/src/apiTypes.d.ts.map +1 -1
  182. package/dist/types/src/apiTypes.js.map +1 -1
  183. package/dist/types/src/common/types.d.ts +5 -1
  184. package/dist/types/src/common/types.d.ts.map +1 -1
  185. package/dist/types/src/common/types.js +4 -0
  186. package/dist/types/src/common/types.js.map +1 -1
  187. package/dist/types/src/v4/application.d.ts +13 -1
  188. package/dist/types/src/v4/application.d.ts.map +1 -1
  189. package/dist/types/src/v4/application.js.map +1 -1
  190. package/dist/types/src/v4/controls/ObjectPageSection.d.ts +52 -1
  191. package/dist/types/src/v4/controls/ObjectPageSection.d.ts.map +1 -1
  192. package/dist/types/src/v4/controls/ToolBar.d.ts +1 -24
  193. package/dist/types/src/v4/controls/ToolBar.d.ts.map +1 -1
  194. package/dist/types/src/v4/webapp/manifest/sapUi5.d.ts +9 -0
  195. package/dist/types/src/v4/webapp/manifest/sapUi5.d.ts.map +1 -1
  196. package/dist/types/src/v4/webapp/manifest/sapUi5.js.map +1 -1
  197. package/dist/types/src/v4/webapp/manifest/sapUiPageV4.d.ts +23 -3
  198. package/dist/types/src/v4/webapp/manifest/sapUiPageV4.d.ts.map +1 -1
  199. package/dist/types/src/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
  200. package/package.json +22 -15
  201. package/dist/documentation/runDocu-min.js +0 -28
  202. package/dist/index-min.js +0 -647
  203. package/dist/index-min.js.map +0 -7
@@ -36,7 +36,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.QUALIFIER_SEPARATOR = exports.FIELD_SEPARATOR = exports.DATA_FIELD_FOR_ACTION_GROUP = void 0;
39
+ exports.QUALIFIER_SEPARATOR = exports.FIELD_SEPARATOR = exports.DATA_FIELD_FOR_ACTION_GROUP = exports.MIN_UI5_VERSION_FOR_TABLE_TYPE_RESTRICTIONS = void 0;
40
+ exports.hasEmbeddedComponent = hasEmbeddedComponent;
40
41
  exports.addExtensionToArray = addExtensionToArray;
41
42
  exports.getColumnsEnum = getColumnsEnum;
42
43
  exports.addEnumForProperties = addEnumForProperties;
@@ -70,8 +71,13 @@ exports.importActionSettingsOfReference = importActionSettingsOfReference;
70
71
  exports.addCustomFieldDefinition = addCustomFieldDefinition;
71
72
  exports.addManifestPathsToProperties = addManifestPathsToProperties;
72
73
  exports.getInsertableForEntitySet = getInsertableForEntitySet;
74
+ exports.getDefaultTableType = getDefaultTableType;
75
+ exports.getTableTypeOptions = getTableTypeOptions;
76
+ exports.ensureEntitySetWithCorrectType = ensureEntitySetWithCorrectType;
77
+ exports.getTableTypeOptionsByContext = getTableTypeOptionsByContext;
73
78
  exports.getPageManifestPath = getPageManifestPath;
74
79
  const utils_1 = require("../../common/utils");
80
+ const importProject_1 = require("../../common/importProject");
75
81
  const StableIdHelper_1 = require("./StableIdHelper");
76
82
  const common_1 = require("../../common");
77
83
  const i18next_1 = __importDefault(require("i18next"));
@@ -83,8 +89,75 @@ const utils_2 = require("../import/utils");
83
89
  const src_1 = require("@sap/ux-specification-types/src");
84
90
  const v4controls = __importStar(require("../export/controls"));
85
91
  const pages = __importStar(require("../export/pages"));
92
+ const v4_1 = require("@sap/ux-specification-types/src/v4");
93
+ const project_access_1 = require("@sap-ux/project-access");
86
94
  const application_1 = require("../application");
87
95
  const propertiesForEdit_1 = require("../generate/utils/propertiesForEdit");
96
+ const utils_3 = require("../sync-rules/utils");
97
+ /**
98
+ * Map of table type options based on the detected default table type.
99
+ * Each table type has a predefined set of compatible options and a default type.
100
+ */
101
+ const TABLE_TYPE_OPTIONS_MAP = {
102
+ [v4_1.TableTypeV4.AnalyticalTable]: {
103
+ options: [v4_1.TableTypeV4.AnalyticalTable, v4_1.TableTypeV4.ResponsiveTable, v4_1.TableTypeV4.GridTable],
104
+ defaultType: v4_1.TableTypeV4.AnalyticalTable
105
+ },
106
+ [v4_1.TableTypeV4.TreeTable]: {
107
+ options: [v4_1.TableTypeV4.TreeTable, v4_1.TableTypeV4.ResponsiveTable, v4_1.TableTypeV4.GridTable],
108
+ defaultType: v4_1.TableTypeV4.TreeTable
109
+ },
110
+ [v4_1.TableTypeV4.ResponsiveTable]: {
111
+ options: [v4_1.TableTypeV4.ResponsiveTable, v4_1.TableTypeV4.GridTable],
112
+ defaultType: v4_1.TableTypeV4.ResponsiveTable
113
+ },
114
+ [v4_1.TableTypeV4.GridTable]: {
115
+ options: [v4_1.TableTypeV4.ResponsiveTable, v4_1.TableTypeV4.GridTable],
116
+ defaultType: v4_1.TableTypeV4.ResponsiveTable
117
+ }
118
+ };
119
+ /**
120
+ * Default table type used as a fallback when entity set is undefined or capabilities cannot be determined.
121
+ * ResponsiveTable is chosen as the safest and most universally applicable option.
122
+ */
123
+ const FALLBACK_TABLE_TYPE = v4_1.TableTypeV4.ResponsiveTable;
124
+ /**
125
+ * Fallback table type options used when entity set capabilities cannot be determined.
126
+ * Derives from FALLBACK_TABLE_TYPE to ensure consistency across fallback scenarios.
127
+ */
128
+ const FALLBACK_TABLE_TYPE_OPTIONS = TABLE_TYPE_OPTIONS_MAP[FALLBACK_TABLE_TYPE];
129
+ /**
130
+ * Minimum UI5 version that supports capability-based table type restrictions.
131
+ *
132
+ * Before 1.142.0:
133
+ * - Table type was optional
134
+ * - All table types were available regardless of service capabilities
135
+ * - No warning messages for missing table type or type-dependent properties
136
+ *
137
+ * From 1.142.0 onwards:
138
+ * - Table type options are restricted based on entity set capabilities (analytical/hierarchical/standard)
139
+ * - Warning messages are shown when table type is missing but type-dependent properties exist
140
+ * - Schema enum values are dynamically restricted to match detected capabilities
141
+ */
142
+ exports.MIN_UI5_VERSION_FOR_TABLE_TYPE_RESTRICTIONS = '1.142.0';
143
+ /**
144
+ * Returns true when the given manifest section object contains an `embeddedComponent` property,
145
+ * i.e. it is an HDM-style reuse component section rather than an XML-fragment custom section.
146
+ *
147
+ * @param section - The manifest section object to test.
148
+ * @returns `true` if the section has an `embeddedComponent` property.
149
+ */
150
+ function hasEmbeddedComponent(section) {
151
+ return typeof section === 'object' && section !== null && ux_specification_types_1.TemplatePropertyName.EmbeddedComponent in section;
152
+ }
153
+ /**
154
+ * Table type options for UI5 versions before 1.142.0, where capability-based restrictions
155
+ * are not supported. All table types are available, with ResponsiveTable as the default.
156
+ */
157
+ const LEGACY_VERSION_TABLE_TYPE_OPTIONS = {
158
+ options: [v4_1.TableTypeV4.ResponsiveTable, v4_1.TableTypeV4.GridTable, v4_1.TableTypeV4.AnalyticalTable, v4_1.TableTypeV4.TreeTable],
159
+ defaultType: v4_1.TableTypeV4.ResponsiveTable
160
+ };
88
161
  exports.DATA_FIELD_FOR_ACTION_GROUP = 'DataFieldForActionGroup';
89
162
  const UI_ANNOTATION_KEY = 'UI';
90
163
  exports.FIELD_SEPARATOR = '::';
@@ -742,24 +815,31 @@ function addCustomColumnDefinition(appSchema, v4Page, logger, customColumnDefini
742
815
  appSchema.definitions[lineItemId].properties = sortedColumnsAsObject;
743
816
  }
744
817
  /**
745
- * Determines the appropriate action definition name based on the provided line item data and record type.
818
+ * Determines the appropriate action definition name based on the provided annotation data and record type.
746
819
  *
747
- * @param {LineItemDataForSchema} data - The schema data for the line item, including its identifier and metadata.
748
- * @param {DataFieldAbstractTypes} lineItemRecord - The record representing a data field or action within the line item.
820
+ * @param {AnnotationSchemaContext} data - The schema data for the annotation, including its identifier and metadata.
821
+ * @param {DataFieldAbstractTypes} annotationRecord - The record representing a data field or action within the annotation collection.
749
822
  * @param {boolean} isInnerAction - Whether the action belongs to the action group.
750
823
  * @returns {DefinitionName} The determined action definition name based on the provided data and group type.
751
824
  */
752
- function determineActionDefinitionName(data, lineItemRecord, isInnerAction) {
753
- const isGrouped = lineItemRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForActionGroup" /* UIAnnotationTypes.DataFieldForActionGroup */;
825
+ function determineActionDefinitionName(data, annotationRecord, isInnerAction) {
826
+ const isGrouped = annotationRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForActionGroup" /* UIAnnotationTypes.DataFieldForActionGroup */;
754
827
  let actionDefinitionName;
755
- if (data.lineItemId.startsWith(ux_specification_types_1.DefinitionName.LineItemsOfView)) {
828
+ if (data.annotation['term'] === "com.sap.vocabularies.UI.v1.Chart" /* UIAnnotationTerms.Chart */) {
829
+ actionDefinitionName = isGrouped
830
+ ? ux_specification_types_1.DefinitionName.ViewToolBarActionGroup
831
+ : isInnerAction
832
+ ? ux_specification_types_1.DefinitionName.ViewToolBarActionBase
833
+ : ux_specification_types_1.DefinitionName.ChartToolBarAction;
834
+ }
835
+ else if (data.annotationId.startsWith(ux_specification_types_1.DefinitionName.LineItemsOfView)) {
756
836
  actionDefinitionName = isGrouped
757
837
  ? ux_specification_types_1.DefinitionName.ViewToolBarActionGroup
758
838
  : isInnerAction
759
839
  ? ux_specification_types_1.DefinitionName.ViewToolBarActionBase
760
840
  : ux_specification_types_1.DefinitionName.ViewToolBarAction;
761
841
  }
762
- else if (data.lineItemId.startsWith(ux_specification_types_1.DefinitionName.LineItems)) {
842
+ else if (data.annotationId.startsWith(ux_specification_types_1.DefinitionName.LineItems)) {
763
843
  actionDefinitionName = isGrouped
764
844
  ? ux_specification_types_1.DefinitionName.ToolBarActionGroup
765
845
  : isInnerAction
@@ -797,32 +877,32 @@ function addTargetAndKeysOfAction(actionDefinition, lineItemRecord, actionId) {
797
877
  }
798
878
  }
799
879
  /**
800
- * Adds an action record to a schema definition based on the provided line item definition parameters.
880
+ * Adds an action record to a schema definition based on the provided annotation record definition parameters.
801
881
  * This involves defining action-specific properties, references, and metadata, and updating the schema accordingly.
802
882
  *
803
- * @param {AddLineItemDefinitionParams} lineItemDefinitionParams - The parameters describing the line item definition, including data, actions, path, record, and index.
883
+ * @param {AddAnnotationRecordDefinitionParams} annotationRecordParams - The parameters describing the annotation record definition, including data, actions, path, record, and index.
804
884
  * @param {boolean} [createRef] - A flag indicating whether to create a reference for the action definition.
805
885
  * @param {boolean} isInnerAction - Whether the action belongs to the action group.
806
886
  */
807
- function addActionRecordToSchema(lineItemDefinitionParams, createRef = true, isInnerAction = false) {
808
- const { lineItemData: data, actions: actionsDefinition, lineItemPath, lineItemRecord, index: recordIndex } = lineItemDefinitionParams;
887
+ function addActionRecordToSchema(annotationRecordParams, createRef = true, isInnerAction = false) {
888
+ const { schemaContext: data, actions: actionsDefinition, annotationPath, annotationRecord, index: recordIndex } = annotationRecordParams;
809
889
  // Action but not inline action
810
- if (lineItemRecord.Determining === true) {
890
+ if (annotationRecord.Determining === true) {
811
891
  return;
812
892
  }
813
893
  //no footer bar -> toolbar action
814
- const actionDefinitionName = determineActionDefinitionName(data, lineItemRecord, isInnerAction);
815
- const description = (0, common_1.getDataFieldDescription)(lineItemRecord, data.entityType);
894
+ const actionDefinitionName = determineActionDefinitionName(data, annotationRecord, isInnerAction);
895
+ const description = (0, common_1.getDataFieldDescription)(annotationRecord, data.entityType);
816
896
  // Generate stable ID using strategy pattern to ensure correct key format for all action types.
817
897
  // This is crucial for IBN actions, which need the full key including SemanticObject and RequiresContext
818
898
  // (e.g., "DataFieldForIntentBasedNavigation::v4Freestyle::Inbound::RequiresContext")
819
899
  // to be properly matched when referenced in manifest-based action menus.
820
- const strategy = DataFieldStrategy_1.dataFieldStrategyContext.getStrategy(lineItemRecord.$Type);
821
- const stableId = strategy.generateStableId(lineItemRecord);
900
+ const strategy = DataFieldStrategy_1.dataFieldStrategyContext.getStrategy(annotationRecord.$Type);
901
+ const stableId = strategy.generateStableId(annotationRecord);
822
902
  // Extract Action property for keys generation (used by addTargetAndKeysOfAction).
823
903
  // For IBN actions, this is just the action name (e.g., "Inbound").
824
904
  // For bound actions, this may include namespace (e.g., "com.sap.Action/MyAction").
825
- const actionId = typeof lineItemRecord.Action === 'string' ? lineItemRecord.Action : lineItemRecord.Action['path'];
905
+ const actionId = typeof annotationRecord.Action === 'string' ? annotationRecord.Action : annotationRecord.Action['path'];
826
906
  // Remove type prefix from stable ID for use in $ref generation.
827
907
  // This ensures getUniqueFacetDefinitionLink can properly detect duplicates based on full action identity,
828
908
  // not just the Action property. For example, two IBN actions with different SemanticObjects but same Action
@@ -834,7 +914,7 @@ function addActionRecordToSchema(lineItemDefinitionParams, createRef = true, isI
834
914
  description
835
915
  });
836
916
  if (createRef) {
837
- actionDefinition.$ref = (0, common_1.getUniqueFacetDefinitionLink)(actionDefinitionName, (0, common_1.prepareRef)(stableIdWithoutPrefix), data.appSchema, lineItemPath);
917
+ actionDefinition.$ref = (0, common_1.getUniqueFacetDefinitionLink)(actionDefinitionName, (0, common_1.prepareRef)(stableIdWithoutPrefix), data.appSchema, annotationPath);
838
918
  }
839
919
  else {
840
920
  actionDefinition.properties = {};
@@ -842,38 +922,38 @@ function addActionRecordToSchema(lineItemDefinitionParams, createRef = true, isI
842
922
  actionDefinition.isViewNode = true;
843
923
  }
844
924
  actionDefinition[ux_specification_types_1.SchemaTag.propertyIndex] = recordIndex;
845
- actionDefinition[ux_specification_types_1.SchemaTag.dataType] = (0, common_1.determineDataType)(lineItemRecord);
925
+ actionDefinition[ux_specification_types_1.SchemaTag.dataType] = (0, common_1.determineDataType)(annotationRecord);
846
926
  //keys
847
- addTargetAndKeysOfAction(actionDefinition, lineItemRecord, actionId);
848
- actionDefinition[ux_specification_types_1.SchemaTag.annotationType] = lineItemRecord.$Type;
927
+ addTargetAndKeysOfAction(actionDefinition, annotationRecord, actionId);
928
+ actionDefinition[ux_specification_types_1.SchemaTag.annotationType] = annotationRecord.$Type;
849
929
  if (createRef) {
850
930
  // Using previously computed ref instead of generating new one to support action duplication
851
931
  const previouslyComputedRef = actionDefinition.$ref.replace(utils_1.DEFINITION_LINK_PREFIX, '');
852
932
  const action = (0, common_1.parseSchemaDefinition)(actionDefinitionName, previouslyComputedRef, data.appSchema, false);
853
- action[ux_specification_types_1.SchemaTag.annotationPath] = `${lineItemPath}/${recordIndex}`;
933
+ action[ux_specification_types_1.SchemaTag.annotationPath] = `${annotationPath}/${recordIndex}`;
854
934
  }
855
935
  else {
856
- actionDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `${lineItemPath}/${recordIndex}`;
936
+ actionDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `${annotationPath}/${recordIndex}`;
857
937
  }
858
938
  }
859
939
  /**
860
940
  * Adds a group action record to the schema based on the given parameters. This involves determining
861
941
  * action definitions, creating or referencing schema properties, and setting metadata fields.
862
942
  *
863
- * @param {AddLineItemDefinitionParams} lineItemDefinitionParams - Parameters that define the line item, including data, record, path, index, and actions.
943
+ * @param {AddAnnotationRecordDefinitionParams} annotationRecordParams - Parameters that define the annotation record, including data, record, path, index, and actions.
864
944
  * @param {boolean} [createRef] - Indicates whether to create a reference for the action definition or to use an inline object.
865
945
  */
866
- function addGroupActionRecordToSchema(lineItemDefinitionParams, createRef = true) {
867
- const { lineItemData, lineItemRecord, lineItemPath, index, actions } = lineItemDefinitionParams;
946
+ function addGroupActionRecordToSchema(annotationRecordParams, createRef = true) {
947
+ const { schemaContext, annotationRecord, annotationPath, index, actions } = annotationRecordParams;
868
948
  //no footer bar -> toolbar action
869
- const actionDefinitionName = determineActionDefinitionName(lineItemData, lineItemRecord);
870
- const propertyKey = (0, StableIdHelper_1.getStableIdPartFromDataField)(lineItemRecord);
949
+ const actionDefinitionName = determineActionDefinitionName(schemaContext, annotationRecord);
950
+ const propertyKey = (0, StableIdHelper_1.getStableIdPartFromDataField)(annotationRecord);
871
951
  let actionDefinition = {};
872
952
  if (createRef) {
873
953
  actions.properties[`${propertyKey}`] = {
874
954
  $ref: (0, common_1.getFacetDefinitionLink)(actionDefinitionName, (0, common_1.prepareRef)(propertyKey))
875
955
  };
876
- actionDefinition = (0, common_1.parseSchemaDefinition)(actionDefinitionName, (0, common_1.prepareRef)(propertyKey), lineItemData.appSchema);
956
+ actionDefinition = (0, common_1.parseSchemaDefinition)(actionDefinitionName, (0, common_1.prepareRef)(propertyKey), schemaContext.appSchema);
877
957
  }
878
958
  else {
879
959
  actions.properties[`${propertyKey}`] = actionDefinition;
@@ -881,115 +961,119 @@ function addGroupActionRecordToSchema(lineItemDefinitionParams, createRef = true
881
961
  if (!actionDefinition.properties) {
882
962
  actionDefinition.properties = {};
883
963
  }
884
- actionDefinition.description = (0, common_1.getDataFieldDescription)(lineItemRecord, lineItemData.entityType);
964
+ actionDefinition.description = (0, common_1.getDataFieldDescription)(annotationRecord, schemaContext.entityType);
885
965
  actionDefinition.type = 'object';
886
966
  actionDefinition.isViewNode = true;
887
967
  actionDefinition[ux_specification_types_1.SchemaTag.propertyIndex] = index;
888
- actionDefinition[ux_specification_types_1.SchemaTag.dataType] = (0, common_1.determineDataType)(lineItemRecord);
889
- actionDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `${lineItemPath}/${index}`;
890
- (lineItemRecord['Actions'] ?? []).forEach((action, index) => {
891
- const lineItemActionDefinitionParams = {
892
- ...lineItemDefinitionParams,
893
- lineItemRecord: action,
894
- lineItemPath: `${actionDefinition[ux_specification_types_1.SchemaTag.annotationPath]}/Actions`,
968
+ actionDefinition[ux_specification_types_1.SchemaTag.dataType] = (0, common_1.determineDataType)(annotationRecord);
969
+ actionDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `${annotationPath}/${index}`;
970
+ (annotationRecord['Actions'] ?? []).forEach((action, index) => {
971
+ const innerActionParams = {
972
+ ...annotationRecordParams,
973
+ annotationRecord: action,
974
+ annotationPath: `${actionDefinition[ux_specification_types_1.SchemaTag.annotationPath]}/Actions`,
895
975
  actions: actionDefinition,
896
976
  index
897
977
  };
898
- addActionRecordToSchema(lineItemActionDefinitionParams, createRef, true);
978
+ addActionRecordToSchema(innerActionParams, createRef, true);
899
979
  });
900
980
  }
901
981
  /**
902
982
  * Adds a line item action definition to the schema based on the provided parameters.
903
- * Handles determining which action to take based on specific conditions of the line item record.
983
+ * Handles determining which action to take based on specific conditions of the annotation record.
904
984
  *
905
- * @param {AddLineItemDefinitionParams} data - An object containing the details of the line item record and the line item definition.
906
- * @param {object} data.lineItemRecord - The record of the line item to be processed, containing relevant properties.
907
- * @param {boolean} data.lineItemRecord.Inline - Indicates whether the line item is inline.
908
- * @param {boolean} data.lineItemRecord.Determining - Indicates if the line item is determining.
909
- * @param {boolean} data.lineItemDefinition - Indicates whether the line item definition is present.
985
+ * @param {AddAnnotationRecordDefinitionParams} annotationRecordParams - An object containing the details of the annotation record and the inline definition.
986
+ * @param {object} annotationRecordParams.annotationRecord - The annotation record to be processed, containing relevant properties.
987
+ * @param {boolean} annotationRecordParams.annotationRecord.Inline - Indicates whether the record is inline.
988
+ * @param {boolean} annotationRecordParams.annotationRecord.Determining - Indicates if the record is determining.
989
+ * @param {boolean} annotationRecordParams.inlineDefinition - Indicates whether the inline definition is present.
910
990
  */
911
- function addLineItemActionDefinition(data) {
912
- const { lineItemRecord, lineItemDefinition } = data;
913
- if (lineItemRecord.Inline !== true || lineItemRecord.Determining === true) {
914
- addActionRecordToSchema(data, !lineItemDefinition);
991
+ function addLineItemActionDefinition(annotationRecordParams) {
992
+ const { annotationRecord, inlineDefinition } = annotationRecordParams;
993
+ if (annotationRecord.Inline !== true || annotationRecord.Determining === true) {
994
+ addActionRecordToSchema(annotationRecordParams, !inlineDefinition);
915
995
  }
916
996
  else {
917
- addLineItemRecordToSchema(data);
997
+ addLineItemRecordToSchema(annotationRecordParams);
918
998
  }
919
999
  }
920
1000
  /**
921
1001
  * Adds a line item record to the provided schema based on the definition parameters.
922
1002
  *
923
- * @param {AddLineItemDefinitionParams} lineItemDefinitionParams - The parameters defining the line item data, schema information, and record.
1003
+ * @param {AddAnnotationRecordDefinitionParams} annotationRecordParams - The parameters defining the annotation data, schema information, and record.
924
1004
  */
925
- function addLineItemRecordToSchema(lineItemDefinitionParams) {
926
- const { lineItemData, lineItemRecord, lineItemDefinition, lineItemPath, index, columnDefinitionName } = lineItemDefinitionParams;
927
- const columnDefinition = lineItemRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */
928
- ? `${columnDefinitionName}Action`
929
- : columnDefinitionName;
930
- const lineItemId = lineItemData.lineItemId;
931
- if (lineItemRecord['Target']?.['value']) {
932
- const regex = `@${(0, utils_1.findAlias)(ux_specification_types_1.UIVOCABULARY, lineItemData.oDataServiceAVT)}.`;
933
- lineItemRecord['Target']['value'] = lineItemRecord['Target']['value'].replace(regex, '@');
1005
+ function addLineItemRecordToSchema(annotationRecordParams) {
1006
+ const { schemaContext, annotationRecord, inlineDefinition, annotationPath, index, definitionName } = annotationRecordParams;
1007
+ let columnDefinition;
1008
+ if (definitionName) {
1009
+ columnDefinition =
1010
+ annotationRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */
1011
+ ? `${definitionName}Action`
1012
+ : definitionName;
1013
+ }
1014
+ const lineItemId = schemaContext.annotationId;
1015
+ if (annotationRecord['Target']?.['value']) {
1016
+ const regex = `@${(0, utils_1.findAlias)(ux_specification_types_1.UIVOCABULARY, schemaContext.oDataServiceAVT)}.`;
1017
+ annotationRecord['Target']['value'] = annotationRecord['Target']['value'].replace(regex, '@');
934
1018
  }
935
- const schemaKey = (0, StableIdHelper_1.getStableIdPartFromDataField)(lineItemRecord).replace(/\//g, exports.FIELD_SEPARATOR);
1019
+ const schemaKey = (0, StableIdHelper_1.getStableIdPartFromDataField)(annotationRecord).replace(/\//g, exports.FIELD_SEPARATOR);
936
1020
  if (schemaKey) {
937
- let columnsDefinition = lineItemDefinition;
1021
+ let columnsDefinition = inlineDefinition;
938
1022
  if (!columnsDefinition) {
939
- columnsDefinition = lineItemData.appSchema.definitions[lineItemId];
1023
+ columnsDefinition = schemaContext.appSchema.definitions[lineItemId];
940
1024
  }
941
1025
  const properties = columnsDefinition.properties;
942
1026
  const property = {
943
- description: (0, common_1.getDataFieldDescription)(lineItemRecord, lineItemData.entityType)
1027
+ description: (0, common_1.getDataFieldDescription)(annotationRecord, schemaContext.entityType)
944
1028
  };
945
- if (lineItemDefinition) {
1029
+ if (inlineDefinition) {
946
1030
  property.properties = {};
947
1031
  property.type = 'object';
948
1032
  property.isViewNode = true;
949
1033
  }
950
- else {
1034
+ else if (columnDefinition) {
951
1035
  property.$ref = utils_1.DEFINITION_LINK_PREFIX + columnDefinition;
952
1036
  }
953
- property[ux_specification_types_1.SchemaTag.annotationType] = lineItemRecord?.$Type;
954
- property[ux_specification_types_1.SchemaTag.annotationPath] = `${lineItemPath}/${index}`;
1037
+ property[ux_specification_types_1.SchemaTag.annotationType] = annotationRecord?.$Type;
1038
+ property[ux_specification_types_1.SchemaTag.annotationPath] = `${annotationPath}/${index}`;
955
1039
  property[ux_specification_types_1.SchemaTag.propertyIndex] = index;
956
- property[ux_specification_types_1.SchemaTag.dataType] = (0, common_1.determineDataType)(lineItemRecord);
1040
+ property[ux_specification_types_1.SchemaTag.dataType] = (0, common_1.determineDataType)(annotationRecord);
957
1041
  properties[schemaKey] = property;
958
- (0, common_1.addKeyToDefinition)(lineItemRecord, properties, schemaKey);
1042
+ (0, common_1.addKeyToDefinition)(annotationRecord, properties, schemaKey);
959
1043
  }
960
1044
  }
961
1045
  /**
962
- * Appends line item columns and actions to the app schema (for the list report, custom page or an object page section comprising a table).
1046
+ * Appends annotation record columns and actions to the app schema (for the list report, custom page or an object page section comprising a table).
963
1047
  *
964
- * @param {LineItemDataForSchema} data structure comprising
1048
+ * @param {AnnotationSchemaContext} data structure comprising
965
1049
  * - appSchema - the app specific schema that shall get enhanced
966
- * - lineItemAnnotation - the UI.LineItem annotation, comprising all records
1050
+ * - annotation - the UI.LineItem annotation, comprising all records
967
1051
  * - entityType - the entity type as part of the AVT ConvertedMetadata
968
1052
  * - oDataServiceAVT - complete service information, as returned by Annotation Vocabularies Tool
969
- * - lineItemId - in case of OP the parameter must be passed to distinguish the OP tables;
970
- * in case of LR or ALP 'LineItems' is passed.
1053
+ * - annotationId - in case of OP the parameter must be passed to distinguish the OP tables;
1054
+ * in case of LR or ALP 'LineItems' is passed.
971
1055
  * @param {Definition} actions - actions definition in schema, parent object
972
1056
  * @param {string} lineItemPath - annotation path to the line item
973
1057
  * @param {Definition | undefined} lineItemDefinition - line item definition
974
1058
  * @param {string} columnDefinitionName - line item definition name
975
1059
  */
976
1060
  function appendLineItemsToSchema(data, actions, lineItemPath, lineItemDefinition, columnDefinitionName = ux_specification_types_1.DefinitionName.TableColumn) {
977
- if (!data.lineItemAnnotation) {
1061
+ if (!data.annotation) {
978
1062
  return;
979
1063
  }
980
1064
  let i = 0;
981
- data.lineItemAnnotation.forEach((lineItemRecord) => {
982
- const addLineItemDefinitionsParams = {
983
- lineItemData: data,
1065
+ data.annotation.forEach((lineItemRecord) => {
1066
+ const params = {
1067
+ schemaContext: data,
984
1068
  actions,
985
- lineItemPath,
986
- lineItemRecord: lineItemRecord,
1069
+ annotationPath: lineItemPath,
1070
+ annotationRecord: lineItemRecord,
987
1071
  index: i,
988
- lineItemDefinition,
989
- columnDefinitionName
1072
+ inlineDefinition: lineItemDefinition,
1073
+ definitionName: columnDefinitionName
990
1074
  };
991
1075
  const strategy = DataFieldStrategy_1.dataFieldStrategyContext.getStrategy(lineItemRecord.$Type);
992
- strategy.addLineItemDefinition(addLineItemDefinitionsParams);
1076
+ strategy.addLineItemDefinition(params);
993
1077
  i++;
994
1078
  });
995
1079
  }
@@ -999,17 +1083,17 @@ function appendLineItemsToSchema(data, actions, lineItemPath, lineItemDefinition
999
1083
  * @param data structure comprising
1000
1084
  * - isObjectPage - indicates that the page is an object page
1001
1085
  * - appSchema - the app specific schema that shall get enhanced
1002
- * - lineItemAnnotation - the UI.LineItem annotation, comprising all records
1086
+ * - annotation - the UI.LineItem annotation, comprising all records
1003
1087
  * - entityType - the entity type as part of the AVT ConvertedMetadata
1004
1088
  * - oDataServiceAVT - complete service information, as returned by Annotation Vocabularies Tool
1005
- * - lineItemId - in case of OP the parameter must be passed to distinguish the OP tables;
1089
+ * - annotationId - in case of OP the parameter must be passed to distinguish the OP tables;
1006
1090
  * in case of LR or ALP 'LineItems' is passed.
1007
1091
  * @param columnDefinitionName - name of the column definition, i.e. TableColumn or ObjectPageTableColumn
1008
1092
  * @param customColumnDefinitionName - name of the custom column definition
1009
1093
  * @param customActionDefinitionName - name of the custom action definition
1010
1094
  */
1011
1095
  function addLineItemsTypeToSchema(data, columnDefinitionName = ux_specification_types_1.DefinitionName.TableColumn, customColumnDefinitionName = ux_specification_types_1.DefinitionName.CustomColumn, customActionDefinitionName = ux_specification_types_1.DefinitionName.CustomTableAction) {
1012
- const { actions, lineItemPath } = (0, common_1.addCommonLineItemDefinitions)(data.isObjectPage, data.appSchema, data.lineItemAnnotation, data.entityType, data.lineItemId, customColumnDefinitionName, customActionDefinitionName);
1096
+ const { actions, lineItemPath } = (0, common_1.addCommonLineItemDefinitions)(data.isObjectPage, data.appSchema, data.annotation, data.entityType, data.annotationId, customColumnDefinitionName, customActionDefinitionName);
1013
1097
  appendLineItemsToSchema(data, actions, lineItemPath, undefined, columnDefinitionName);
1014
1098
  }
1015
1099
  /**
@@ -1704,11 +1788,11 @@ function addCustomSectionDefinition(appSchema, definition, v4Page, customSection
1704
1788
  }
1705
1789
  }
1706
1790
  else {
1707
- // body custom section extensions
1791
+ // body custom section extensions — accept both fragment-based (template) and
1792
+ // embeddedComponent-based (e.g. HDM attachment reuse) sections
1708
1793
  const sections = v4Page.options?.settings?.content?.body?.sections;
1709
1794
  if (sections) {
1710
- // add extension to sections section
1711
- sortedSectionsArray = addExtensionToArray(sections, sortedSectionsArray, customSectionRef, ux_specification_types_1.TemplatePropertyName.Template, logger, isMergedSections);
1795
+ sortedSectionsArray = addExtensionToArray(sections, sortedSectionsArray, customSectionRef, [ux_specification_types_1.TemplatePropertyName.Template, ux_specification_types_1.TemplatePropertyName.EmbeddedComponent], logger, isMergedSections);
1712
1796
  }
1713
1797
  }
1714
1798
  // Adjust propertyIndex
@@ -1995,6 +2079,195 @@ function getInsertableForEntitySet(entitySet, navigationPath) {
1995
2079
  }
1996
2080
  return entitySetInsertable;
1997
2081
  }
2082
+ /**
2083
+ * Determines the default OData V4 table type for an entity set based on its metadata capabilities.
2084
+ *
2085
+ * The decision follows a strict priority order:
2086
+ * 1) Analytical tables take precedence when aggregate transformations are present and the
2087
+ * analytical requirements are satisfied.
2088
+ * 2) Hierarchical tables are selected when a recursive hierarchy is defined and analytical
2089
+ * conditions are not met.
2090
+ * 3) Responsive tables are used as a safe fallback when neither analytical nor hierarchical
2091
+ * characteristics apply.
2092
+ *
2093
+ * The evaluation of analytical suitability differs between CAP and non-CAP services:
2094
+ * - **CAP services**: Require both service-level AND entity-level aggregation annotations.
2095
+ * - **Non-CAP services**: Service-level aggregation annotations are sufficient.
2096
+ *
2097
+ * @param entitySet The entity set whose annotations are evaluated.
2098
+ * @param isCapService Indicates whether the service is a CAP service, affecting analytical requirements.
2099
+ * @returns The default {@link TableTypeV4} to be used for the entity set.
2100
+ */
2101
+ function getDefaultTableType(entitySet, isCapService) {
2102
+ if (!entitySet) {
2103
+ // Fallback when entitySet is not provided
2104
+ return FALLBACK_TABLE_TYPE;
2105
+ }
2106
+ const { hasRecursiveHierarchyForEntitySet, hasAggregateTransformations, hasAggregateTransformationsForEntitySet } = (0, project_access_1.getTableCapabilitiesByEntitySet)(entitySet);
2107
+ // Check for analytical capabilities first (highest priority)
2108
+ // Requires service-level aggregate transformations (hasAggregateTransformations) as a prerequisite
2109
+ // For CAP services: both service-level and entity-level transformations must be present
2110
+ // For non-CAP services: service-level transformations alone are sufficient
2111
+ if (hasAggregateTransformations && (hasAggregateTransformationsForEntitySet || !isCapService)) {
2112
+ return v4_1.TableTypeV4.AnalyticalTable;
2113
+ }
2114
+ // Check for hierarchical data only (no analytical data or analytical requirements not met)
2115
+ if (hasRecursiveHierarchyForEntitySet) {
2116
+ return v4_1.TableTypeV4.TreeTable;
2117
+ }
2118
+ // Default for standard entity sets without analytical or hierarchical capabilities
2119
+ return v4_1.TableTypeV4.ResponsiveTable;
2120
+ }
2121
+ /**
2122
+ * Determines the available table type options and recommended default type for an entity set
2123
+ * based on its metadata capabilities.
2124
+ *
2125
+ * This function analyzes the entity set's capabilities and returns both the list of suitable
2126
+ * table types and the recommended default type. The available options are restricted based
2127
+ * on the detected service characteristics:
2128
+ *
2129
+ * - **Analytical services**: AnalyticalTable, ResponsiveTable, GridTable (default: AnalyticalTable).
2130
+ * - **Hierarchical services**: TreeTable, ResponsiveTable, GridTable (default: TreeTable).
2131
+ * - **Standard services**: ResponsiveTable, GridTable (default: ResponsiveTable).
2132
+ *
2133
+ * **Version gating**: Capability-based restrictions are only applied for UI5 1.142.0+.
2134
+ * For earlier versions, all table types are available (ResponsiveTable, GridTable, AnalyticalTable, TreeTable)
2135
+ * with ResponsiveTable as the default.
2136
+ *
2137
+ * @param entitySet The entity set whose capabilities determine the available table types.
2138
+ * @param isCapService Indicates whether the service is a CAP service, affecting analytical
2139
+ * capability detection.
2140
+ * @param minUI5Version The minimum UI5 version from manifest. Capability-based restrictions
2141
+ * require UI5 1.142.0+.
2142
+ * @returns An object containing:
2143
+ * - `options`: Array of suitable {@link TableTypeV4} values for the entity set
2144
+ * - `defaultType`: The recommended {@link TableTypeV4} as the default choice
2145
+ * @example
2146
+ * // For an entity set with analytical capabilities (UI5 1.142+)
2147
+ * const result = getTableTypeOptions(analyticalEntitySet, true, '1.142.0');
2148
+ * // Returns: { options: [AnalyticalTable, ResponsiveTable, GridTable], defaultType: AnalyticalTable }
2149
+ *
2150
+ * // For the same entity set on UI5 1.120 (all types available, no restrictions)
2151
+ * const result = getTableTypeOptions(analyticalEntitySet, true, '1.120.0');
2152
+ * // Returns: { options: [ResponsiveTable, GridTable, AnalyticalTable, TreeTable], defaultType: ResponsiveTable }
2153
+ */
2154
+ function getTableTypeOptions(entitySet, isCapService, minUI5Version) {
2155
+ // Capability-based restrictions are only available in UI5 1.142.0+
2156
+ // For earlier versions, all table types are available
2157
+ if (minUI5Version && !(0, utils_3.compareUI5Versions)(minUI5Version, exports.MIN_UI5_VERSION_FOR_TABLE_TYPE_RESTRICTIONS)) {
2158
+ return LEGACY_VERSION_TABLE_TYPE_OPTIONS;
2159
+ }
2160
+ const detectedType = getDefaultTableType(entitySet, isCapService);
2161
+ return TABLE_TYPE_OPTIONS_MAP[detectedType];
2162
+ }
2163
+ /**
2164
+ * Creates a virtual EntitySet for capability detection when the entitySet.entityType
2165
+ * doesn't match the actual target EntityType (e.g., for contained navigation).
2166
+ *
2167
+ * This is needed for contained navigation (ContainsTarget=true) where there is no
2168
+ * physical EntitySet in the metadata, but the target EntityType has important
2169
+ * annotations like RecursiveHierarchy.
2170
+ *
2171
+ * @param entitySet - The base entity set (may have wrong entityType for contained navigation)
2172
+ * @param targetEntityType - The actual entity type with correct annotations
2173
+ * @returns EntitySet with correct entityType for capability detection, or original if types match
2174
+ * @example
2175
+ * // For contained navigation "/ZZZC_FINANCIAL_TREE/Set"
2176
+ * const entitySetForCapabilities = ensureEntitySetWithCorrectType(
2177
+ * entitySet, // ZZZC_FINANCIAL_TREE (type: Parameters)
2178
+ * lineItemFacet.entityType // ZZZC_FINANCIAL_TREEType (with RecursiveHierarchy)
2179
+ * );
2180
+ * const options = getTableTypeOptions(entitySetForCapabilities, isCapService);
2181
+ */
2182
+ function ensureEntitySetWithCorrectType(entitySet, targetEntityType) {
2183
+ if (!entitySet || !targetEntityType) {
2184
+ return entitySet;
2185
+ }
2186
+ // If entityType already matches, return as-is
2187
+ if (entitySet.entityType === targetEntityType) {
2188
+ return entitySet;
2189
+ }
2190
+ // Create virtual EntitySet with correct entityType and its annotations
2191
+ return {
2192
+ ...entitySet,
2193
+ entityType: targetEntityType,
2194
+ annotations: targetEntityType.annotations || entitySet.annotations
2195
+ };
2196
+ }
2197
+ /**
2198
+ * Returns the appropriate fallback table type options based on UI5 version.
2199
+ * For UI5 < 1.142.0, returns all table types (legacy behavior).
2200
+ * For UI5 >= 1.142.0, returns restricted fallback options.
2201
+ *
2202
+ * @param minUI5Version - Optional minimum UI5 version
2203
+ * @returns Table type options with all types for legacy versions, or restricted options for modern versions
2204
+ */
2205
+ function getFallbackTableTypeOptions(minUI5Version) {
2206
+ if (minUI5Version && !(0, utils_3.compareUI5Versions)(minUI5Version, exports.MIN_UI5_VERSION_FOR_TABLE_TYPE_RESTRICTIONS)) {
2207
+ return LEGACY_VERSION_TABLE_TYPE_OPTIONS;
2208
+ }
2209
+ return FALLBACK_TABLE_TYPE_OPTIONS;
2210
+ }
2211
+ /**
2212
+ * Determines table type options based on context path by resolving the entity set internally.
2213
+ *
2214
+ * This is a wrapper function that handles the complexity of entity set resolution from annotation files.
2215
+ * It parses the annotation files, resolves the entity set from the context path, and returns the
2216
+ * appropriate table type options.
2217
+ *
2218
+ * **Version gating**: Capability-based restrictions are only applied for UI5 1.142.0+.
2219
+ * For earlier versions, all table types are available.
2220
+ *
2221
+ * @param annotationFiles - Array of annotation files containing metadata
2222
+ * @param contextPath - Context path or navigation property. Can be:
2223
+ * - Full path starting with "/" (e.g., "/Travel", "/Travel/to_Booking")
2224
+ * - Navigation property without "/" (e.g., "to_Booking") - requires entitySetName
2225
+ * - Entity set name (e.g., "Travel")
2226
+ * @param entitySetName - Optional entity set name. Required when contextPath is a navigation property without "/"
2227
+ * @param isCapService - Indicates whether the service is a CAP service
2228
+ * @param logger - Optional logger for debugging
2229
+ * @param minUI5Version - Optional minimum UI5 version. Capability-based restrictions require UI5 1.142.0+
2230
+ * @returns An object containing:
2231
+ * - `options`: Array of suitable {@link TableTypeV4} values for the entity set
2232
+ * - `defaultType`: The recommended {@link TableTypeV4} as the default choice
2233
+ * @example
2234
+ * // For an analytical service with full path (UI5 1.142+)
2235
+ * const result = getTableTypeOptionsByContext(annotationFiles, "/Travel/to_Booking", undefined, true, logger, '1.142.0');
2236
+ * // Returns: { options: [AnalyticalTable, ResponsiveTable, GridTable], defaultType: AnalyticalTable }
2237
+ * @example
2238
+ * // For navigation property with entity set name (UI5 1.120)
2239
+ * const result = getTableTypeOptionsByContext(annotationFiles, "to_Booking", "Travel", true, logger, '1.120.0');
2240
+ * // Returns: { options: [ResponsiveTable, GridTable, AnalyticalTable, TreeTable], defaultType: ResponsiveTable }
2241
+ */
2242
+ function getTableTypeOptionsByContext(annotationFiles, contextPath, entitySetName, isCapService, logger, minUI5Version) {
2243
+ try {
2244
+ // 1. Parse and convert annotation files to ConvertedMetadata
2245
+ const convertedMetadata = (0, utils_1.parseAndMergeAndConvert)(annotationFiles, logger);
2246
+ if (!convertedMetadata) {
2247
+ logger?.info('Could not parse annotation files, returning default table type options');
2248
+ return getFallbackTableTypeOptions(minUI5Version);
2249
+ }
2250
+ // 2. Build full context path if needed
2251
+ // If contextPath doesn't start with "/" and entitySetName is provided, combine them
2252
+ let fullContextPath = contextPath;
2253
+ if (entitySetName && contextPath && !contextPath.startsWith('/')) {
2254
+ fullContextPath = `/${entitySetName}/${contextPath}`;
2255
+ }
2256
+ // 3. Resolve entity set from context path
2257
+ const { entitySet } = (0, importProject_1.getEntityTypeEntitySetFromContextPath)(convertedMetadata, fullContextPath, entitySetName, logger);
2258
+ if (!entitySet) {
2259
+ logger?.info(`Could not resolve entity set for context path: ${fullContextPath}, returning default table type options`);
2260
+ return getFallbackTableTypeOptions(minUI5Version);
2261
+ }
2262
+ // 4. Call existing getTableTypeOptions with resolved entitySet
2263
+ return getTableTypeOptions(entitySet, isCapService, minUI5Version);
2264
+ }
2265
+ catch (error) {
2266
+ logger?.error('Error in getTableTypeOptionsByContext', error);
2267
+ // Fallback to default options on error
2268
+ return getFallbackTableTypeOptions(minUI5Version);
2269
+ }
2270
+ }
1998
2271
  /**
1999
2272
  * Returns the manifest path for a given page based on the provided path parameters.
2000
2273
  *