@sap/ux-specification 1.90.21 → 1.90.26

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 (301) hide show
  1. package/CHANGELOG.md +97 -1
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
  3. package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
  4. package/dist/documentation/v2/v2-ListReport.html +1 -1
  5. package/dist/documentation/v2/v2-ObjectPage.html +1 -1
  6. package/dist/documentation/v2/v2-OverviewPage.html +1 -1
  7. package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
  8. package/dist/documentation/v4/v4-ListReport.html +1 -1
  9. package/dist/documentation/v4/v4-ObjectPage.html +1 -1
  10. package/dist/index-min.js +1 -1
  11. package/dist/schemas/v2/ApplicationV2.json +11 -11
  12. package/dist/schemas/v4/ApplicationV4.json +9 -5
  13. package/dist/schemas/v4/ListReportConfig.json +629 -183
  14. package/dist/schemas/v4/ObjectPageConfig.json +36 -0
  15. package/dist/scripts/extractDocu.js.map +1 -1
  16. package/dist/scripts/runDocu.js +10 -40
  17. package/dist/scripts/runDocu.js.map +1 -1
  18. package/dist/scripts/spec.js.map +1 -1
  19. package/dist/scripts/to-json-schema.js.map +1 -1
  20. package/dist/specification/v2/index-min.js +1 -1
  21. package/dist/specification/v4/index-min.js +1 -1
  22. package/dist/src/api.d.ts +2 -2
  23. package/dist/src/api.js +11 -11
  24. package/dist/src/api.js.map +1 -1
  25. package/dist/src/apiTypes.d.ts +16 -19
  26. package/dist/src/apiTypes.js +0 -2
  27. package/dist/src/apiTypes.js.map +1 -1
  28. package/dist/src/extensionLogger.d.ts +1 -1
  29. package/dist/src/project.d.ts +1 -1
  30. package/dist/src/project.js +11 -3
  31. package/dist/src/project.js.map +1 -1
  32. package/dist/src/specification/common/Application.d.ts +24 -4
  33. package/dist/src/specification/common/page.d.ts +1 -1
  34. package/dist/src/specification/common/webapp/manifest/Manifest.d.ts +6 -6
  35. package/dist/src/specification/common/webapp/manifest/sapUi5.d.ts +1 -1
  36. package/dist/src/specification/schemaAccess.d.ts +1 -1
  37. package/dist/src/specification/schemaAccess.js +1 -2
  38. package/dist/src/specification/schemaAccess.js.map +1 -1
  39. package/dist/src/specification/v2/ApplicationV2.d.ts +3 -17
  40. package/dist/src/specification/v2/controls/Facets.d.ts +1 -1
  41. package/dist/src/specification/v2/controls/Footer.d.ts +2 -2
  42. package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +1 -1
  43. package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +1 -1
  44. package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +2 -2
  45. package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +2 -2
  46. package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +1 -1
  47. package/dist/src/specification/v2/controls/Table.d.ts +3 -3
  48. package/dist/src/specification/v2/controls/ToolBar.d.ts +1 -1
  49. package/dist/src/specification/v2/page.d.ts +1 -1
  50. package/dist/src/specification/v2/pages/AnalyticalListPageConfig.d.ts +4 -4
  51. package/dist/src/specification/v2/pages/ListReportConfig.d.ts +2 -2
  52. package/dist/src/specification/v2/pages/ObjectPageConfig.d.ts +3 -3
  53. package/dist/src/specification/v2/pages/OverviewPageConfig.d.ts +3 -3
  54. package/dist/src/specification/v2/webapp/manifest/sapUi5.d.ts +2 -2
  55. package/dist/src/specification/v2/webapp/manifest/sapUi5.js +0 -1
  56. package/dist/src/specification/v2/webapp/manifest/sapUi5.js.map +1 -1
  57. package/dist/src/specification/v2/webapp/manifest/sapUiPageV2.d.ts +2 -2
  58. package/dist/src/specification/v4/ApplicationV4.d.ts +4 -14
  59. package/dist/src/specification/v4/controls/ObjectPageHeader.d.ts +1 -1
  60. package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +24 -3
  61. package/dist/src/specification/v4/controls/ObjectPageSection.js.map +1 -1
  62. package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +3 -3
  63. package/dist/src/specification/v4/controls/ObjectPageToolBar.d.ts +1 -1
  64. package/dist/src/specification/v4/controls/Table.d.ts +170 -25
  65. package/dist/src/specification/v4/controls/Table.js +6 -0
  66. package/dist/src/specification/v4/controls/Table.js.map +1 -1
  67. package/dist/src/specification/v4/controls/ToolBar.d.ts +26 -1
  68. package/dist/src/specification/v4/page.d.ts +2 -2
  69. package/dist/src/specification/v4/pages/ListReportConfig.d.ts +22 -3
  70. package/dist/src/specification/v4/pages/ObjectPageConfig.d.ts +2 -2
  71. package/dist/src/specification/v4/pages/ObjectPageConfig.js.map +1 -1
  72. package/dist/src/specification/v4/pages/index.d.ts +0 -1
  73. package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +77 -0
  74. package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js.map +1 -1
  75. package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +12 -3
  76. package/dist/src/specification/v4/webapp/manifest/sapUi5.js.map +1 -1
  77. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.d.ts +21 -1
  78. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
  79. package/dist/src/sync/common/appProvider.d.ts +6 -5
  80. package/dist/src/sync/common/appProvider.js.map +1 -1
  81. package/dist/src/sync/common/decoration/control.d.ts +1 -1
  82. package/dist/src/sync/common/decoration/control.js +27 -22
  83. package/dist/src/sync/common/decoration/control.js.map +1 -1
  84. package/dist/src/sync/common/decoration/decorators.d.ts +1 -1
  85. package/dist/src/sync/common/decoration/decorators.js.map +1 -1
  86. package/dist/src/sync/common/decoration/factory.d.ts +3 -3
  87. package/dist/src/sync/common/decoration/flex.d.ts +3 -3
  88. package/dist/src/sync/common/flexUtils.d.ts +4 -4
  89. package/dist/src/sync/common/flexUtils.js.map +1 -1
  90. package/dist/src/sync/common/generate/objectPage.d.ts +9 -7
  91. package/dist/src/sync/common/generate/objectPage.js +69 -73
  92. package/dist/src/sync/common/generate/objectPage.js.map +1 -1
  93. package/dist/src/sync/common/generate/utils.d.ts +52 -19
  94. package/dist/src/sync/common/generate/utils.js +127 -70
  95. package/dist/src/sync/common/generate/utils.js.map +1 -1
  96. package/dist/src/sync/common/import/utils.d.ts +4 -3
  97. package/dist/src/sync/common/import/utils.js +3 -2
  98. package/dist/src/sync/common/import/utils.js.map +1 -1
  99. package/dist/src/sync/common/importProject.d.ts +4 -4
  100. package/dist/src/sync/common/importProject.js +33 -41
  101. package/dist/src/sync/common/importProject.js.map +1 -1
  102. package/dist/src/sync/common/types.d.ts +110 -13
  103. package/dist/src/sync/common/types.js +107 -7
  104. package/dist/src/sync/common/types.js.map +1 -1
  105. package/dist/src/sync/common/utils.d.ts +23 -15
  106. package/dist/src/sync/common/utils.js +138 -72
  107. package/dist/src/sync/common/utils.js.map +1 -1
  108. package/dist/src/sync/i18n.d.ts +1 -1
  109. package/dist/src/sync/v2/application.d.ts +2 -2
  110. package/dist/src/sync/v2/application.js.map +1 -1
  111. package/dist/src/sync/v2/export/controls/Action.d.ts +1 -1
  112. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts +1 -1
  113. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +1 -1
  114. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
  115. package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.d.ts +1 -1
  116. package/dist/src/sync/v2/export/controls/Card.d.ts +1 -1
  117. package/dist/src/sync/v2/export/controls/Field.d.ts +1 -1
  118. package/dist/src/sync/v2/export/controls/FilterBar.d.ts +2 -1
  119. package/dist/src/sync/v2/export/controls/FormAction.d.ts +1 -1
  120. package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
  121. package/dist/src/sync/v2/export/controls/Fragment.d.ts +5 -11
  122. package/dist/src/sync/v2/export/controls/Fragment.js +110 -34
  123. package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
  124. package/dist/src/sync/v2/export/controls/ObjectPageChart.d.ts +1 -1
  125. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.d.ts +3 -3
  126. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
  127. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +1 -1
  128. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
  129. package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +1 -1
  130. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +1 -1
  131. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
  132. package/dist/src/sync/v2/export/controls/ObjectPageLayout.d.ts +1 -1
  133. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +2 -2
  134. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +1 -1
  135. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
  136. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +3 -3
  137. package/dist/src/sync/v2/export/controls/ObjectPageTable.js +1 -1
  138. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
  139. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +1 -1
  140. package/dist/src/sync/v2/export/controls/Table.d.ts +4 -2
  141. package/dist/src/sync/v2/export/controls/Table.js +89 -47
  142. package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
  143. package/dist/src/sync/v2/export/controls/TableColumn.d.ts +2 -2
  144. package/dist/src/sync/v2/export/controls/ToolBar.d.ts +1 -1
  145. package/dist/src/sync/v2/export/export.d.ts +3 -4
  146. package/dist/src/sync/v2/export/export.js +222 -160
  147. package/dist/src/sync/v2/export/export.js.map +1 -1
  148. package/dist/src/sync/v2/export/exportPage.d.ts +2 -2
  149. package/dist/src/sync/v2/export/exportPage.js +4 -11
  150. package/dist/src/sync/v2/export/exportPage.js.map +1 -1
  151. package/dist/src/sync/v2/export/factory.d.ts +2 -1
  152. package/dist/src/sync/v2/export/factory.js.map +1 -1
  153. package/dist/src/sync/v2/export/manifest.d.ts +23 -1
  154. package/dist/src/sync/v2/export/manifest.js +77 -35
  155. package/dist/src/sync/v2/export/manifest.js.map +1 -1
  156. package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts +4 -4
  157. package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
  158. package/dist/src/sync/v2/export/pages/ListReport.d.ts +2 -2
  159. package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
  160. package/dist/src/sync/v2/export/pages/ObjectPage.d.ts +3 -3
  161. package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +3 -3
  162. package/dist/src/sync/v2/export/pages/OverviewPage.js +20 -15
  163. package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
  164. package/dist/src/sync/v2/export/view-controller-generator.d.ts +2 -2
  165. package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
  166. package/dist/src/sync/v2/generate/analyticalListReport.d.ts +1 -1
  167. package/dist/src/sync/v2/generate/analyticalListReport.js +27 -36
  168. package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  169. package/dist/src/sync/v2/generate/generate.d.ts +2 -2
  170. package/dist/src/sync/v2/generate/generate.js +3 -0
  171. package/dist/src/sync/v2/generate/generate.js.map +1 -1
  172. package/dist/src/sync/v2/generate/listReport.d.ts +7 -4
  173. package/dist/src/sync/v2/generate/listReport.js +38 -36
  174. package/dist/src/sync/v2/generate/listReport.js.map +1 -1
  175. package/dist/src/sync/v2/generate/objectPage.d.ts +1 -1
  176. package/dist/src/sync/v2/generate/objectPage.js +102 -100
  177. package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
  178. package/dist/src/sync/v2/generate/overviewPage.d.ts +1 -1
  179. package/dist/src/sync/v2/generate/overviewPage.js.map +1 -1
  180. package/dist/src/sync/v2/generate/utils.d.ts +8 -7
  181. package/dist/src/sync/v2/generate/utils.js +73 -69
  182. package/dist/src/sync/v2/generate/utils.js.map +1 -1
  183. package/dist/src/sync/v2/import/app/appProvider.d.ts +13 -4
  184. package/dist/src/sync/v2/import/app/appProvider.js +36 -13
  185. package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
  186. package/dist/src/sync/v2/import/app/ovpProvider.d.ts +3 -3
  187. package/dist/src/sync/v2/import/app/ovpProvider.js +1 -1
  188. package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
  189. package/dist/src/sync/v2/import/common/index.d.ts +6 -5
  190. package/dist/src/sync/v2/import/common/index.js +9 -22
  191. package/dist/src/sync/v2/import/common/index.js.map +1 -1
  192. package/dist/src/sync/v2/import/controls/table.d.ts +1 -1
  193. package/dist/src/sync/v2/import/controls/table.js +1 -1
  194. package/dist/src/sync/v2/import/controls/table.js.map +1 -1
  195. package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts +2 -2
  196. package/dist/src/sync/v2/import/pages/analyticalListPage.js +1 -9
  197. package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
  198. package/dist/src/sync/v2/import/pages/listReport.d.ts +2 -2
  199. package/dist/src/sync/v2/import/pages/objectPage.d.ts +1 -1
  200. package/dist/src/sync/v2/import/pages/objectPage.js +36 -44
  201. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
  202. package/dist/src/sync/v2/import/pages/overviewPage.d.ts +2 -2
  203. package/dist/src/sync/v2/import/pages/overviewPage.js +1 -1
  204. package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -1
  205. package/dist/src/sync/v2/import/utils.d.ts +3 -2
  206. package/dist/src/sync/v2/import/utils.js +16 -2
  207. package/dist/src/sync/v2/import/utils.js.map +1 -1
  208. package/dist/src/sync/v2/types.d.ts +7 -7
  209. package/dist/src/sync/v4/application.d.ts +28 -12
  210. package/dist/src/sync/v4/application.js +85 -15
  211. package/dist/src/sync/v4/application.js.map +1 -1
  212. package/dist/src/sync/v4/export/controls/FilterBar.d.ts +1 -1
  213. package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +2 -1
  214. package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
  215. package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts +1 -1
  216. package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts +1 -1
  217. package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js.map +1 -1
  218. package/dist/src/sync/v4/export/controls/ObjectPageLayout.d.ts +1 -1
  219. package/dist/src/sync/v4/export/controls/ObjectPageTable.d.ts +1 -1
  220. package/dist/src/sync/v4/export/controls/ObjectPageTable.js +6 -18
  221. package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
  222. package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +1 -1
  223. package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +1 -1
  224. package/dist/src/sync/v4/export/controls/Table.d.ts +131 -10
  225. package/dist/src/sync/v4/export/controls/Table.js +477 -75
  226. package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
  227. package/dist/src/sync/v4/export/controls/TableColumn.d.ts +52 -1
  228. package/dist/src/sync/v4/export/controls/TableColumn.js +248 -2
  229. package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  230. package/dist/src/sync/v4/export/controls/ToolBar.d.ts +1 -1
  231. package/dist/src/sync/v4/export/controls/ToolBarAction.d.ts +4 -1
  232. package/dist/src/sync/v4/export/controls/ToolBarAction.js +10 -0
  233. package/dist/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
  234. package/dist/src/sync/v4/export/export.d.ts +2 -2
  235. package/dist/src/sync/v4/export/export.js +465 -96
  236. package/dist/src/sync/v4/export/export.js.map +1 -1
  237. package/dist/src/sync/v4/export/factory.d.ts +2 -1
  238. package/dist/src/sync/v4/export/factory.js.map +1 -1
  239. package/dist/src/sync/v4/export/flexibleColumnLayout.d.ts +1 -1
  240. package/dist/src/sync/v4/export/flexibleColumnLayout.js.map +1 -1
  241. package/dist/src/sync/v4/export/manifest.d.ts +1 -1
  242. package/dist/src/sync/v4/export/manifest.js.map +1 -1
  243. package/dist/src/sync/v4/export/pages/ListReport.d.ts +9 -3
  244. package/dist/src/sync/v4/export/pages/ListReport.js +49 -0
  245. package/dist/src/sync/v4/export/pages/ListReport.js.map +1 -1
  246. package/dist/src/sync/v4/export/pages/ObjectPage.d.ts +2 -2
  247. package/dist/src/sync/v4/export/pages/ObjectPage.js +3 -2
  248. package/dist/src/sync/v4/export/pages/ObjectPage.js.map +1 -1
  249. package/dist/src/sync/v4/export/pages/index.d.ts +0 -1
  250. package/dist/src/sync/v4/export/pages/index.js +0 -1
  251. package/dist/src/sync/v4/export/pages/index.js.map +1 -1
  252. package/dist/src/sync/v4/export/types.d.ts +8 -6
  253. package/dist/src/sync/v4/export/utils.d.ts +1 -1
  254. package/dist/src/sync/v4/generate/generate.d.ts +5 -4
  255. package/dist/src/sync/v4/generate/generate.js +6 -3
  256. package/dist/src/sync/v4/generate/generate.js.map +1 -1
  257. package/dist/src/sync/v4/generate/listReport.d.ts +2 -4
  258. package/dist/src/sync/v4/generate/listReport.js +450 -36
  259. package/dist/src/sync/v4/generate/listReport.js.map +1 -1
  260. package/dist/src/sync/v4/generate/objectPage.d.ts +1 -1
  261. package/dist/src/sync/v4/generate/objectPage.js +302 -144
  262. package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
  263. package/dist/src/sync/v4/import/app/appProvider.d.ts +6 -5
  264. package/dist/src/sync/v4/import/app/appProvider.js +78 -56
  265. package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
  266. package/dist/src/sync/v4/import/fragment.d.ts +2 -2
  267. package/dist/src/sync/v4/import/fragment.js.map +1 -1
  268. package/dist/src/sync/v4/import/index.d.ts +0 -1
  269. package/dist/src/sync/v4/import/index.js +0 -1
  270. package/dist/src/sync/v4/import/index.js.map +1 -1
  271. package/dist/src/sync/v4/import/pages/listReport.d.ts +8 -7
  272. package/dist/src/sync/v4/import/pages/listReport.js +120 -29
  273. package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
  274. package/dist/src/sync/v4/import/pages/objectPage.d.ts +15 -2
  275. package/dist/src/sync/v4/import/pages/objectPage.js +69 -40
  276. package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
  277. package/dist/src/sync/v4/import/utils.d.ts +4 -3
  278. package/dist/src/sync/v4/import/utils.js +2 -2
  279. package/dist/src/sync/v4/import/utils.js.map +1 -1
  280. package/dist/src/sync/v4/types.d.ts +4 -2
  281. package/dist/src/sync/v4/utils/StableIdHelper.js +13 -10
  282. package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
  283. package/dist/src/sync/v4/utils/utils.d.ts +18 -12
  284. package/dist/src/sync/v4/utils/utils.js +77 -30
  285. package/dist/src/sync/v4/utils/utils.js.map +1 -1
  286. package/dist/test/test-data/flexChange/v2/stta.prod.man/index.d.ts +1 -1
  287. package/dist/test/test-projects/index.d.ts +1 -1
  288. package/dist/test/test-utils/utils.d.ts +5 -4
  289. package/dist/test/unit/export/manifest.test.d.ts +1 -0
  290. package/package.json +13 -10
  291. package/dist/documentation/v4/v4-AnalyticalListPage.html +0 -49
  292. package/dist/schemas/v4/AnalyticalListPageConfig.json +0 -392
  293. package/dist/src/specification/v4/pages/AnalyticalListPageConfig.d.ts +0 -13
  294. package/dist/src/specification/v4/pages/AnalyticalListPageConfig.js +0 -3
  295. package/dist/src/specification/v4/pages/AnalyticalListPageConfig.js.map +0 -1
  296. package/dist/src/sync/v4/export/pages/AnalyticalListPage.d.ts +0 -8
  297. package/dist/src/sync/v4/export/pages/AnalyticalListPage.js +0 -38
  298. package/dist/src/sync/v4/export/pages/AnalyticalListPage.js.map +0 -1
  299. package/dist/src/sync/v4/import/pages/analyticalListPage.d.ts +0 -11
  300. package/dist/src/sync/v4/import/pages/analyticalListPage.js +0 -60
  301. package/dist/src/sync/v4/import/pages/analyticalListPage.js.map +0 -1
@@ -56,82 +56,205 @@ function exportFlexChange(syncRule, transferParameters, ids, breadcrumbs, config
56
56
  const flexChange = common_1.fillFlexChangeContent(configObject, syncRule, transferParameters.ui5Version, key, controlId);
57
57
  transferParameters.exportResults.flexChanges.push(syncRule.flex.createFlexChange(flexChange, transferParameters.exportResults.manifest));
58
58
  }
59
- function determineTargetAnnotation(ids, title) {
60
- let targetAnnotation = '', targetAnnotationEncoded = '', custom = false;
61
- if (ids[0] === 'sections') {
62
- if (ids[1] === 'custom' && ids[2] !== ids[ids.length - 1]) {
63
- custom = true;
64
- targetAnnotationEncoded = ids[2];
65
- targetAnnotation = targetAnnotationEncoded.replace(/::/g, '/');
59
+ function determineTargetAnnotationOfTable(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject) {
60
+ var _a, _b, _c;
61
+ if (ids.length > 1 && transferParameters.templateType === utils_1.TemplateType.AnalyticalListPageV4) {
62
+ const annoPath = (_a = transferParameters.appSchema.definitions[v4_1.DefinitionName.ALPTable]) === null || _a === void 0 ? void 0 : _a[v4_1.SchemaTag.annotationPath];
63
+ targetAnnotationEncoded = targetAnnotation = annoPath && annoPath.substr(annoPath.lastIndexOf('@'));
64
+ }
65
+ else if ((_b = configObject.table) === null || _b === void 0 ? void 0 : _b.annotationPath) {
66
+ //view definition
67
+ targetAnnotationEncoded = targetAnnotation = `@${configObject.table.annotationPath}`;
68
+ }
69
+ else if (ids[0] === v4_1.PropertyName.table && transferParameters.config[v4_1.PropertyName.defaultTemplateAnnotationPath]) {
70
+ const annotationPath = (_c = transferParameters.appSchema.definitions[v4_1.DefinitionName.TableSPV]) === null || _c === void 0 ? void 0 : _c[v4_1.SchemaTag.annotationPath];
71
+ if (annotationPath) {
72
+ const annotationPathArray = annotationPath.split('/');
73
+ targetAnnotationEncoded = targetAnnotation = annotationPathArray[annotationPathArray.length - 1];
66
74
  }
67
- else {
68
- targetAnnotationEncoded = ids[1] && ids[1].replace(/\//g, '::');
69
- targetAnnotation = targetAnnotationEncoded.replace(/::/g, '/');
75
+ }
76
+ return { targetAnnotationEncoded, targetAnnotation };
77
+ }
78
+ function determineTargetAnnotationOfChart(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject) {
79
+ var _a, _b;
80
+ if (ids.length > 1) {
81
+ const annoPath = (_a = transferParameters.appSchema.definitions[v4_1.DefinitionName.ALPChart]) === null || _a === void 0 ? void 0 : _a[v4_1.SchemaTag.annotationPath];
82
+ targetAnnotationEncoded = targetAnnotation = annoPath && annoPath.substr(annoPath.lastIndexOf('@'));
83
+ }
84
+ else {
85
+ //chart level
86
+ targetAnnotationEncoded = targetAnnotation = `@${(_b = configObject.chart) === null || _b === void 0 ? void 0 : _b.annotationPath}`;
87
+ }
88
+ return { targetAnnotationEncoded, targetAnnotation };
89
+ }
90
+ function determineTargetAnnotationOfViews(transferParameters, ids, targetAnnotation, targetAnnotationEncoded) {
91
+ var _a, _b;
92
+ const parentDefinition = (_a = transferParameters.appSchema.definitions['MultiTableModeV4']) === null || _a === void 0 ? void 0 : _a.properties[ids[2]];
93
+ if (parentDefinition) {
94
+ if (ids.length === 3) {
95
+ //the parent definition comprises the annotation of the visualization of the (Selection)PresentationVariant.
96
+ targetAnnotation = targetAnnotationEncoded =
97
+ parentDefinition[v4_1.SchemaTag.annotationPath] &&
98
+ parentDefinition[v4_1.SchemaTag.annotationPath].substr(parentDefinition[v4_1.SchemaTag.annotationPath].lastIndexOf('@'));
70
99
  }
100
+ else if (ids.length > 3) {
101
+ //the own definitio comprises the lineItem or chart annotation from he visualization
102
+ const ownDefinitionName = (_b = parentDefinition.$ref) === null || _b === void 0 ? void 0 : _b.split(utils_1.DEFINITION_LINK_PREFIX)[1];
103
+ const ownDefinition = ownDefinitionName && transferParameters.appSchema.definitions[ownDefinitionName];
104
+ const annotation = (ownDefinition === null || ownDefinition === void 0 ? void 0 : ownDefinition[v4_1.SchemaTag.annotationPath]) &&
105
+ ownDefinition[v4_1.SchemaTag.annotationPath].substr(ownDefinition[v4_1.SchemaTag.annotationPath].lastIndexOf('@'));
106
+ targetAnnotation = targetAnnotationEncoded = ownDefinition['navigationProperty']
107
+ ? `${ownDefinition['navigationProperty']}/${annotation}`
108
+ : annotation;
109
+ }
110
+ }
111
+ return { targetAnnotation, targetAnnotationEncoded };
112
+ }
113
+ function determineTargetAnnotationOfSections(ids, custom, targetAnnotationEncoded, targetAnnotation) {
114
+ if (ids[1] === 'custom' && ids[2] !== ids[ids.length - 1]) {
115
+ custom = true;
116
+ targetAnnotationEncoded = ids[2];
117
+ targetAnnotation = targetAnnotationEncoded && targetAnnotationEncoded.replace(/::/g, '/');
118
+ }
119
+ else {
120
+ targetAnnotationEncoded = ids[1] && ids[1].replace(/\//g, '::');
121
+ targetAnnotation = targetAnnotationEncoded && targetAnnotationEncoded.replace(/::/g, '/');
122
+ }
123
+ return { custom, targetAnnotationEncoded, targetAnnotation };
124
+ }
125
+ /**
126
+ * Determines the target annotation that is relevant for the sync rule
127
+ * @param {string[]} ids - list of ids of parent elements
128
+ * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
129
+ * @param { [key: string]: any } configObject - the given config.json, to be exported
130
+ * @returns { targetAnnotationEncoded, targetAnnotation, custom }
131
+ */
132
+ function determineTargetAnnotation(ids, transferParameters, configObject) {
133
+ let targetAnnotation, targetAnnotationEncoded, custom = false;
134
+ if (ids[0] === v4_1.PropertyName.table && ids[1] !== v4_1.PropertyName.views) {
135
+ ({ targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfTable(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject));
136
+ }
137
+ else if (ids[0] === v4_1.PropertyName.chart && transferParameters.templateType === utils_1.TemplateType.AnalyticalListPageV4) {
138
+ ({ targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfChart(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject));
71
139
  }
72
- if (ids[1] === 'sections') {
140
+ else if (ids[0] === v4_1.PropertyName.sections) {
141
+ ({ custom, targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfSections(ids, custom, targetAnnotationEncoded, targetAnnotation));
142
+ }
143
+ else if (ids[1] === v4_1.PropertyName.sections) {
73
144
  //header sections
74
- targetAnnotation = targetAnnotationEncoded =
75
- title && title.indexOf(v4_1.FacetTitlePrefix) > -1
76
- ? title.split(v4_1.FacetTitlePrefix)[1]
77
- : targetAnnotationEncoded.replace(/::/g, '/');
145
+ if (transferParameters.title && transferParameters.title.indexOf(v4_1.FacetTitlePrefix) > -1) {
146
+ targetAnnotation = targetAnnotationEncoded = transferParameters.title.split(v4_1.FacetTitlePrefix)[1];
147
+ }
148
+ else if (ids[2]) {
149
+ targetAnnotation = targetAnnotationEncoded = ids[2].split('@')[1];
150
+ }
151
+ else if (targetAnnotationEncoded) {
152
+ targetAnnotation = targetAnnotationEncoded = targetAnnotationEncoded.replace(/::/g, '/');
153
+ }
154
+ }
155
+ else if (ids[1] === v4_1.PropertyName.views) {
156
+ ({ targetAnnotation, targetAnnotationEncoded } = determineTargetAnnotationOfViews(transferParameters, ids, targetAnnotation, targetAnnotationEncoded));
78
157
  }
79
158
  return { targetAnnotationEncoded, targetAnnotation, custom };
80
159
  }
81
- function getColumnKey(ids) {
82
- let columnKey;
83
- const isDataField = (element) => element === 'columns' || element === 'actions';
84
- const columnKeyIndex = ids.findIndex(isDataField) + 1;
85
- if (columnKeyIndex > 0) {
86
- columnKey = ids[columnKeyIndex];
87
- }
88
- return columnKey;
160
+ /**
161
+ * Calculates an additional key for the sync rule from the given ID's
162
+ * @param {string[]} ids - list of ids of parent elements
163
+ * @returns the key for the sync rule
164
+ */
165
+ function determineKeyForSyncRule(ids) {
166
+ let idIndex = 0;
167
+ for (let index = ids.length - 1; index > -1; index--) {
168
+ const element = ids[index];
169
+ if (element === 'columns' || element === v4_1.PropertyName.actions || element === 'views') {
170
+ idIndex = index + 1;
171
+ break;
172
+ }
173
+ }
174
+ return idIndex > 0 ? ids[idIndex].replace(/\//gi, '??') : undefined;
175
+ }
176
+ /**
177
+ * Creates a new object in manifest
178
+ * @param {ExportToManifestParams} params - list of parameters
179
+ */
180
+ function createNewObjectInManifest(params) {
181
+ if (params.exportHandler && typeof params.exportHandler === 'function') {
182
+ params.exportHandler(params.manifestSection, params.configObject, params.configPropertyKey, params.manifestKey, params.syncRuleKey);
183
+ }
184
+ else {
185
+ params.manifestSection[params.manifestKey] = {};
186
+ }
89
187
  }
90
- function transferPropertyToManifest(propertyDefinition, nextDefinition, syncRule, manifestSection, configObject, key, manifestKey) {
188
+ /**
189
+ * Transfers a property value from config to manifest
190
+ * @param {ExportToManifestParams} params - list of parameters
191
+ * @param propertyDefinition - schema definiton of a particular property
192
+ * @param nextDefinition - schema definition referred by $ref
193
+ */
194
+ function transferPropertyToManifest(params, propertyDefinition, nextDefinition) {
195
+ var _a, _b;
91
196
  if (!(propertyDefinition['type'] !== 'array' &&
92
- nextDefinition &&
93
- nextDefinition['targetDefinition'].type === 'object' &&
94
- nextDefinition['targetDefinition'].properties)) {
95
- const exportHandler = syncRule.manifest.export;
96
- if (exportHandler !== false) {
97
- if (exportHandler && typeof exportHandler === 'function') {
98
- exportHandler(manifestSection, configObject, key, manifestKey);
197
+ ((_a = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition['targetDefinition']) === null || _a === void 0 ? void 0 : _a.type) === 'object' && ((_b = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition['targetDefinition']) === null || _b === void 0 ? void 0 : _b.properties))) {
198
+ if (params.exportHandler !== false) {
199
+ if (params.exportHandler && typeof params.exportHandler === 'function') {
200
+ params.exportHandler(params.manifestSection, params.configObject, params.configPropertyKey, params.manifestKey, params.syncRuleKey);
99
201
  }
100
- else if (Array.isArray(configObject[key]) && !configObject[key].length) {
101
- delete manifestSection[manifestKey];
202
+ else if (Array.isArray(params.configObject[params.configPropertyKey]) &&
203
+ !params.configObject[params.configPropertyKey].length) {
204
+ delete params.manifestSection[params.manifestKey];
102
205
  }
103
206
  else {
104
- manifestSection[manifestKey] = configObject[key];
207
+ params.manifestSection[params.manifestKey] = params.configObject[params.configPropertyKey];
105
208
  }
106
209
  }
107
210
  }
108
- else if (propertyDefinition['type'] !== 'array' && manifestSection[manifestKey] === undefined) {
109
- manifestSection[manifestKey] = {};
211
+ else if (propertyDefinition['type'] !== 'array' && params.manifestSection[params.manifestKey] === undefined) {
212
+ createNewObjectInManifest(params);
110
213
  }
111
214
  }
112
- function exportManifestChange(ids, syncRule, transferParameters, key, configObject, propertyDefinition, nextDefinition) {
215
+ /**
216
+ * Transfers a change in config.json to manifest
217
+ * @param ids - list of parent & child ids
218
+ * @param {SyncRule} syncRule - syncRule (metadata)
219
+ * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
220
+ * @param {string} configPropertyKey - key of property in the config
221
+ * @param { [key: string]: any } configObject - the given config.json, to be exported
222
+ * @param propertyDefinition - schema definiton of a particular property
223
+ * @param nextDefinition - schema definition referred by $ref
224
+ */
225
+ function exportManifestChange(ids, syncRule, transferParameters, configPropertyKey, configObject, propertyDefinition, nextDefinition) {
113
226
  //eliminate subsections' hierarchy
114
227
  let index = ids.indexOf('subsections');
115
228
  while (index > -1) {
116
229
  ids.splice(index - 1, 2);
117
230
  index = ids.indexOf('subsections');
118
231
  }
119
- const { targetAnnotationEncoded, targetAnnotation, custom } = determineTargetAnnotation(ids, transferParameters.title);
120
- const columnKey = getColumnKey(ids);
121
- const path = syncRule.manifest.path(transferParameters.pageNameArray, {}, targetAnnotationEncoded, columnKey);
232
+ const { targetAnnotationEncoded, targetAnnotation, custom } = determineTargetAnnotation(ids, transferParameters, configObject);
233
+ const syncRuleKey = determineKeyForSyncRule(ids);
234
+ const path = syncRule.manifest.path(transferParameters.pageNameArray, transferParameters.exportResults.manifest, targetAnnotationEncoded, syncRuleKey, targetAnnotation);
122
235
  const manifestSection = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path, targetAnnotation, custom ? undefined : targetAnnotationEncoded);
123
- const manifestKey = syncRule.manifest.key || key;
124
- if (configObject[key] !== undefined) {
125
- // In case of arrays we take over complete array
126
- transferPropertyToManifest(propertyDefinition, nextDefinition, syncRule, manifestSection, configObject, key, manifestKey);
127
- }
128
- else if (manifestSection[manifestKey] !== undefined) {
129
- delete manifestSection[manifestKey];
130
- }
131
- else if (syncRule.manifest.delete) {
132
- const deleteHandler = syncRule.manifest.delete;
133
- if (typeof deleteHandler === 'function') {
134
- deleteHandler(manifestSection, configObject, key, manifestKey);
236
+ if (manifestSection) {
237
+ const manifestKey = syncRule.manifest.key || configPropertyKey;
238
+ if (configObject[configPropertyKey] !== undefined) {
239
+ // In case of arrays we take over complete array
240
+ const exportParams = {
241
+ exportHandler: syncRule.manifest.export,
242
+ manifestSection,
243
+ configObject,
244
+ configPropertyKey,
245
+ manifestKey,
246
+ syncRuleKey
247
+ };
248
+ transferPropertyToManifest(exportParams, propertyDefinition, nextDefinition);
249
+ }
250
+ else if (syncRule.manifest.delete) {
251
+ const deleteHandler = syncRule.manifest.delete;
252
+ if (typeof deleteHandler === 'function') {
253
+ deleteHandler(manifestSection, configObject, configPropertyKey, manifestKey, syncRuleKey);
254
+ }
255
+ }
256
+ else if (manifestSection[manifestKey] !== undefined) {
257
+ delete manifestSection[manifestKey];
135
258
  }
136
259
  }
137
260
  utils_1.deleteEmptyStructure(transferParameters.exportResults.manifest, path, targetAnnotation, targetAnnotationEncoded);
@@ -158,15 +281,23 @@ function evaluateExportRule(transferParameters, breadcrumbs, key, configObject,
158
281
  }
159
282
  }
160
283
  }
161
- function transferSubObject(propertyDefinition, nextDefinition, currentConfigObject, breadcrumbs, key, transferParameters, ids, localIdParts) {
284
+ /**
285
+ * Processes an (object-like) sub-object of the app schema and transfer all connected config entries to manifest
286
+ * @param {TransferEntryParameters} parameters - list of parameters
287
+ * @param {NextDefinition} nextDefinition - the next definition in app schema to be processed
288
+ * @param currentConfigObject - current config object
289
+ * @param ids - list of parent & child ID's
290
+ * @param localIdParts - list of ID parts for building the stable ID
291
+ */
292
+ function transferSubObject(parameters, nextDefinition, currentConfigObject, ids, localIdParts) {
162
293
  let objects = [], isArray = false;
163
- if (propertyDefinition.$ref && nextDefinition) {
294
+ if (parameters.propertyDefinition.$ref && nextDefinition) {
164
295
  objects.push(nextDefinition.configObject);
165
296
  }
166
- else if (propertyDefinition['anyOf']) {
297
+ else if (parameters.propertyDefinition['anyOf']) {
167
298
  objects.push(currentConfigObject);
168
299
  }
169
- else if (propertyDefinition.type === 'array') {
300
+ else if (parameters.propertyDefinition.type === 'array') {
170
301
  objects = currentConfigObject;
171
302
  isArray = true;
172
303
  }
@@ -175,15 +306,231 @@ function transferSubObject(propertyDefinition, nextDefinition, currentConfigObje
175
306
  }
176
307
  for (const innerObject of objects) {
177
308
  const additionalIds = [];
178
- if (breadcrumbs[0] === 'sections' && key === 'custom' && isArray) {
309
+ if (parameters.breadcrumbs[0] === v4_1.PropertyName.sections && parameters.key === 'custom' && isArray) {
179
310
  // We need add custom section 'id' into breadcrumbs to retrieve correct path to manifest
180
311
  additionalIds.push(innerObject['id']);
181
312
  }
182
- transferParameters.title = nextDefinition.title;
313
+ parameters.transferParameters.title = nextDefinition.title;
183
314
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
184
- transferManifestEntriesAndFlexChange(transferParameters, innerObject, [...ids, ...additionalIds], localIdParts, [...breadcrumbs, key], nextDefinition.targetDefinition);
315
+ transferManifestEntriesAndFlexChange(parameters.transferParameters, innerObject, [...ids, ...additionalIds], localIdParts, [...parameters.breadcrumbs, parameters.key], nextDefinition.targetDefinition);
185
316
  }
186
317
  }
318
+ /**
319
+ * Creates an ALP 'views' entry in the resulting manifest if not yet existing yet.
320
+ * Adds the secondary = table view if missing.
321
+ * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
322
+ * @param configObject - current object in config.json
323
+ * @returns
324
+ * - a boolean indicating that the views entry got created.
325
+ * - a boolean infcating if the processing of sub-objects shall be stopped
326
+ **/
327
+ function createALPTableView(transferParameters, configObject, key) {
328
+ let newElementCreated = false;
329
+ if (!configObject[key] || Object.keys(configObject[key]).length === 0 || !configObject.chart) {
330
+ return { newElementCreated, stopProcessing: true };
331
+ }
332
+ const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
333
+ const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
334
+ if (!views['paths'] || Object.keys(views['paths']).length === 0) {
335
+ views['paths'] = [
336
+ {
337
+ secondary: [
338
+ {
339
+ annotationPath: configObject[key].annotationPath
340
+ }
341
+ ]
342
+ }
343
+ ];
344
+ newElementCreated = true;
345
+ }
346
+ else if (!views['paths'][0].secondary) {
347
+ views['paths'][0].secondary = [
348
+ {
349
+ annotationPath: configObject[key].annotationPath
350
+ }
351
+ ];
352
+ newElementCreated = true;
353
+ }
354
+ return { newElementCreated, stopProcessing: false };
355
+ }
356
+ /**
357
+ * Creates an ALP 'views' entry in the resulting manifest if not yet existing yet
358
+ * Adds the primary = chart view if missing.
359
+ * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
360
+ * @param configObject - current object in config.json
361
+ * @returns
362
+ * - a boolean indicating that the views entry got created.
363
+ * - a boolean infcating if the processing of sub-objects shall be stopped
364
+ */
365
+ function createALPChartView(transferParameters, configObject, key) {
366
+ var _a;
367
+ let newElementCreated = false;
368
+ if (!configObject[key] || Object.keys(configObject[key]).length === 0) {
369
+ return { newElementCreated, stopProcessing: true };
370
+ }
371
+ const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
372
+ const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
373
+ if (!views['paths'] || Object.keys(views['paths']).length === 0) {
374
+ views['paths'] = [
375
+ {
376
+ primary: [
377
+ {
378
+ annotationPath: configObject[key].annotationPath
379
+ }
380
+ ]
381
+ }
382
+ ];
383
+ newElementCreated = true;
384
+ }
385
+ else if (!views['paths'][0].primary) {
386
+ views['paths'][0].primary = [
387
+ {
388
+ annotationPath: configObject[key].annotationPath
389
+ }
390
+ ];
391
+ newElementCreated = true;
392
+ }
393
+ if (!views['paths'][0].secondary) {
394
+ views['paths'][0].secondary = [
395
+ {
396
+ annotationPath: ((_a = configObject === null || configObject === void 0 ? void 0 : configObject.table) === null || _a === void 0 ? void 0 : _a.annotationPath) || 'com.sap.vocabularies.UI.v1.LineItem'
397
+ }
398
+ ];
399
+ }
400
+ return { newElementCreated, stopProcessing: false };
401
+ }
402
+ /**
403
+ * Creates an LR 'views' entry in the resulting manifest if not yet existing yet.
404
+ * Adds the current table view if missing.
405
+ * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
406
+ * @param configObject - current object in config.json
407
+ * @returns a boolean indicating that the views entry got created.
408
+ */
409
+ function createLRTableView(index, transferParameters, key, configObject) {
410
+ if (!configObject || Object.keys(configObject).length === 0) {
411
+ return false;
412
+ }
413
+ let newElementCreated = false;
414
+ const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
415
+ const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
416
+ const newEntry = {
417
+ key: key,
418
+ annotationPath: configObject.annotationPath
419
+ };
420
+ if (!views['paths'] || Object.keys(views['paths']).length === 0) {
421
+ //No views yet
422
+ views['paths'] = [newEntry];
423
+ newElementCreated = true;
424
+ }
425
+ else {
426
+ const existingIndex = views['paths'].findIndex((view) => view.key === key);
427
+ if (existingIndex === -1) {
428
+ //Given view does not exist yet
429
+ views['paths'].push(newEntry);
430
+ newElementCreated = true;
431
+ }
432
+ else if (existingIndex !== index) {
433
+ //Reordering scenario
434
+ views['paths'].splice(existingIndex, 1);
435
+ views['paths'].splice(index, 0, newEntry);
436
+ newElementCreated = true;
437
+ }
438
+ }
439
+ return newElementCreated;
440
+ }
441
+ /**
442
+ * Special logic to create new elements in manifest
443
+ * @param definitionName - schema definition name of the current object
444
+ * @param key - key of the current object
445
+ * @param configObject - current object in config.json
446
+ * @param breadcrumbs - array of sequence of properties that we are currently processing. Required for instance for table column name
447
+ * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
448
+ * @returns newElementCreated - boolean value to indicate that a new element was created ==> no further sync rule on this level
449
+ */
450
+ function createNewElement(index, definitionName, key, configObject, breadcrumbs, transferParameters, preprocessed = false) {
451
+ let newElementCreated = false;
452
+ const stopProcessing = false;
453
+ if (!preprocessed) {
454
+ if (definitionName === v4_1.DefinitionName.ALPChartView && key === v4_1.PropertyName.chart && configObject) {
455
+ return createALPChartView(transferParameters, configObject, key);
456
+ }
457
+ else if (definitionName === v4_1.DefinitionName.ALPTableView && key === v4_1.PropertyName.table && configObject) {
458
+ return createALPTableView(transferParameters, configObject, key);
459
+ }
460
+ else if (key &&
461
+ ((definitionName === null || definitionName === void 0 ? void 0 : definitionName.startsWith(v4_1.DefinitionName.LRTableView)) || (definitionName === null || definitionName === void 0 ? void 0 : definitionName.startsWith(v4_1.DefinitionName.LRChartView)))) {
462
+ newElementCreated = createLRTableView(index, transferParameters, key, configObject[key]);
463
+ }
464
+ }
465
+ return { newElementCreated, stopProcessing };
466
+ }
467
+ /**
468
+ * Transfers one enry of a list (aka one property of the config) to the manifest
469
+ * @param {TransferEntryParameters} parameters - list of parameters
470
+ * @param parentIds - array of collected parent ids
471
+ * @param stableIdParts - list of parts of the stable ID for flex changes
472
+ * @param preprocessed - indicates that the list was already preprocessed by following the config order
473
+ */
474
+ function transferSortedListEntry(parameters, parentIds, stableIdParts, preprocessed = false) {
475
+ var _a;
476
+ const currentConfigObject = parameters.configObject[parameters.key];
477
+ const childId = common_1.getChildId(parameters.configObject, parameters.key);
478
+ const nextDefinition = utils_1.getNextTargetDefinition(parameters.transferParameters.appSchema, parameters.transferParameters.title, currentConfigObject, parameters.propertyDefinition, parameters.key, parameters.transferParameters.factory, parameters.transferParameters.pageType);
479
+ const { newElementCreated, stopProcessing } = createNewElement(parameters.index, (_a = parameters.propertyDefinition.$ref) === null || _a === void 0 ? void 0 : _a.split(utils_1.DEFINITION_LINK_PREFIX)[1], parameters.key, parameters.configObject, parameters.breadcrumbs, parameters.transferParameters, preprocessed);
480
+ const ids = childId ? [...parentIds, childId] : [...parentIds, parameters.key];
481
+ if (!newElementCreated) {
482
+ evaluateExportRule(parameters.transferParameters, parameters.breadcrumbs, parameters.key, parameters.configObject, ids, parameters.propertyDefinition, nextDefinition);
483
+ }
484
+ if (parameters.propertyDefinition &&
485
+ (typeof currentConfigObject === 'object' ||
486
+ (parameters.propertyDefinition.$ref && nextDefinition.configObject)) &&
487
+ !stopProcessing) {
488
+ const localIdParts = childId ? [...stableIdParts, childId] : stableIdParts;
489
+ transferSubObject(parameters, nextDefinition, currentConfigObject, ids, localIdParts);
490
+ }
491
+ }
492
+ /**
493
+ * Function for special handling of anyOf definitions during the export
494
+ * @param {TransferEntryParameters} parameters - list of parameters
495
+ * @param anyOfDefinitions - the array of definitions from the anyOf (of additionalProperties)
496
+ * @param schemaDefinition - parent definition, comprising properties as well as additionalProperties
497
+ * @param parentIds - array of collected parent ids
498
+ * @param stableIdParts - list of parts of the stable ID for flex changes
499
+ * @returns
500
+ */
501
+ function transferConfigEntriesWithAnyOfDefinitions(transferEntryParameters, anyOfDefinitions, schemaDefinition, parentIds, stableIdParts) {
502
+ let preprocessed = false;
503
+ if (anyOfDefinitions) {
504
+ const configEntries = Object.entries(transferEntryParameters.configObject);
505
+ if (!configEntries || configEntries.length < 1) {
506
+ return preprocessed;
507
+ }
508
+ configEntries.sort((a, b) => a[1]['index'] - b[1]['index']);
509
+ //follow the config order, to support reordering
510
+ configEntries.forEach((configEntry) => {
511
+ if (schemaDefinition.properties[configEntry[0]]) {
512
+ transferEntryParameters.key = configEntry[0];
513
+ transferEntryParameters.propertyDefinition = schemaDefinition.properties[configEntry[0]];
514
+ //already part of schema
515
+ transferSortedListEntry(transferEntryParameters, parentIds, stableIdParts);
516
+ preprocessed = true;
517
+ }
518
+ else if (typeof configEntry[1] === 'object') {
519
+ //match against potential schema definitions
520
+ anyOfDefinitions.forEach((anyOfDefinition) => {
521
+ if (anyOfDefinition.$ref) {
522
+ transferEntryParameters.key = configEntry[0];
523
+ transferEntryParameters.propertyDefinition = anyOfDefinition;
524
+ transferSortedListEntry(transferEntryParameters, parentIds, stableIdParts);
525
+ preprocessed = true;
526
+ }
527
+ });
528
+ }
529
+ transferEntryParameters.index++;
530
+ });
531
+ }
532
+ return preprocessed;
533
+ }
187
534
  /**
188
535
  * Recursive function that traverses the content of the current object. It reads decorators and fills exportResultManifest entries and flex changes
189
536
  * @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
@@ -195,22 +542,38 @@ function transferSubObject(propertyDefinition, nextDefinition, currentConfigObje
195
542
  * @param title - the title to be used for the given schema definition
196
543
  */
197
544
  function transferManifestEntriesAndFlexChange(transferParameters, configObject, parentIds, stableIdParts, breadcrumbs, schemaDefinition) {
198
- let currentConfigObject;
199
- if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition['properties'])) {
545
+ var _a, _b;
546
+ if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition.properties)) {
200
547
  return;
201
548
  }
202
- for (const key in schemaDefinition['properties']) {
203
- currentConfigObject = configObject[key];
204
- const childId = common_1.getChildId(configObject, key);
205
- const propertyDefinition = schemaDefinition['properties'][key];
206
- const nextDefinition = utils_1.getNextTargetDefinition(transferParameters.appSchema, transferParameters.title, currentConfigObject, propertyDefinition, key, transferParameters.factory, transferParameters.pageType);
207
- const ids = childId ? [...parentIds, childId] : [...parentIds, key];
208
- evaluateExportRule(transferParameters, breadcrumbs, key, configObject, ids, propertyDefinition, nextDefinition);
209
- if (propertyDefinition &&
210
- (typeof currentConfigObject === 'object' || (propertyDefinition.$ref && nextDefinition.configObject))) {
211
- const localIdParts = childId ? [...stableIdParts, childId] : stableIdParts;
212
- transferSubObject(propertyDefinition, nextDefinition, currentConfigObject, breadcrumbs, key, transferParameters, ids, localIdParts);
549
+ let index = 0;
550
+ //In case of additionalProperties = flexible array definition ==> new entries from the config shall be exported too
551
+ const transferEntryParameters = {
552
+ transferParameters,
553
+ breadcrumbs,
554
+ key: undefined,
555
+ index,
556
+ configObject,
557
+ propertyDefinition: undefined
558
+ };
559
+ const anyOfDefinitions = (_a = schemaDefinition.additionalProperties) === null || _a === void 0 ? void 0 : _a.anyOf;
560
+ const preprocessed = transferConfigEntriesWithAnyOfDefinitions(transferEntryParameters, anyOfDefinitions, schemaDefinition, parentIds, stableIdParts);
561
+ //Sort if there is a propertyIndex, so that the exported list ends up in manifest in the right order
562
+ let sortedList = schemaDefinition.properties && Object.entries(schemaDefinition.properties);
563
+ if (sortedList) {
564
+ if ((_b = sortedList[0]) === null || _b === void 0 ? void 0 : _b[1][v4_1.SchemaTag.propertyIndex]) {
565
+ sortedList = Object.entries(schemaDefinition.properties).sort((a, b) => a[1][v4_1.SchemaTag.propertyIndex] - b[1][v4_1.SchemaTag.propertyIndex]);
213
566
  }
567
+ index = 0;
568
+ sortedList.forEach((element) => {
569
+ transferEntryParameters.key = element[0];
570
+ transferEntryParameters.propertyDefinition = element[1];
571
+ transferEntryParameters.index = index;
572
+ transferSortedListEntry(transferEntryParameters, parentIds, stableIdParts, preprocessed);
573
+ if (element[1].$ref) {
574
+ index++;
575
+ }
576
+ });
214
577
  }
215
578
  }
216
579
  /**
@@ -220,7 +583,8 @@ function transferManifestEntriesAndFlexChange(transferParameters, configObject,
220
583
  function getClassesForSingleSection(objectPageConfig, sectionId, factory) {
221
584
  if (sectionId === 'custom' && Array.isArray(objectPageConfig.sections[sectionId])) {
222
585
  // Custom sections
223
- const customSections = objectPageConfig.sections.custom;
586
+ const customSections = objectPageConfig.sections
587
+ .custom;
224
588
  for (let index = 0; index < customSections.length; index++) {
225
589
  customSections[index] = factory.createInstance(v4_1.PageType.ObjectPage, 'ObjectPageCustomSectionView', customSections[index], customSections[index].className);
226
590
  }
@@ -269,7 +633,7 @@ const exportObjectPage = (exportParameters, ui5Version) => {
269
633
  const pageLayoutInformation = common_1.getPageLayoutInformation(objectPage);
270
634
  const pageName = exportParameters.page.name;
271
635
  const baseId = `${exportParameters.appId}::${pageLayoutInformation.id}::${pageName}--`;
272
- if ((_a = exportParameters.page.config) === null || _a === void 0 ? void 0 : _a['sections']) {
636
+ if ((_a = exportParameters.page.config) === null || _a === void 0 ? void 0 : _a[v4_1.PropertyName.sections]) {
273
637
  getExportClassesForSections(exportParameters.page.config, objectPage, factory);
274
638
  }
275
639
  const transferParameters = {
@@ -278,11 +642,13 @@ const exportObjectPage = (exportParameters, ui5Version) => {
278
642
  appRootPath: exportParameters.appRootPath,
279
643
  baseId,
280
644
  appSchema: exportParameters.jsonSchema,
645
+ config: objectPage,
281
646
  ui5Version,
282
647
  factory,
283
648
  pageNameArray: [pageName],
284
649
  pageType: v4_1.PageType.ObjectPage,
285
- title: undefined
650
+ title: undefined,
651
+ templateType: utils_1.TemplateType.ListReportObjectPageV4
286
652
  };
287
653
  transferManifestEntriesAndFlexChange(transferParameters, objectPage, [], //no parentIds
288
654
  [], // no stableIds
@@ -298,66 +664,69 @@ const exportObjectPage = (exportParameters, ui5Version) => {
298
664
  * @param {PageTypeV4} - pageType - Page type
299
665
  * @param ui5Version - SAP UI5 version
300
666
  */
301
- const exportListPage = (exportParameters, factory, config, pageType, ui5Version) => {
302
- var _a;
667
+ const exportListPage = (exportParameters, factory, config, pageType, ui5Version, templateType) => {
668
+ var _a, _b;
303
669
  const exportResults = defaultExportResult;
304
670
  exportResults.manifest = JSON.parse(JSON.stringify(exportParameters.manifest));
305
- config.table = factory.createInstance(pageType, 'Table', config.table);
306
- if ((_a = config.table.toolBar) === null || _a === void 0 ? void 0 : _a.actions) {
307
- for (const actionKey in exportParameters.jsonSchema['definitions']['Actions<LineItems>'].properties) {
671
+ const appSchema = exportParameters.jsonSchema;
672
+ const tableDefinition = ((_a = config.table) === null || _a === void 0 ? void 0 : _a[v4_1.PropertyName.annotationPath]) ? v4_1.DefinitionName.ALPTableView
673
+ : v4_1.DefinitionName.Table;
674
+ config.table = factory.createInstance(pageType, tableDefinition, config.table);
675
+ if (((_b = config.table.toolBar) === null || _b === void 0 ? void 0 : _b.actions) && appSchema.definitions['Actions<LineItems>']) {
676
+ for (const actionKey in appSchema.definitions['Actions<LineItems>'].properties) {
308
677
  config.table.toolBar.actions[actionKey] = factory.createInstance(pageType, 'ToolBarAction', config.table.toolBar.actions[actionKey]);
309
678
  }
310
679
  }
311
680
  const pageLayoutInformation = common_1.getPageLayoutInformation(config);
312
681
  const pageName = exportParameters.page.name;
313
682
  const baseId = `${exportParameters.appId}::${pageLayoutInformation.id}::${pageName}--`;
314
- if (!exportResults.manifest[v4_1.ManifestSection.ui5]['routing']['targets'][pageName]) {
683
+ if (!exportResults.manifest[v4_1.ManifestSection.ui5].routing.targets[pageName]) {
315
684
  const newV4Page = getV4ManifestPageTemplate(pageLayoutInformation.pageId, pageName);
316
- exportResults.manifest[v4_1.ManifestSection.ui5]['routing']['targets'][pageName] = newV4Page;
685
+ exportResults.manifest[v4_1.ManifestSection.ui5].routing.targets[pageName] = newV4Page;
317
686
  }
318
687
  const transferParameters = {
319
688
  exportResults,
320
689
  appId: exportParameters.appId,
321
690
  appRootPath: exportParameters.appRootPath,
322
691
  baseId,
323
- appSchema: exportParameters.jsonSchema,
692
+ appSchema,
693
+ config,
324
694
  ui5Version,
325
695
  factory,
326
696
  pageNameArray: [pageName],
327
697
  pageType: v4_1.PageType.ListReport,
328
698
  title: undefined,
329
- logger: exportParameters.logger
699
+ logger: exportParameters.logger,
700
+ templateType
330
701
  };
331
702
  transferManifestEntriesAndFlexChange(transferParameters, config, [], //no parentIds
332
703
  [], // no stableIds
333
704
  [], // no breadcrumbs
334
- exportParameters.jsonSchema //starting point for target definition
705
+ appSchema //starting point for target definition
335
706
  );
336
707
  return exportResults;
337
708
  };
338
709
  /**
339
710
  * Run through the given ListReport config and return respective exportResultManifest entry and flex changes
340
711
  * @param {ExportListReportV4Parameters} exportParameters - all API parameters needed for the export
341
- *
712
+ * @param ui5Version - SAP UI5 version
342
713
  * @returns ExportResults - The export result comprises the enhanced manifest as well as a list of flex changes.
343
714
  */
344
- const exportListReportPage = (exportParameters, ui5Version) => {
715
+ const exportListReportPage = (exportParameters, ui5Version, templateType) => {
345
716
  const factory = new factory_1.MetadataInstanceFactoryV4();
346
717
  const listReport = factory.createPageInstance(v4_1.PageType.ListReport, exportParameters.page.config);
347
- return exportListPage(exportParameters, factory, listReport, v4_1.PageTypeV4.ListReport, ui5Version);
718
+ return exportListPage(exportParameters, factory, listReport, v4_1.PageTypeV4.ListReport, ui5Version, templateType);
348
719
  };
349
720
  /**
350
721
  * Run through the given Analytical List Page config and return respective exportResultManifest entry and flex changes
351
- * @param appId - id of the Fiori elements app, which is usually namespace.appid
352
- * @param analyticalListPageConfig - content of the Analytical List page config file
353
- * @param pageName - routing target defined in manifest
722
+ * @param {ExportAnalyticalListPageV4Parameters} exportParameters - all API parameters needed for the export
723
+ * @param ui5Version - SAP UI5 version
724
+ * @returns ExportResults - The export result comprises the enhanced manifest as well as a list of flex changes.
354
725
  *
355
726
  * @returns ExportResults - The export result comprises the enhanced manifest as well as a list of flex changes.
356
727
  */
357
728
  const exportAnalyticalListPage = (exportParameters, ui5Version) => {
358
- const factory = new factory_1.MetadataInstanceFactoryV4();
359
- const analyticalListPage = factory.createPageInstance(v4_1.PageType.AnalyticalListPage, exportParameters.page.config);
360
- return exportListPage(exportParameters, factory, analyticalListPage, v4_1.PageTypeV4.AnalyticalListPage, ui5Version);
729
+ return exportListReportPage(exportParameters, ui5Version, utils_1.TemplateType.AnalyticalListPageV4);
361
730
  };
362
731
  /**
363
732
  * API for the export of a V4 app configuration
@@ -379,7 +748,7 @@ const exportApplicationV4 = (application, manifest, jsonSchema) => {
379
748
  if (syncRule && syncRule.manifest) {
380
749
  const path = syncRule.manifest.path();
381
750
  const manifestSection = common_1.getManifestSectionByPathV4(exportResults.manifest, path);
382
- if (application['settings'] && application['settings'][key]) {
751
+ if (application['settings'] && application['settings'][key] !== undefined) {
383
752
  manifestSection[key] = application['settings'][key];
384
753
  }
385
754
  else {
@@ -406,7 +775,7 @@ const exportApplicationV4 = (application, manifest, jsonSchema) => {
406
775
  */
407
776
  exports.exportPageV4 = (exportParametersV4, ui5Version) => {
408
777
  if (exportParametersV4[v4_1.SchemaType.ListReport]) {
409
- return exportListReportPage(exportParametersV4[v4_1.SchemaType.ListReport], ui5Version);
778
+ return exportListReportPage(exportParametersV4[v4_1.SchemaType.ListReport], ui5Version, utils_1.TemplateType.ListReportObjectPageV4);
410
779
  }
411
780
  else if (exportParametersV4[v4_1.SchemaType.ObjectPage]) {
412
781
  return exportObjectPage(exportParametersV4[v4_1.SchemaType.ObjectPage], ui5Version);