@sapui5/sap.cux.home 1.135.0 → 1.136.0

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 (436) hide show
  1. package/package.json +1 -1
  2. package/src/sap/cux/home/AdvancedSettingsPanel-dbg.js +23 -5
  3. package/src/sap/cux/home/AdvancedSettingsPanel-dbg.js.map +1 -1
  4. package/src/sap/cux/home/AdvancedSettingsPanel.d.ts +7 -0
  5. package/src/sap/cux/home/AdvancedSettingsPanel.d.ts.map +1 -1
  6. package/src/sap/cux/home/AdvancedSettingsPanel.js +1 -1
  7. package/src/sap/cux/home/AdvancedSettingsPanel.js.map +1 -1
  8. package/src/sap/cux/home/AdvancedSettingsPanel.ts +24 -5
  9. package/src/sap/cux/home/AppsAdditionPanel-dbg.js +919 -0
  10. package/src/sap/cux/home/AppsAdditionPanel-dbg.js.map +1 -0
  11. package/src/sap/cux/home/AppsAdditionPanel.d.ts +293 -0
  12. package/src/sap/cux/home/AppsAdditionPanel.d.ts.map +1 -0
  13. package/src/sap/cux/home/AppsAdditionPanel.js +6 -0
  14. package/src/sap/cux/home/AppsAdditionPanel.js.map +1 -0
  15. package/src/sap/cux/home/AppsAdditionPanel.ts +757 -0
  16. package/src/sap/cux/home/AppsContainer-dbg.js +42 -28
  17. package/src/sap/cux/home/AppsContainer-dbg.js.map +1 -1
  18. package/src/sap/cux/home/AppsContainer.d.ts +17 -1
  19. package/src/sap/cux/home/AppsContainer.d.ts.map +1 -1
  20. package/src/sap/cux/home/AppsContainer.js +1 -1
  21. package/src/sap/cux/home/AppsContainer.js.map +1 -1
  22. package/src/sap/cux/home/AppsContainer.ts +27 -6
  23. package/src/sap/cux/home/AppsContainerGenericPlaceholder-dbg.js +261 -0
  24. package/src/sap/cux/home/AppsContainerGenericPlaceholder-dbg.js.map +1 -0
  25. package/src/sap/cux/home/AppsContainerGenericPlaceholder.d.ts +8 -0
  26. package/src/sap/cux/home/AppsContainerGenericPlaceholder.d.ts.map +1 -0
  27. package/src/sap/cux/home/AppsContainerGenericPlaceholder.js +6 -0
  28. package/src/sap/cux/home/AppsContainerGenericPlaceholder.js.map +1 -0
  29. package/src/sap/cux/home/AppsContainerGenericPlaceholder.ts +251 -0
  30. package/src/sap/cux/home/BaseAppPanel-dbg.js +4 -5
  31. package/src/sap/cux/home/BaseAppPanel-dbg.js.map +1 -1
  32. package/src/sap/cux/home/BaseAppPanel.d.ts.map +1 -1
  33. package/src/sap/cux/home/BaseAppPanel.js +1 -1
  34. package/src/sap/cux/home/BaseAppPanel.js.map +1 -1
  35. package/src/sap/cux/home/BaseAppPanel.ts +3 -5
  36. package/src/sap/cux/home/BaseAppPersPanel-dbg.js +2 -1
  37. package/src/sap/cux/home/BaseAppPersPanel-dbg.js.map +1 -1
  38. package/src/sap/cux/home/BaseAppPersPanel.d.ts.map +1 -1
  39. package/src/sap/cux/home/BaseAppPersPanel.js +1 -1
  40. package/src/sap/cux/home/BaseAppPersPanel.js.map +1 -1
  41. package/src/sap/cux/home/BaseAppPersPanel.ts +2 -1
  42. package/src/sap/cux/home/BaseContainer-dbg.js +24 -3
  43. package/src/sap/cux/home/BaseContainer-dbg.js.map +1 -1
  44. package/src/sap/cux/home/BaseContainer.d.ts +10 -0
  45. package/src/sap/cux/home/BaseContainer.d.ts.map +1 -1
  46. package/src/sap/cux/home/BaseContainer.js +1 -1
  47. package/src/sap/cux/home/BaseContainer.js.map +1 -1
  48. package/src/sap/cux/home/BaseContainer.ts +24 -2
  49. package/src/sap/cux/home/BaseContainerRenderer-dbg.js +18 -1
  50. package/src/sap/cux/home/BaseContainerRenderer-dbg.js.map +1 -1
  51. package/src/sap/cux/home/BaseContainerRenderer.d.ts +4 -4
  52. package/src/sap/cux/home/BaseContainerRenderer.d.ts.map +1 -1
  53. package/src/sap/cux/home/BaseContainerRenderer.js +1 -1
  54. package/src/sap/cux/home/BaseContainerRenderer.js.map +1 -1
  55. package/src/sap/cux/home/BaseContainerRenderer.ts +25 -4
  56. package/src/sap/cux/home/BaseLayout-dbg.js +22 -2
  57. package/src/sap/cux/home/BaseLayout-dbg.js.map +1 -1
  58. package/src/sap/cux/home/BaseLayout.d.ts +6 -0
  59. package/src/sap/cux/home/BaseLayout.d.ts.map +1 -1
  60. package/src/sap/cux/home/BaseLayout.js +1 -1
  61. package/src/sap/cux/home/BaseLayout.js.map +1 -1
  62. package/src/sap/cux/home/BaseLayout.ts +23 -2
  63. package/src/sap/cux/home/BaseNewsItem-dbg.js +3 -3
  64. package/src/sap/cux/home/BaseNewsItem-dbg.js.map +1 -1
  65. package/src/sap/cux/home/BaseNewsItem.js +1 -1
  66. package/src/sap/cux/home/BaseNewsItem.js.map +1 -1
  67. package/src/sap/cux/home/BaseNewsItem.ts +3 -3
  68. package/src/sap/cux/home/BaseNewsPanel-dbg.js +4 -5
  69. package/src/sap/cux/home/BaseNewsPanel-dbg.js.map +1 -1
  70. package/src/sap/cux/home/BaseNewsPanel.d.ts.map +1 -1
  71. package/src/sap/cux/home/BaseNewsPanel.js +1 -1
  72. package/src/sap/cux/home/BaseNewsPanel.js.map +1 -1
  73. package/src/sap/cux/home/BaseNewsPanel.ts +5 -4
  74. package/src/sap/cux/home/BasePanel-dbg.js +1 -1
  75. package/src/sap/cux/home/BasePanel-dbg.js.map +1 -1
  76. package/src/sap/cux/home/BasePanel.js +1 -1
  77. package/src/sap/cux/home/BasePanel.js.map +1 -1
  78. package/src/sap/cux/home/BasePanel.ts +1 -1
  79. package/src/sap/cux/home/BaseSettingsDialog-dbg.js +11 -0
  80. package/src/sap/cux/home/BaseSettingsDialog-dbg.js.map +1 -1
  81. package/src/sap/cux/home/BaseSettingsDialog.d.ts.map +1 -1
  82. package/src/sap/cux/home/BaseSettingsDialog.js +1 -1
  83. package/src/sap/cux/home/BaseSettingsDialog.js.map +1 -1
  84. package/src/sap/cux/home/BaseSettingsDialog.ts +12 -0
  85. package/src/sap/cux/home/BaseSettingsPanel-dbg.js +67 -2
  86. package/src/sap/cux/home/BaseSettingsPanel-dbg.js.map +1 -1
  87. package/src/sap/cux/home/BaseSettingsPanel.d.ts +42 -0
  88. package/src/sap/cux/home/BaseSettingsPanel.d.ts.map +1 -1
  89. package/src/sap/cux/home/BaseSettingsPanel.gen.d.ts +75 -0
  90. package/src/sap/cux/home/BaseSettingsPanel.js +1 -1
  91. package/src/sap/cux/home/BaseSettingsPanel.js.map +1 -1
  92. package/src/sap/cux/home/BaseSettingsPanel.ts +70 -2
  93. package/src/sap/cux/home/CardsPanel-dbg.js +548 -168
  94. package/src/sap/cux/home/CardsPanel-dbg.js.map +1 -1
  95. package/src/sap/cux/home/CardsPanel.d.ts +121 -15
  96. package/src/sap/cux/home/CardsPanel.d.ts.map +1 -1
  97. package/src/sap/cux/home/CardsPanel.gen.d.ts +78 -0
  98. package/src/sap/cux/home/CardsPanel.js +1 -1
  99. package/src/sap/cux/home/CardsPanel.js.map +1 -1
  100. package/src/sap/cux/home/CardsPanel.ts +450 -97
  101. package/src/sap/cux/home/ContentAdditionDialog-dbg.js +353 -0
  102. package/src/sap/cux/home/ContentAdditionDialog-dbg.js.map +1 -0
  103. package/src/sap/cux/home/ContentAdditionDialog.d.ts +82 -0
  104. package/src/sap/cux/home/ContentAdditionDialog.d.ts.map +1 -0
  105. package/src/sap/cux/home/ContentAdditionDialog.js +6 -0
  106. package/src/sap/cux/home/ContentAdditionDialog.js.map +1 -0
  107. package/src/sap/cux/home/ContentAdditionDialog.ts +214 -0
  108. package/src/sap/cux/home/ErrorPanel-dbg.js +3 -3
  109. package/src/sap/cux/home/ErrorPanel-dbg.js.map +1 -1
  110. package/src/sap/cux/home/ErrorPanel.d.ts.map +1 -1
  111. package/src/sap/cux/home/ErrorPanel.js +1 -1
  112. package/src/sap/cux/home/ErrorPanel.js.map +1 -1
  113. package/src/sap/cux/home/ErrorPanel.ts +4 -2
  114. package/src/sap/cux/home/FavAppPanel-dbg.js +352 -333
  115. package/src/sap/cux/home/FavAppPanel-dbg.js.map +1 -1
  116. package/src/sap/cux/home/FavAppPanel.d.ts.map +1 -1
  117. package/src/sap/cux/home/FavAppPanel.js +1 -1
  118. package/src/sap/cux/home/FavAppPanel.js.map +1 -1
  119. package/src/sap/cux/home/FavAppPanel.ts +63 -54
  120. package/src/sap/cux/home/InsightsAdditionPanel-dbg.js +97 -0
  121. package/src/sap/cux/home/InsightsAdditionPanel-dbg.js.map +1 -0
  122. package/src/sap/cux/home/InsightsAdditionPanel.d.ts +57 -0
  123. package/src/sap/cux/home/InsightsAdditionPanel.d.ts.map +1 -0
  124. package/src/sap/cux/home/InsightsAdditionPanel.js +6 -0
  125. package/src/sap/cux/home/InsightsAdditionPanel.js.map +1 -0
  126. package/src/sap/cux/home/InsightsAdditionPanel.ts +94 -0
  127. package/src/sap/cux/home/InsightsContainer-dbg.js +22 -2
  128. package/src/sap/cux/home/InsightsContainer-dbg.js.map +1 -1
  129. package/src/sap/cux/home/InsightsContainer.d.ts +14 -0
  130. package/src/sap/cux/home/InsightsContainer.d.ts.map +1 -1
  131. package/src/sap/cux/home/InsightsContainer.js +1 -1
  132. package/src/sap/cux/home/InsightsContainer.js.map +1 -1
  133. package/src/sap/cux/home/InsightsContainer.ts +22 -1
  134. package/src/sap/cux/home/InsightsContainerGenericPlaceholder-dbg.js +401 -0
  135. package/src/sap/cux/home/InsightsContainerGenericPlaceholder-dbg.js.map +1 -0
  136. package/src/sap/cux/home/InsightsContainerGenericPlaceholder.d.ts +8 -0
  137. package/src/sap/cux/home/InsightsContainerGenericPlaceholder.d.ts.map +1 -0
  138. package/src/sap/cux/home/InsightsContainerGenericPlaceholder.js +6 -0
  139. package/src/sap/cux/home/InsightsContainerGenericPlaceholder.js.map +1 -0
  140. package/src/sap/cux/home/InsightsContainerGenericPlaceholder.ts +391 -0
  141. package/src/sap/cux/home/KeyUserLayoutSettingsPanel-dbg.js +10 -9
  142. package/src/sap/cux/home/KeyUserLayoutSettingsPanel-dbg.js.map +1 -1
  143. package/src/sap/cux/home/KeyUserLayoutSettingsPanel.d.ts.map +1 -1
  144. package/src/sap/cux/home/KeyUserLayoutSettingsPanel.js +1 -1
  145. package/src/sap/cux/home/KeyUserLayoutSettingsPanel.js.map +1 -1
  146. package/src/sap/cux/home/KeyUserLayoutSettingsPanel.ts +9 -8
  147. package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel-dbg.js +2 -2
  148. package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel-dbg.js.map +1 -1
  149. package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.js +1 -1
  150. package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.js.map +1 -1
  151. package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.ts +2 -2
  152. package/src/sap/cux/home/KeyUserPagesSettingsPanel-dbg.js +6 -6
  153. package/src/sap/cux/home/KeyUserPagesSettingsPanel-dbg.js.map +1 -1
  154. package/src/sap/cux/home/KeyUserPagesSettingsPanel.js +1 -1
  155. package/src/sap/cux/home/KeyUserPagesSettingsPanel.js.map +1 -1
  156. package/src/sap/cux/home/KeyUserPagesSettingsPanel.ts +6 -6
  157. package/src/sap/cux/home/Layout-dbg.js +58 -33
  158. package/src/sap/cux/home/Layout-dbg.js.map +1 -1
  159. package/src/sap/cux/home/Layout.d.ts +13 -0
  160. package/src/sap/cux/home/Layout.d.ts.map +1 -1
  161. package/src/sap/cux/home/Layout.js +1 -1
  162. package/src/sap/cux/home/Layout.js.map +1 -1
  163. package/src/sap/cux/home/Layout.ts +48 -20
  164. package/src/sap/cux/home/LayoutSettingsPanel-dbg.js +1 -10
  165. package/src/sap/cux/home/LayoutSettingsPanel-dbg.js.map +1 -1
  166. package/src/sap/cux/home/LayoutSettingsPanel.d.ts.map +1 -1
  167. package/src/sap/cux/home/LayoutSettingsPanel.js +1 -1
  168. package/src/sap/cux/home/LayoutSettingsPanel.js.map +1 -1
  169. package/src/sap/cux/home/LayoutSettingsPanel.ts +2 -10
  170. package/src/sap/cux/home/NewsAndPagesContainer-dbg.js +35 -17
  171. package/src/sap/cux/home/NewsAndPagesContainer-dbg.js.map +1 -1
  172. package/src/sap/cux/home/NewsAndPagesContainer.d.ts +7 -0
  173. package/src/sap/cux/home/NewsAndPagesContainer.d.ts.map +1 -1
  174. package/src/sap/cux/home/NewsAndPagesContainer.js +1 -1
  175. package/src/sap/cux/home/NewsAndPagesContainer.js.map +1 -1
  176. package/src/sap/cux/home/NewsAndPagesContainer.ts +40 -16
  177. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder-dbg.js +164 -0
  178. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder-dbg.js.map +1 -0
  179. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.d.ts +8 -0
  180. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.d.ts.map +1 -0
  181. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.js +6 -0
  182. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.js.map +1 -0
  183. package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.ts +154 -0
  184. package/src/sap/cux/home/NewsGroup-dbg.js +112 -79
  185. package/src/sap/cux/home/NewsGroup-dbg.js.map +1 -1
  186. package/src/sap/cux/home/NewsGroup.d.ts +1 -0
  187. package/src/sap/cux/home/NewsGroup.d.ts.map +1 -1
  188. package/src/sap/cux/home/NewsGroup.js +1 -1
  189. package/src/sap/cux/home/NewsGroup.js.map +1 -1
  190. package/src/sap/cux/home/NewsGroup.ts +136 -100
  191. package/src/sap/cux/home/NewsPanel-dbg.js +541 -173
  192. package/src/sap/cux/home/NewsPanel-dbg.js.map +1 -1
  193. package/src/sap/cux/home/NewsPanel.d.ts +156 -16
  194. package/src/sap/cux/home/NewsPanel.d.ts.map +1 -1
  195. package/src/sap/cux/home/NewsPanel.js +1 -1
  196. package/src/sap/cux/home/NewsPanel.js.map +1 -1
  197. package/src/sap/cux/home/NewsPanel.ts +452 -82
  198. package/src/sap/cux/home/NewsSettingsPanel-dbg.js +61 -20
  199. package/src/sap/cux/home/NewsSettingsPanel-dbg.js.map +1 -1
  200. package/src/sap/cux/home/NewsSettingsPanel.d.ts +14 -0
  201. package/src/sap/cux/home/NewsSettingsPanel.d.ts.map +1 -1
  202. package/src/sap/cux/home/NewsSettingsPanel.js +1 -1
  203. package/src/sap/cux/home/NewsSettingsPanel.js.map +1 -1
  204. package/src/sap/cux/home/NewsSettingsPanel.ts +75 -21
  205. package/src/sap/cux/home/NoDataContainer-dbg.js +3 -3
  206. package/src/sap/cux/home/NoDataContainer-dbg.js.map +1 -1
  207. package/src/sap/cux/home/NoDataContainer.d.ts +1 -0
  208. package/src/sap/cux/home/NoDataContainer.d.ts.map +1 -1
  209. package/src/sap/cux/home/NoDataContainer.js +1 -1
  210. package/src/sap/cux/home/NoDataContainer.js.map +1 -1
  211. package/src/sap/cux/home/NoDataContainer.ts +4 -2
  212. package/src/sap/cux/home/PagePanel-dbg.js +86 -75
  213. package/src/sap/cux/home/PagePanel-dbg.js.map +1 -1
  214. package/src/sap/cux/home/PagePanel.d.ts +25 -3
  215. package/src/sap/cux/home/PagePanel.d.ts.map +1 -1
  216. package/src/sap/cux/home/PagePanel.js +1 -1
  217. package/src/sap/cux/home/PagePanel.js.map +1 -1
  218. package/src/sap/cux/home/PagePanel.ts +91 -76
  219. package/src/sap/cux/home/PageSettingsPanel-dbg.js +16 -15
  220. package/src/sap/cux/home/PageSettingsPanel-dbg.js.map +1 -1
  221. package/src/sap/cux/home/PageSettingsPanel.d.ts.map +1 -1
  222. package/src/sap/cux/home/PageSettingsPanel.js +1 -1
  223. package/src/sap/cux/home/PageSettingsPanel.js.map +1 -1
  224. package/src/sap/cux/home/PageSettingsPanel.ts +15 -14
  225. package/src/sap/cux/home/RecentAppPanel-dbg.js +2 -2
  226. package/src/sap/cux/home/RecentAppPanel-dbg.js.map +1 -1
  227. package/src/sap/cux/home/RecentAppPanel.js +1 -1
  228. package/src/sap/cux/home/RecentAppPanel.js.map +1 -1
  229. package/src/sap/cux/home/RecentAppPanel.ts +2 -2
  230. package/src/sap/cux/home/RecommendedAppPanel-dbg.js +4 -3
  231. package/src/sap/cux/home/RecommendedAppPanel-dbg.js.map +1 -1
  232. package/src/sap/cux/home/RecommendedAppPanel.d.ts.map +1 -1
  233. package/src/sap/cux/home/RecommendedAppPanel.js +1 -1
  234. package/src/sap/cux/home/RecommendedAppPanel.js.map +1 -1
  235. package/src/sap/cux/home/RecommendedAppPanel.ts +4 -2
  236. package/src/sap/cux/home/SettingsDialog-dbg.js +4 -3
  237. package/src/sap/cux/home/SettingsDialog-dbg.js.map +1 -1
  238. package/src/sap/cux/home/SettingsDialog.d.ts.map +1 -1
  239. package/src/sap/cux/home/SettingsDialog.js +1 -1
  240. package/src/sap/cux/home/SettingsDialog.js.map +1 -1
  241. package/src/sap/cux/home/SettingsDialog.ts +4 -2
  242. package/src/sap/cux/home/TaskPanel-dbg.js +16 -12
  243. package/src/sap/cux/home/TaskPanel-dbg.js.map +1 -1
  244. package/src/sap/cux/home/TaskPanel.d.ts +1 -2
  245. package/src/sap/cux/home/TaskPanel.d.ts.map +1 -1
  246. package/src/sap/cux/home/TaskPanel.js +1 -1
  247. package/src/sap/cux/home/TaskPanel.js.map +1 -1
  248. package/src/sap/cux/home/TaskPanel.ts +19 -12
  249. package/src/sap/cux/home/TilesPanel-dbg.js +9 -8
  250. package/src/sap/cux/home/TilesPanel-dbg.js.map +1 -1
  251. package/src/sap/cux/home/TilesPanel.d.ts.map +1 -1
  252. package/src/sap/cux/home/TilesPanel.js +1 -1
  253. package/src/sap/cux/home/TilesPanel.js.map +1 -1
  254. package/src/sap/cux/home/TilesPanel.ts +15 -8
  255. package/src/sap/cux/home/ToDoPanel-dbg.js +34 -25
  256. package/src/sap/cux/home/ToDoPanel-dbg.js.map +1 -1
  257. package/src/sap/cux/home/ToDoPanel.d.ts +0 -7
  258. package/src/sap/cux/home/ToDoPanel.d.ts.map +1 -1
  259. package/src/sap/cux/home/ToDoPanel.js +1 -1
  260. package/src/sap/cux/home/ToDoPanel.js.map +1 -1
  261. package/src/sap/cux/home/ToDoPanel.ts +27 -29
  262. package/src/sap/cux/home/ToDosContainer-dbg.js +27 -18
  263. package/src/sap/cux/home/ToDosContainer-dbg.js.map +1 -1
  264. package/src/sap/cux/home/ToDosContainer.d.ts +7 -0
  265. package/src/sap/cux/home/ToDosContainer.d.ts.map +1 -1
  266. package/src/sap/cux/home/ToDosContainer.js +1 -1
  267. package/src/sap/cux/home/ToDosContainer.js.map +1 -1
  268. package/src/sap/cux/home/ToDosContainer.ts +10 -0
  269. package/src/sap/cux/home/ToDosContainerGenericPlaceholder-dbg.js +84 -0
  270. package/src/sap/cux/home/ToDosContainerGenericPlaceholder-dbg.js.map +1 -0
  271. package/src/sap/cux/home/ToDosContainerGenericPlaceholder.d.ts +8 -0
  272. package/src/sap/cux/home/ToDosContainerGenericPlaceholder.d.ts.map +1 -0
  273. package/src/sap/cux/home/ToDosContainerGenericPlaceholder.js +6 -0
  274. package/src/sap/cux/home/ToDosContainerGenericPlaceholder.js.map +1 -0
  275. package/src/sap/cux/home/ToDosContainerGenericPlaceholder.ts +74 -0
  276. package/src/sap/cux/home/i18n/messagebundle.properties +63 -1
  277. package/src/sap/cux/home/i18n/messagebundle_ar.properties +42 -1
  278. package/src/sap/cux/home/i18n/messagebundle_bg.properties +43 -1
  279. package/src/sap/cux/home/i18n/messagebundle_ca.properties +43 -1
  280. package/src/sap/cux/home/i18n/messagebundle_cnr.properties +43 -1
  281. package/src/sap/cux/home/i18n/messagebundle_cs.properties +43 -1
  282. package/src/sap/cux/home/i18n/messagebundle_cy.properties +43 -1
  283. package/src/sap/cux/home/i18n/messagebundle_da.properties +43 -1
  284. package/src/sap/cux/home/i18n/messagebundle_de.properties +43 -1
  285. package/src/sap/cux/home/i18n/messagebundle_el.properties +44 -2
  286. package/src/sap/cux/home/i18n/messagebundle_en.properties +43 -246
  287. package/src/sap/cux/home/i18n/messagebundle_en_GB.properties +43 -1
  288. package/src/sap/cux/home/i18n/messagebundle_en_US_sappsd.properties +43 -1
  289. package/src/sap/cux/home/i18n/messagebundle_en_US_saprigi.properties +31 -1
  290. package/src/sap/cux/home/i18n/messagebundle_en_US_saptrc.properties +43 -1
  291. package/src/sap/cux/home/i18n/messagebundle_es.properties +43 -1
  292. package/src/sap/cux/home/i18n/messagebundle_es_MX.properties +43 -1
  293. package/src/sap/cux/home/i18n/messagebundle_et.properties +43 -1
  294. package/src/sap/cux/home/i18n/messagebundle_fi.properties +43 -1
  295. package/src/sap/cux/home/i18n/messagebundle_fr.properties +43 -1
  296. package/src/sap/cux/home/i18n/messagebundle_fr_CA.properties +42 -1
  297. package/src/sap/cux/home/i18n/messagebundle_hi.properties +43 -1
  298. package/src/sap/cux/home/i18n/messagebundle_hr.properties +42 -1
  299. package/src/sap/cux/home/i18n/messagebundle_hu.properties +43 -1
  300. package/src/sap/cux/home/i18n/messagebundle_id.properties +47 -5
  301. package/src/sap/cux/home/i18n/messagebundle_it.properties +43 -1
  302. package/src/sap/cux/home/i18n/messagebundle_iw.properties +43 -1
  303. package/src/sap/cux/home/i18n/messagebundle_ja.properties +43 -1
  304. package/src/sap/cux/home/i18n/messagebundle_kk.properties +43 -1
  305. package/src/sap/cux/home/i18n/messagebundle_ko.properties +43 -1
  306. package/src/sap/cux/home/i18n/messagebundle_lt.properties +42 -1
  307. package/src/sap/cux/home/i18n/messagebundle_lv.properties +43 -1
  308. package/src/sap/cux/home/i18n/messagebundle_mk.properties +43 -1
  309. package/src/sap/cux/home/i18n/messagebundle_ms.properties +43 -1
  310. package/src/sap/cux/home/i18n/messagebundle_nl.properties +43 -1
  311. package/src/sap/cux/home/i18n/messagebundle_no.properties +44 -2
  312. package/src/sap/cux/home/i18n/messagebundle_pl.properties +44 -2
  313. package/src/sap/cux/home/i18n/messagebundle_pt.properties +43 -1
  314. package/src/sap/cux/home/i18n/messagebundle_pt_PT.properties +43 -1
  315. package/src/sap/cux/home/i18n/messagebundle_ro.properties +43 -1
  316. package/src/sap/cux/home/i18n/messagebundle_ru.properties +43 -1
  317. package/src/sap/cux/home/i18n/messagebundle_sh.properties +43 -1
  318. package/src/sap/cux/home/i18n/messagebundle_sk.properties +42 -1
  319. package/src/sap/cux/home/i18n/messagebundle_sl.properties +44 -2
  320. package/src/sap/cux/home/i18n/messagebundle_sr.properties +43 -1
  321. package/src/sap/cux/home/i18n/messagebundle_sv.properties +43 -1
  322. package/src/sap/cux/home/i18n/messagebundle_th.properties +43 -2
  323. package/src/sap/cux/home/i18n/messagebundle_tr.properties +42 -1
  324. package/src/sap/cux/home/i18n/messagebundle_uk.properties +43 -1
  325. package/src/sap/cux/home/i18n/messagebundle_vi.properties +42 -1
  326. package/src/sap/cux/home/i18n/messagebundle_zh_CN.properties +43 -1
  327. package/src/sap/cux/home/i18n/messagebundle_zh_TW.properties +42 -1
  328. package/src/sap/cux/home/interface/AppsInterface-dbg.js.map +1 -1
  329. package/src/sap/cux/home/interface/AppsInterface.d.ts +5 -3
  330. package/src/sap/cux/home/interface/AppsInterface.d.ts.map +1 -1
  331. package/src/sap/cux/home/interface/AppsInterface.ts +5 -3
  332. package/src/sap/cux/home/interface/CardsInterface-dbg.js +32 -0
  333. package/src/sap/cux/home/interface/CardsInterface-dbg.js.map +1 -1
  334. package/src/sap/cux/home/interface/CardsInterface.d.ts +320 -55
  335. package/src/sap/cux/home/interface/CardsInterface.d.ts.map +1 -1
  336. package/src/sap/cux/home/interface/CardsInterface.js +5 -1
  337. package/src/sap/cux/home/interface/CardsInterface.js.map +1 -1
  338. package/src/sap/cux/home/interface/CardsInterface.ts +359 -55
  339. package/src/sap/cux/home/library-preload.js +88 -45
  340. package/src/sap/cux/home/library-preload.js.map +1 -1
  341. package/src/sap/cux/home/manifest.json +4 -4
  342. package/src/sap/cux/home/themes/base/AppsContainer.less +12 -0
  343. package/src/sap/cux/home/themes/base/BaseLayout.less +1 -0
  344. package/src/sap/cux/home/themes/base/ContentAdditionDialog.less +69 -0
  345. package/src/sap/cux/home/themes/base/NewsAndPagesContainer.less +37 -12
  346. package/src/sap/cux/home/themes/base/PlaceHolder.less +1374 -0
  347. package/src/sap/cux/home/themes/base/ToDosContainer.less +1 -1
  348. package/src/sap/cux/home/themes/base/library-RTL.css +2 -2
  349. package/src/sap/cux/home/themes/base/library-parameters.json +1 -1
  350. package/src/sap/cux/home/themes/base/library.css +2 -2
  351. package/src/sap/cux/home/themes/base/library.source.less +2 -0
  352. package/src/sap/cux/home/themes/sap_fiori_3/library-RTL.css +2 -2
  353. package/src/sap/cux/home/themes/sap_fiori_3/library-parameters.json +1 -1
  354. package/src/sap/cux/home/themes/sap_fiori_3/library.css +2 -2
  355. package/src/sap/cux/home/themes/sap_fiori_3_dark/library-RTL.css +2 -2
  356. package/src/sap/cux/home/themes/sap_fiori_3_dark/library-parameters.json +1 -1
  357. package/src/sap/cux/home/themes/sap_fiori_3_dark/library.css +2 -2
  358. package/src/sap/cux/home/themes/sap_fiori_3_hcb/AppsContainer.less +1 -0
  359. package/src/sap/cux/home/themes/sap_fiori_3_hcb/library-RTL.css +2 -2
  360. package/src/sap/cux/home/themes/sap_fiori_3_hcb/library-parameters.json +1 -1
  361. package/src/sap/cux/home/themes/sap_fiori_3_hcb/library.css +2 -2
  362. package/src/sap/cux/home/themes/sap_fiori_3_hcb/library.source.less +2 -0
  363. package/src/sap/cux/home/themes/sap_fiori_3_hcw/AppsContainer.less +1 -0
  364. package/src/sap/cux/home/themes/sap_fiori_3_hcw/library-RTL.css +2 -2
  365. package/src/sap/cux/home/themes/sap_fiori_3_hcw/library-parameters.json +1 -1
  366. package/src/sap/cux/home/themes/sap_fiori_3_hcw/library.css +2 -2
  367. package/src/sap/cux/home/themes/sap_fiori_3_hcw/library.source.less +2 -0
  368. package/src/sap/cux/home/themes/sap_horizon/library-RTL.css +2 -2
  369. package/src/sap/cux/home/themes/sap_horizon/library-parameters.json +1 -1
  370. package/src/sap/cux/home/themes/sap_horizon/library.css +2 -2
  371. package/src/sap/cux/home/themes/sap_horizon_dark/library-RTL.css +2 -2
  372. package/src/sap/cux/home/themes/sap_horizon_dark/library-parameters.json +1 -1
  373. package/src/sap/cux/home/themes/sap_horizon_dark/library.css +2 -2
  374. package/src/sap/cux/home/themes/sap_horizon_hcb/AppsContainer.less +1 -0
  375. package/src/sap/cux/home/themes/sap_horizon_hcb/library-RTL.css +2 -2
  376. package/src/sap/cux/home/themes/sap_horizon_hcb/library-parameters.json +1 -1
  377. package/src/sap/cux/home/themes/sap_horizon_hcb/library.css +2 -2
  378. package/src/sap/cux/home/themes/sap_horizon_hcb/library.source.less +2 -0
  379. package/src/sap/cux/home/themes/sap_horizon_hcw/AppsContainer.less +1 -0
  380. package/src/sap/cux/home/themes/sap_horizon_hcw/library-RTL.css +2 -2
  381. package/src/sap/cux/home/themes/sap_horizon_hcw/library-parameters.json +1 -1
  382. package/src/sap/cux/home/themes/sap_horizon_hcw/library.css +2 -2
  383. package/src/sap/cux/home/themes/sap_horizon_hcw/library.source.less +2 -0
  384. package/src/sap/cux/home/utils/AppManager-dbg.js +405 -440
  385. package/src/sap/cux/home/utils/AppManager-dbg.js.map +1 -1
  386. package/src/sap/cux/home/utils/AppManager.d.ts +88 -124
  387. package/src/sap/cux/home/utils/AppManager.d.ts.map +1 -1
  388. package/src/sap/cux/home/utils/AppManager.js +1 -1
  389. package/src/sap/cux/home/utils/AppManager.js.map +1 -1
  390. package/src/sap/cux/home/utils/AppManager.ts +351 -542
  391. package/src/sap/cux/home/utils/Constants-dbg.js +25 -1
  392. package/src/sap/cux/home/utils/Constants-dbg.js.map +1 -1
  393. package/src/sap/cux/home/utils/Constants.d.ts +17 -0
  394. package/src/sap/cux/home/utils/Constants.d.ts.map +1 -1
  395. package/src/sap/cux/home/utils/Constants.js +1 -1
  396. package/src/sap/cux/home/utils/Constants.js.map +1 -1
  397. package/src/sap/cux/home/utils/Constants.ts +20 -1
  398. package/src/sap/cux/home/utils/Device-dbg.js +49 -1
  399. package/src/sap/cux/home/utils/Device-dbg.js.map +1 -1
  400. package/src/sap/cux/home/utils/Device.d.ts +13 -0
  401. package/src/sap/cux/home/utils/Device.d.ts.map +1 -1
  402. package/src/sap/cux/home/utils/Device.js +1 -1
  403. package/src/sap/cux/home/utils/Device.js.map +1 -1
  404. package/src/sap/cux/home/utils/Device.ts +58 -1
  405. package/src/sap/cux/home/utils/InsightsUtils-dbg.js +25 -0
  406. package/src/sap/cux/home/utils/InsightsUtils-dbg.js.map +1 -1
  407. package/src/sap/cux/home/utils/InsightsUtils.d.ts +14 -0
  408. package/src/sap/cux/home/utils/InsightsUtils.d.ts.map +1 -1
  409. package/src/sap/cux/home/utils/InsightsUtils.js +1 -1
  410. package/src/sap/cux/home/utils/InsightsUtils.js.map +1 -1
  411. package/src/sap/cux/home/utils/InsightsUtils.ts +25 -0
  412. package/src/sap/cux/home/utils/PerformanceUtils-dbg.js +5 -2
  413. package/src/sap/cux/home/utils/PerformanceUtils-dbg.js.map +1 -1
  414. package/src/sap/cux/home/utils/PerformanceUtils.d.ts +1 -0
  415. package/src/sap/cux/home/utils/PerformanceUtils.d.ts.map +1 -1
  416. package/src/sap/cux/home/utils/PerformanceUtils.js +1 -1
  417. package/src/sap/cux/home/utils/PerformanceUtils.js.map +1 -1
  418. package/src/sap/cux/home/utils/PerformanceUtils.ts +5 -1
  419. package/src/sap/cux/home/utils/RecommendedCardUtil-dbg.js +1599 -0
  420. package/src/sap/cux/home/utils/RecommendedCardUtil-dbg.js.map +1 -0
  421. package/src/sap/cux/home/utils/RecommendedCardUtil.d.ts +534 -0
  422. package/src/sap/cux/home/utils/RecommendedCardUtil.d.ts.map +1 -0
  423. package/src/sap/cux/home/utils/RecommendedCardUtil.js +6 -0
  424. package/src/sap/cux/home/utils/RecommendedCardUtil.js.map +1 -0
  425. package/src/sap/cux/home/utils/RecommendedCardUtil.ts +1945 -0
  426. package/src/sap/cux/home/utils/SituationUtils-dbg.js +1 -1
  427. package/src/sap/cux/home/utils/SituationUtils-dbg.js.map +1 -1
  428. package/src/sap/cux/home/utils/SituationUtils.js +1 -1
  429. package/src/sap/cux/home/utils/SituationUtils.js.map +1 -1
  430. package/src/sap/cux/home/utils/SituationUtils.ts +1 -1
  431. package/src/sap/cux/home/utils/UshellPersonalizer-dbg.js.map +1 -1
  432. package/src/sap/cux/home/utils/UshellPersonalizer.d.ts +4 -1
  433. package/src/sap/cux/home/utils/UshellPersonalizer.d.ts.map +1 -1
  434. package/src/sap/cux/home/utils/UshellPersonalizer.js.map +1 -1
  435. package/src/sap/cux/home/utils/UshellPersonalizer.ts +2 -1
  436. package/src/sap/cux/home/utils/fragment/appsAdditionContent.fragment.xml +126 -0
@@ -0,0 +1,1599 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+ * * (c) Copyright 2009-2025 SAP SE. All rights reserved
4
+ */
5
+ sap.ui.define(["sap/base/i18n/Formatting", "sap/base/Log", "sap/base/security/encodeURL", "sap/base/strings/formatMessage", "sap/base/util/deepExtend", "sap/ui/base/Object", "sap/ui/core/library", "../interface/CardsInterface", "./Constants", "./DataFormatUtils"], function (Formatting, Log, encodeURL, formatMessage, deepExtend, BaseObject, CoreLib, ___interface_CardsInterface, ___Constants, ___DataFormatUtils) {
6
+ "use strict";
7
+
8
+ const UIAnnotations = ___interface_CardsInterface["UIAnnotations"];
9
+ const TABLE_TYPES = ___Constants["TABLE_TYPES"];
10
+ const sortCollectionByImportance = ___DataFormatUtils["sortCollectionByImportance"];
11
+ const COLUMN_LENGTH = 3;
12
+ const ValueState = CoreLib.ValueState;
13
+ var FieldAnnotationsType = /*#__PURE__*/function (FieldAnnotationsType) {
14
+ FieldAnnotationsType["DataField"] = "com.sap.vocabularies.UI.v1.DataField";
15
+ FieldAnnotationsType["Importance"] = "com.sap.vocabularies.UI.v1.Importance";
16
+ FieldAnnotationsType["DataFieldWithNavigationPath"] = "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath";
17
+ FieldAnnotationsType["DataFieldWithIntentBasedNavigation"] = "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation";
18
+ FieldAnnotationsType["DataFieldForIntentBasedNavigation"] = "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation";
19
+ FieldAnnotationsType["Chart"] = "@com.sap.vocabularies.UI.v1.Chart";
20
+ FieldAnnotationsType["FieldGroup"] = "@com.sap.vocabularies.UI.v1.FieldGroup";
21
+ FieldAnnotationsType["DataPoint"] = "@com.sap.vocabularies.UI.v1.DataPoint";
22
+ FieldAnnotationsType["Contact"] = "@com.sap.vocabularies.Communication.v1.Contact";
23
+ FieldAnnotationsType["DataFieldForAction"] = "com.sap.vocabularies.UI.v1.DataFieldForAction";
24
+ FieldAnnotationsType["DataFieldForAnnotation"] = "com.sap.vocabularies.UI.v1.DataFieldForAnnotation";
25
+ FieldAnnotationsType["DataFieldWithUrl"] = "com.sap.vocabularies.UI.v1.DataFieldWithUrl";
26
+ FieldAnnotationsType["CriticalityRepresentationTypeWithoutIcon"] = "com.sap.vocabularies.UI.v1.CriticalityRepresentationType/WithoutIcon";
27
+ FieldAnnotationsType["FieldControlHiddenType"] = "com.sap.vocabularies.Common.v1.FieldControlType/Hidden";
28
+ return FieldAnnotationsType;
29
+ }(FieldAnnotationsType || {});
30
+ var FieldTypes = /*#__PURE__*/function (FieldTypes) {
31
+ FieldTypes["DataFieldWithNavigationPath"] = "DataFieldWithNavigationPath";
32
+ FieldTypes["DataFieldWithIntentBasedNavigation"] = "DataFieldWithIntentBasedNavigation";
33
+ FieldTypes["DataFieldForIntentBasedNavigation"] = "DataFieldForIntentBasedNavigation";
34
+ FieldTypes["DataFieldForAction"] = "DataFieldForAction";
35
+ FieldTypes["DataFieldForAnnotation"] = "DataFieldForAnnotation";
36
+ return FieldTypes;
37
+ }(FieldTypes || {});
38
+ class RecommendedCardUtil extends BaseObject {
39
+ static getInstance() {
40
+ if (!RecommendedCardUtil.Instance) {
41
+ RecommendedCardUtil.Instance = new RecommendedCardUtil();
42
+ }
43
+ return RecommendedCardUtil.Instance;
44
+ }
45
+
46
+ /**
47
+ * @param {object} metaModel - metamodel object
48
+ * @param {object} originalManifest - manifest of original app
49
+ * @param {string} leadingEntitySet - main entitySet of the application as in manifest
50
+ * @returns {object} - returns the lineItem details for the application based on manifest, annotations and metadata
51
+ * @private
52
+ */
53
+ getLineItemDetails(metaModel, originalManifest, leadingEntitySet) {
54
+ const leadingEntitySetDetails = metaModel.getODataEntitySet(leadingEntitySet);
55
+ const variantInfo = this.getLineItemFromVariant(metaModel, leadingEntitySetDetails.entityType);
56
+ const lineItemDefault = variantInfo.lineItem;
57
+ const pages = originalManifest["sap.ui.generic.app"]?.pages;
58
+ const lrSettings = this.getSettingsForPage(pages);
59
+
60
+ //if there is no quickVariantSelectionX setting in manifest, then return default line item details
61
+ if (!lrSettings.quickVariantSelectionX) {
62
+ return this.createDefaultLineItemDetails(metaModel, variantInfo, lrSettings, leadingEntitySet, lineItemDefault);
63
+ }
64
+
65
+ // if there is a variant settings then find the first non-smart chart variant
66
+ const oVariants = lrSettings.quickVariantSelectionX.variants || {};
67
+ const {
68
+ firstAvailableKey,
69
+ sEntitySet,
70
+ oVariant
71
+ } = this.findFirstNonSmartChartVariant(metaModel, oVariants, leadingEntitySet);
72
+ if (oVariant.isSmartChart) {
73
+ return this.createDefaultLineItemDetails(metaModel, variantInfo, lrSettings, leadingEntitySet, lineItemDefault);
74
+ }
75
+ delete lrSettings.requestAtLeastFields;
76
+ const defaultTableSettings = this.getNormalizedTableSettings(metaModel, lrSettings, leadingEntitySet);
77
+ const entitySet = metaModel?.getODataEntitySet(sEntitySet);
78
+ const quickVariantInfo = this.getLineItemFromVariant(metaModel, entitySet.entityType, oVariant.annotationPath?.split("#")[1]);
79
+ const lineItem = quickVariantInfo.lineItem;
80
+ const presentationVariant = quickVariantInfo.presentationVariant;
81
+ lrSettings.requestAtLeastFields = presentationVariant?.RequestAtLeast?.length ? presentationVariant.RequestAtLeast : this._getRequestAtLeastFields(presentationVariant);
82
+ oVariant.tableSettings = this.getNormalizedTableSettings(metaModel, {
83
+ ...oVariant,
84
+ tableSettings: oVariant.tableSettings || defaultTableSettings
85
+ }, sEntitySet);
86
+ this.validateResponsiveTable(lrSettings, oVariant, firstAvailableKey);
87
+ delete lrSettings.tableSettings;
88
+ lrSettings.isResponsiveTable = lrSettings.isResponsiveTable === undefined || lrSettings.isResponsiveTable;
89
+ const lineItemDetail = {
90
+ quickVariant: oVariant,
91
+ lrSettings: lrSettings,
92
+ lineItem: lineItem,
93
+ entitySet: sEntitySet,
94
+ headerInfo: oVariant?.tableSettings?.headerInfo || ""
95
+ };
96
+ return lineItem ? lineItemDetail : this.createDefaultLineItemDetails(metaModel, variantInfo, lrSettings, leadingEntitySet, lineItemDefault);
97
+ }
98
+
99
+ /**
100
+ * Finds the first non-smart chart variant from the provided variants.
101
+ *
102
+ * This method iterates through the given variants to identify the first variant that is not a smart chart.
103
+ * It also determines the associated entity set and updates the variant's metadata to indicate whether it is a smart chart.
104
+ *
105
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about entities and annotations.
106
+ * @param {Record<string, IVariantSetting>} oVariants - A record of variants, where each key represents a variant and its associated metadata.
107
+ * @param {string} leadingEntitySet - The name of the leading entity set for the application.
108
+ * @returns {NonChartDetail}
109
+ }
110
+ * An object containing:
111
+ * - `firstAvailableKey`: The key of the first non-smart chart variant, or `null` if none is found.
112
+ * - `sEntitySet`: The entity set associated with the first non-smart chart variant.
113
+ * - `oVariant`: The metadata of the first non-smart chart variant.
114
+ * @private
115
+ */
116
+ findFirstNonSmartChartVariant(metaModel, oVariants, leadingEntitySet) {
117
+ let firstAvailableKey = null;
118
+ let sEntitySet = leadingEntitySet;
119
+ let oVariant = {};
120
+ for (const sKey in oVariants) {
121
+ if (!Object.prototype.hasOwnProperty.call(oVariants, sKey)) continue;
122
+ oVariant = oVariants[sKey];
123
+ sEntitySet = oVariant.entitySet || leadingEntitySet;
124
+ const oEntitySet = metaModel.getODataEntitySet(sEntitySet);
125
+ if (oEntitySet) {
126
+ oVariant.isSmartChart = this.checkIfSmartChart(metaModel, sEntitySet, oVariant);
127
+ if (!oVariant.isSmartChart) {
128
+ firstAvailableKey = sKey;
129
+ break;
130
+ }
131
+ } else {
132
+ oVariant.isSmartChart = true;
133
+ }
134
+ }
135
+ return {
136
+ firstAvailableKey,
137
+ sEntitySet,
138
+ oVariant
139
+ };
140
+ }
141
+
142
+ /**
143
+ * Validates the responsive table type for a given variant and updates the List Report (LR) settings.
144
+ *
145
+ * @param {ILrSettings} lrSettings - The settings object for the List Report, including table settings and configurations.
146
+ * @param {IVariantSetting} oVariant - The variant object containing table settings and metadata.
147
+ * @param {string | null} firstAvailableKey - The key of the first available variant, used for logging errors.
148
+ * @returns {void}
149
+ * @private
150
+ */
151
+ validateResponsiveTable(lrSettings, oVariant, firstAvailableKey) {
152
+ const isResponsive = oVariant.tableSettings?.type === TABLE_TYPES.RESPONSIVE;
153
+ if (lrSettings.isResponsiveTable === undefined) {
154
+ lrSettings.isResponsiveTable = isResponsive;
155
+ } else if (lrSettings.isResponsiveTable !== isResponsive) {
156
+ Log.error(`Variant with key ${firstAvailableKey} resulted in invalid Table Type combination.`);
157
+ }
158
+ }
159
+
160
+ /**
161
+ *
162
+ * This method generates the default configuration for line item details, including table settings,
163
+ * responsive table type, and request-at-least fields based on the provided metadata, variant information,
164
+ * and settings.
165
+ *
166
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about entities and annotations.
167
+ * @param {VariantInfo} variantInfo - The variant information containing presentation variant and line item details.
168
+ * @param {ILrSettings} lrSettings - The settings object for the List Report, including table settings and other configurations.
169
+ * @param {string} leadingEntitySet - The name of the leading entity set for the application.
170
+ * @param {ILineItem[] | string | undefined} lineItemDefault - The default line item details, which can be an array of line items, a string, or undefined.
171
+ * @returns {ILineItemDetails} The default line item details object, including quick variant, settings, line item, entity set, and header info.
172
+ * @private
173
+ */
174
+ createDefaultLineItemDetails(metaModel, variantInfo, lrSettings, leadingEntitySet, lineItemDefault) {
175
+ lrSettings.tableSettings = this.getNormalizedTableSettings(metaModel, lrSettings, leadingEntitySet);
176
+ lrSettings.isResponsiveTable = lrSettings.tableSettings.type === TABLE_TYPES.RESPONSIVE;
177
+ if (variantInfo?.presentationVariant?.RequestAtLeast?.length) {
178
+ lrSettings.requestAtLeastFields = variantInfo.presentationVariant.RequestAtLeast;
179
+ }
180
+ return {
181
+ quickVariant: {},
182
+ lrSettings: lrSettings,
183
+ lineItem: lineItemDefault,
184
+ entitySet: leadingEntitySet,
185
+ headerInfo: lrSettings?.tableSettings?.headerInfo || ""
186
+ };
187
+ }
188
+
189
+ /**
190
+ * @param {object} oMetaModel - metamodel object
191
+ * @param {string} entityType - entity type of the application
192
+ * @param {string} qualifier - qualifier of the variant
193
+ * @returns {object} - returns the lineItem, presentationVariant, qualifierPath from the variant for the application based on manifest, annotations and metadata
194
+ * @private
195
+ */
196
+ getLineItemFromVariant(oMetaModel, entityType, qualifier) {
197
+ const oSelectionPresentationVariant = this.getAnnotation(oMetaModel, entityType, UIAnnotations.UISelectionPresentationVariant, qualifier);
198
+ let oPresentationVariant;
199
+ if (oSelectionPresentationVariant?.PresentationVariant) {
200
+ oPresentationVariant = this.getPresentationVariant(oMetaModel, entityType, oSelectionPresentationVariant.PresentationVariant);
201
+ } else {
202
+ oPresentationVariant = this.getAnnotation(oMetaModel, entityType, UIAnnotations.UIPresentationVariant, qualifier);
203
+ }
204
+ const oDetails = oPresentationVariant ? this.getLineItem(oMetaModel, entityType, oPresentationVariant) : null;
205
+ const lineItem = oDetails?.lineItem || this.getAnnotation(oMetaModel, entityType, UIAnnotations.UILineItem, "");
206
+ return {
207
+ presentationVariant: oPresentationVariant,
208
+ lineItem: lineItem,
209
+ qualifierPath: oDetails?.annotationPath || ""
210
+ };
211
+ }
212
+
213
+ // get the annotation , sAnnotation from the entityType, sEntityType
214
+ getAnnotation(metaModel, entityType, annotation, qualifierName) {
215
+ const fullAnnotation = `${annotation}${qualifierName ? `#${qualifierName}` : ""}`;
216
+ const entityTypeData = metaModel.getODataEntityType(entityType);
217
+ return entityTypeData?.[fullAnnotation];
218
+ }
219
+
220
+ /**
221
+ * This method determines the presentation variant based on the provided selection presentation variant.
222
+ * If the presentation variant is defined via a `Path`, it resolves the path to retrieve the corresponding object
223
+ * from the OData meta model. If the presentation variant is defined inline (i.e., without a `Path`), it directly
224
+ * returns the inline object.
225
+ *
226
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about entities and annotations.
227
+ * @param {string} entityTypeData - The entity type for which the presentation variant is to be retrieved.
228
+ * @param {IPresentationVariant} selectionPresentationVariant -
229
+ * The selection presentation variant object, which may contain a `Path` or an inline `PresentationVariant`.
230
+ * @returns {IPresentationVariant} The resolved presentation variant object.
231
+ * @private
232
+ */
233
+ getPresentationVariant(metaModel, entityTypeData, selectionPresentationVariant) {
234
+ // PresentationVariant must be defined (according to vocabulary) either via "Path" or inline (i.e. Path is not defined).
235
+ // For compatibility, just ignore if not provided (leading to fallback to use LineItem without qualifier)
236
+ const presentationVariant = selectionPresentationVariant?.PresentationVariant;
237
+ if (presentationVariant?.Path) {
238
+ return this.getObject(metaModel, entityTypeData, presentationVariant.Path);
239
+ }
240
+ return presentationVariant;
241
+ }
242
+
243
+ /**
244
+ * Retrieves the line item annotation details for a given entity type and presentation variant.
245
+ *
246
+ * This method searches for the `com.sap.vocabularies.UI.v1.LineItem` annotation within the visualizations
247
+ * of the provided presentation variant. If found, it returns the line item details, including the annotation path
248
+ * and qualifier.
249
+ *
250
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about the entity type.
251
+ * @param {string} entityTypeData - The entity type for which the line item annotation is to be retrieved.
252
+ * @param {IPresentationVariant} presentationVariantData - The presentation variant containing visualizations.
253
+ * @returns { IUIVisualizations | IUIVisualizations[] | null}
254
+ * - An object containing the line item details, annotation path, and qualifier if the annotation is found.
255
+ * - An array of UI annotations if applicable.
256
+ * - `null` if no valid line item annotation is found.
257
+ * @private
258
+ */
259
+ getLineItem(metaModel, entityTypeData, presentationVariantData) {
260
+ // Visualizations must be defined (according to vocabulary)
261
+ // however, this is not given at least in all demokit apps (presentationVariant consisting only of sortOrder)
262
+ let visualizationData = presentationVariantData.Visualizations?.find(function (oVis) {
263
+ return oVis.AnnotationPath?.includes(UIAnnotations.UILineItem);
264
+ });
265
+ return visualizationData ? {
266
+ lineItem: this.getObject(metaModel, entityTypeData, visualizationData.AnnotationPath),
267
+ annotationPath: visualizationData.AnnotationPath,
268
+ sQualifier: visualizationData.AnnotationPath?.split("#")[1]
269
+ } : null;
270
+ }
271
+
272
+ /**
273
+ * Extracts relevant column paths for `$select` and `$expand` OData query options.
274
+ *
275
+ * This method processes the provided column definitions to extract paths for the `$select` and `$expand` query options.
276
+ * It ensures that paths are unique and properly formatted for OData requests.
277
+ *
278
+ * @param {Array<Record<string,unknown>>} columns - An array of column definitions.
279
+ * Each column definition may include properties like `leadingProperty`, `additionalProperty`, and `navigationProperty`.
280
+ * @returns {SelectExpand} An object containing two arrays:
281
+ * - `select`: An array of unique paths for the `$select` query option.
282
+ * - `expand`: An array of unique paths for the `$expand` query option.
283
+ * @private
284
+ */
285
+ _getRelevantColumnPaths(columns) {
286
+ columns = Array.isArray(columns) ? columns : [];
287
+ const selectSet = new Set();
288
+ const expandSet = new Set();
289
+ columns.forEach(oColumnData => {
290
+ if (oColumnData) {
291
+ const sPath = oColumnData["leadingProperty"];
292
+ const sAdditionalPath = oColumnData["additionalProperty"];
293
+ const sExpandPath = oColumnData["navigationProperty"];
294
+ if (sPath) {
295
+ selectSet.add(sPath);
296
+ }
297
+ this.extractPathAndInsertToSet(sAdditionalPath, selectSet);
298
+ this.extractPathAndInsertToSet(sExpandPath, expandSet);
299
+ }
300
+ });
301
+ return {
302
+ select: Array.from(selectSet),
303
+ expand: Array.from(expandSet)
304
+ };
305
+ }
306
+
307
+ /**
308
+ * Extracts and inserts unique paths into the provided array.
309
+ *
310
+ * This method splits the given path string by commas, iterates through the resulting paths,
311
+ * and adds each unique path to the provided array. Duplicate paths are ignored.
312
+ *
313
+ * @param {string} sPath - A comma-separated string of paths to be processed.
314
+ * @param {Set<string>} - The array to which unique paths will be added.
315
+ * @private
316
+ */
317
+ extractPathAndInsertToSet(sPath, pathSet) {
318
+ sPath?.split(",").forEach(path => {
319
+ if (path) {
320
+ pathSet.add(path);
321
+ // currently not doing transitive dependencies
322
+ }
323
+ });
324
+ }
325
+
326
+ /**
327
+ * Expands navigation properties for the given entity set and selected properties.
328
+ *
329
+ * This method processes the provided `selects` array to identify navigation properties
330
+ * that need to be expanded. If a navigation property is found, it is added to the `expands` array.
331
+ *
332
+ * @param {string} entitySetName - The name of the entity set being processed.
333
+ * @param {string[]} selects - An array of selected property paths to be checked for navigation properties.
334
+ * @param {string[]} expands - An array to which navigation properties requiring expansion will be added.
335
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about entities and properties.
336
+ * @private
337
+ */
338
+ extractAndExpandNavigationProperty(entitySetName, selects, expands, metaModel) {
339
+ const mNavigationProperties = {};
340
+
341
+ // check if any expand is necessary
342
+ for (const sPath of selects) {
343
+ let iPos = sPath.lastIndexOf("/");
344
+ let sNavigation;
345
+ if (iPos < 0) {
346
+ // sPath contains no '/' but still could be a navigationProperty
347
+ if (!this.getNavigationProperty(entitySetName, sPath, metaModel, mNavigationProperties)) {
348
+ continue; //not a navproperty hence continue to next iteration
349
+ }
350
+ sNavigation = sPath;
351
+ } else {
352
+ sNavigation = sPath.substring(0, iPos);
353
+ }
354
+ if (!expands.includes(sNavigation)) {
355
+ expands.push(sNavigation);
356
+ }
357
+ }
358
+ }
359
+
360
+ //get the navigation property details for the given property from entityset, sEntitySet
361
+ getNavigationProperty(entitySetName, navProperty, metaModel, mNavigationProperties) {
362
+ let mMyNavigationProperties = mNavigationProperties?.[entitySetName];
363
+
364
+ // If navigation properties not already fetched, then fetch them
365
+ if (!mMyNavigationProperties) {
366
+ mMyNavigationProperties = {};
367
+ mNavigationProperties[entitySetName] = mMyNavigationProperties;
368
+ const oEntitySet = metaModel.getODataEntitySet(entitySetName);
369
+ if (oEntitySet) {
370
+ const oEntityType = metaModel.getODataEntityType(oEntitySet.entityType);
371
+ if (oEntityType) {
372
+ const aNavigationProperty = oEntityType.navigationProperty || [];
373
+ aNavigationProperty.forEach(oNavigationProperty => {
374
+ const navName = oNavigationProperty.name;
375
+ mMyNavigationProperties[navName] = oNavigationProperty;
376
+ });
377
+ }
378
+ }
379
+ }
380
+ return mMyNavigationProperties?.[navProperty] || undefined;
381
+ }
382
+
383
+ // add all necessary fields to the select array
384
+ _addNecessaryFields(aSelects, oInfo, oMetaModel) {
385
+ let oEntitySet = oMetaModel.getODataEntitySet(oInfo.entitySet);
386
+ let oEntityType = oMetaModel.getODataEntityType(oEntitySet.entityType);
387
+ let aProperties = [];
388
+ if (aSelects.length > 0) {
389
+ if (oInfo.lineItem && typeof oInfo.lineItem !== "string") {
390
+ oInfo.lineItem.forEach(lineItem => {
391
+ if (lineItem.RecordType === FieldAnnotationsType.DataFieldWithIntentBasedNavigation || lineItem.RecordType === FieldAnnotationsType.DataFieldWithNavigationPath) {
392
+ const aDataFieldsWithNavigation = this.getDataFieldsWithNavigation(lineItem, oMetaModel, oEntityType);
393
+ if (aDataFieldsWithNavigation?.length) {
394
+ aProperties = aProperties.concat(aDataFieldsWithNavigation);
395
+ }
396
+ }
397
+ });
398
+ }
399
+ //add the fieldcontrol path of the properties
400
+ this.getFieldControlsPath(aSelects, oMetaModel, oEntityType, aProperties);
401
+ }
402
+ aProperties.forEach(property => {
403
+ this.ensureSelectionProperty(property, aSelects);
404
+ });
405
+ }
406
+
407
+ /**
408
+ * Collects the paths for field controls based on the selected properties.
409
+ * This function iterates over the given selection of properties, aSelects, retrieves the corresponding
410
+ * property metadata from the OData model, and if a field control annotation exists for a property,
411
+ * it adds the path of this field control to the provided array of properties.
412
+ * @param {string[]} selects - An array of property names to be checked for field control paths.
413
+ * @param {object} metaModel - The OData meta model instance used to retrieve property metadata.
414
+ * @param {object} entityType - The entity type from the OData model that contains the properties.
415
+ * @param {string[]} aProperties - An array to which the field control paths will be added.
416
+ * @private
417
+ */
418
+ getFieldControlsPath(selects, metaModel, entityType, aProperties) {
419
+ selects.forEach(sSelect => {
420
+ if (sSelect) {
421
+ //needed for activating field control for DataField Annotation & when using the setting to add new columns
422
+ let oProperty = metaModel.getODataProperty(entityType, sSelect) || {};
423
+ if (UIAnnotations.CommonFieldControl in oProperty) {
424
+ let oFieldControl = oProperty[UIAnnotations.CommonFieldControl];
425
+ if (oFieldControl?.Path) {
426
+ aProperties.push(oFieldControl.Path);
427
+ }
428
+ }
429
+ }
430
+ });
431
+ }
432
+
433
+ /**
434
+ * Handling for DataFieldWithNavigationPath and DataFieldWithIntentBasedNavigation
435
+ * @param {object} lineItem - LineItem object
436
+ * @param {object} metaModel - OData metamodel
437
+ * @param {object} entityType - EntityType object
438
+ * @returns {Array} - Array of properties to be selected in case field type is DataFieldWithNavigationPath or DataFieldWithIntentBasedNavigation
439
+ * @private
440
+ */
441
+ getDataFieldsWithNavigation(lineItem, metaModel, entityType) {
442
+ const requestFields = [];
443
+
444
+ // Handle Value.Path
445
+ const valuePath = lineItem.Value?.Path;
446
+ if (valuePath) {
447
+ const lineItemProperty = metaModel.getODataProperty(entityType, valuePath);
448
+ const textAnnotation = lineItemProperty?.[UIAnnotations.CommonText]?.Path;
449
+ const sapTextAnnotation = lineItemProperty?.["sap:text"];
450
+ requestFields.push(sapTextAnnotation || textAnnotation || valuePath);
451
+ }
452
+
453
+ // Handle SemanticObject.Path
454
+ if (lineItem.SemanticObject?.Path) {
455
+ requestFields.push(lineItem.SemanticObject.Path);
456
+ }
457
+
458
+ // Handle Action.Path
459
+ if (lineItem.Action?.Path) {
460
+ requestFields.push(lineItem.Action.Path);
461
+ }
462
+ return requestFields;
463
+ }
464
+
465
+ // Section: Parameter Handling
466
+ getParameters(oInfo, metaModel, entitySet, oSelectExpand) {
467
+ let aSelects = oSelectExpand.select || [];
468
+ let aExpands = oSelectExpand.expand || [];
469
+ let alwaysSelectField = oInfo?.lrSettings?.requestAtLeastFields || [];
470
+ if (alwaysSelectField.length > 0) {
471
+ aSelects = this._ensureSelectionProperties(aSelects, alwaysSelectField);
472
+ }
473
+ this._handleMandatorySelectionFields(entitySet, aSelects, metaModel);
474
+ this._addNecessaryFields(aSelects, oInfo, metaModel);
475
+ this.extractAndExpandNavigationProperty(entitySet, aSelects, aExpands, metaModel);
476
+ return {
477
+ expand: aExpands.join(",") || undefined,
478
+ select: aSelects.join(",") || undefined
479
+ };
480
+ }
481
+
482
+ /**
483
+ *
484
+ * @param {Array} aSelects , select parameters
485
+ * @param {SelectionProperties} alwaysSelectField, all the fields that are marked as requestAtLeastFields
486
+ * @returns {Array} aSelects, updated select parameters
487
+ * @private
488
+ */
489
+
490
+ _ensureSelectionProperties(aSelects, alwaysSelectField) {
491
+ for (const item of alwaysSelectField) {
492
+ if (typeof item === "object" && item?.PropertyPath && !aSelects.includes(item.PropertyPath)) {
493
+ aSelects.push(item.PropertyPath);
494
+ }
495
+ }
496
+ return aSelects;
497
+ }
498
+
499
+ /**
500
+ * Handles the mandatory selection fields for the given entity set and properties.
501
+ *
502
+ * @param {object} entitySet - The entity set object.
503
+ * @param {array} aSelects - The array of properties.
504
+ * @returns {boolean} True if the entity set or properties have mandatory fields, false otherwise.
505
+ * @private
506
+ */
507
+ _handleMandatorySelectionFields(entitySet, aSelects, oMetaModel) {
508
+ const oEntitySet = oMetaModel.getODataEntitySet(entitySet, false);
509
+ const oEntityType = oMetaModel.getODataEntityType(oEntitySet.entityType, false);
510
+ oEntityType.key.propertyRef.forEach(field => {
511
+ this.ensureSelectionProperty(field.name, aSelects);
512
+ });
513
+ }
514
+
515
+ // push the selection properties to the select array
516
+ ensureSelectionProperty(sProperty, aSelects) {
517
+ sProperty?.split(",").forEach(function (sElement) {
518
+ if (sElement && !aSelects.includes(sElement)) {
519
+ aSelects.push(sElement);
520
+ }
521
+ });
522
+ }
523
+
524
+ /**
525
+ * Creates a card manifest for a recommended card.
526
+ *
527
+ * This method generates a new card manifest based on the provided input data, version information, and app manifest.
528
+ * It also processes the columns to set attributes or titles for the card content and handles row navigation suppression if required.
529
+ *
530
+ * @param {IManifestCardData} oInput - The input data for the card, including card title, subtitle, columns, and entity set.
531
+ * @param {IVersionInfo} oVersionInfo - The version information, including the version and build timestamp.
532
+ * @param {IAppManifest} manifest - The original app manifest.
533
+ * @param {boolean} [bSuppressRowNavigation] - Optional flag to suppress row navigation actions in the card content.
534
+ * @returns {ICardManifest} The generated card manifest object.
535
+ * @private
536
+ */
537
+ _createCardManifest(oInput, oVersionInfo, manifest, bSuppressRowNavigation) {
538
+ let oUIManifest = manifest["sap.ui"];
539
+ let oAppManifest = manifest["sap.app"];
540
+ let attributeIndex = 0;
541
+ if (oAppManifest?.["crossNavigation"]) {
542
+ delete oAppManifest["crossNavigation"];
543
+ }
544
+ if (oAppManifest) {
545
+ Object.assign(oAppManifest, {
546
+ type: "card",
547
+ id: `user.${oInput.id}.${Date.now()}`,
548
+ title: oInput.cardTitle || "",
549
+ subTitle: oInput.subTitle
550
+ });
551
+ }
552
+ let oNewManifest = {
553
+ "sap.ui": oUIManifest,
554
+ "sap.app": this.createManifestSapApp(oAppManifest),
555
+ "sap.card": this.createManifestSapCard(manifest, oInput),
556
+ "sap.ui5": this.createSapui5()
557
+ };
558
+ const oContent = oNewManifest?.["sap.card"]?.content;
559
+ oInput.columns.slice(0, COLUMN_LENGTH).forEach(column => {
560
+ const columnValue = this._getAttributeValue(column);
561
+ if (column.identifier && oContent?.item) {
562
+ // If column.identifier is true, set it as the title
563
+ oContent.item.title = {
564
+ value: columnValue,
565
+ identifier: true
566
+ };
567
+ } else if (oContent?.item?.attributes) {
568
+ // Otherwise, add it to the attributes
569
+ oContent.item.attributes[attributeIndex] = {
570
+ value: columnValue,
571
+ visible: true,
572
+ ...(column.state && {
573
+ state: column.state,
574
+ showStateIcon: column.showStateIcon
575
+ })
576
+ };
577
+ attributeIndex++;
578
+ }
579
+ });
580
+
581
+ // if bSuppressRowNavigation true, remove content actions
582
+ if (bSuppressRowNavigation && oContent?.item) {
583
+ oContent.item.actions = [];
584
+ }
585
+ return {
586
+ ...oNewManifest,
587
+ "sap.insights": {
588
+ parentAppId: oInput.id,
589
+ cardType: "RT",
590
+ versions: {
591
+ ui5: `${oVersionInfo.version}-${oVersionInfo.buildTimestamp}`
592
+ },
593
+ visible: true
594
+ }
595
+ };
596
+ }
597
+
598
+ /**
599
+ * Get Attribute Value
600
+ *
601
+ * @param {object} attributeData - column object
602
+ * @returns {string} returns attribute value
603
+ * @private
604
+ */
605
+ _getAttributeValue(attributeData) {
606
+ let attributeValue = !attributeData.value.startsWith("{") ? "{= extension.formatters.stringFormatter(${" + attributeData.path + "}) }" : attributeData.value;
607
+ if (attributeData.type === "Edm.Date" || attributeData.type === "Edm.DateTime") {
608
+ const oDateFormatOptions = JSON.stringify({
609
+ pattern: Formatting.getDatePattern("short")
610
+ });
611
+ attributeValue = "{=${" + attributeData.path + "}?format.dateTime(${" + attributeData.path + "}, " + oDateFormatOptions + ") : ''}";
612
+ }
613
+ return attributeValue;
614
+ }
615
+
616
+ //creates sap.app object structure for the card manifest of recommended card
617
+ createManifestSapApp(appManifest) {
618
+ const manifestAppData = deepExtend({}, appManifest);
619
+ if (manifestAppData?.dataSources?.mainService) {
620
+ manifestAppData.dataSources["filterService"] = manifestAppData.dataSources.mainService;
621
+ if (manifestAppData.dataSources["filterService"]?.settings) {
622
+ manifestAppData.dataSources["filterService"].settings["odataVersion"] = "2.0";
623
+ }
624
+ }
625
+ return manifestAppData;
626
+ }
627
+
628
+ /**
629
+ * Creates the manifest's SAP card object, sap.card based on the input card details.
630
+ *
631
+ * @param {oIAppManifestbject} manifest - The original manifest object of the application.
632
+ * @param {IManifestCardData} oInput - The input object containing card details.
633
+ * @returns {ISapCard} The SAP card configuration object.
634
+ */
635
+ createManifestSapCard(manifest, oInput) {
636
+ const datasource = manifest["sap.app"]?.dataSources;
637
+ const sServiceUrl = datasource?.mainService?.uri;
638
+ const entitySetName = oInput.entitySet;
639
+ const sCountPath = "__count";
640
+ const sText = {
641
+ text: "{= ${" + sCountPath + "} === '0' ? '' : ${" + sCountPath + "} }"
642
+ };
643
+ let oCardConfig = {
644
+ type: "List"
645
+ };
646
+ oCardConfig["configuration"] = this.createManifestSapCardConfig(sServiceUrl || "", entitySetName);
647
+ oCardConfig["data"] = this.createManifestSapCardData(sServiceUrl || "", oInput.url);
648
+ oCardConfig["header"] = {
649
+ title: oInput.cardTitle,
650
+ subTitle: "",
651
+ actions: [],
652
+ status: sText,
653
+ data: {
654
+ path: "/content/d"
655
+ }
656
+ };
657
+ oCardConfig["extension"] = "module:sap/insights/CardExtension";
658
+ oCardConfig["content"] = {
659
+ data: {
660
+ path: "/content/d/results"
661
+ },
662
+ maxItems: 5,
663
+ item: {
664
+ actions: [],
665
+ attributesLayoutType: "OneColumn",
666
+ attributes: []
667
+ }
668
+ };
669
+ this.addCardActions(oCardConfig, oInput.semanticObject, oInput.action);
670
+ return oCardConfig;
671
+ }
672
+
673
+ /**
674
+ * Sets the card actions for the given SAP card.
675
+ *
676
+ * @param {object} sapCard - The SAP card object to set the actions on.
677
+ * @param {string} semObj - The semantic object for the navigation target.
678
+ * @param {string} semanticAction - The semantic action for the navigation target.
679
+ */
680
+ addCardActions(sapCard, semObj, semanticAction) {
681
+ let oHeaderParams = {
682
+ ibnTarget: {
683
+ semanticObject: semObj,
684
+ action: semanticAction
685
+ },
686
+ sensitiveProps: [],
687
+ ibnParams: {}
688
+ };
689
+ let oHeaderParameterValue = [{
690
+ type: "Navigation",
691
+ parameters: "{= extension.formatters.getNavigationContext(${parameters>/headerState/value})}"
692
+ }];
693
+ let oContentParams = JSON.parse(JSON.stringify(oHeaderParams));
694
+ let oContentParameterValue = [{
695
+ type: "Navigation",
696
+ parameters: "{= extension.formatters.getNavigationContext(${parameters>/contentState/value}, ${})}"
697
+ }];
698
+ if (sapCard.configuration?.parameters) {
699
+ sapCard.configuration.parameters.headerState = {
700
+ value: JSON.stringify(oHeaderParams)
701
+ };
702
+ sapCard.configuration.parameters.contentState = {
703
+ value: JSON.stringify(oContentParams)
704
+ };
705
+ }
706
+ if (sapCard.header) {
707
+ sapCard.header.actions = oHeaderParameterValue;
708
+ }
709
+ if (sapCard?.content?.item) {
710
+ sapCard.content.item.actions = oContentParameterValue;
711
+ }
712
+ }
713
+
714
+ /**
715
+ * Creates the manifest sap card configuration object.
716
+ *
717
+ * @param {string} sServiceUrl - The service URL to be used in the request.
718
+ * @param {string} entitySetName - The name of the entity set.
719
+ * @returns {object} The SAP card configuration object.
720
+ */
721
+ createManifestSapCardConfig(sServiceUrl, entitySetName) {
722
+ const oCardConfiguration = {
723
+ parameters: {
724
+ _relevantODataFilters: {
725
+ value: []
726
+ },
727
+ _relevantODataParameters: {
728
+ value: []
729
+ },
730
+ _entitySet: {
731
+ value: entitySetName
732
+ },
733
+ _urlSuffix: {
734
+ value: "/Results"
735
+ }
736
+ },
737
+ destinations: {
738
+ service: {
739
+ name: "(default)",
740
+ defaultUrl: "/"
741
+ }
742
+ },
743
+ csrfTokens: {
744
+ token1: {
745
+ data: {
746
+ request: {
747
+ url: "{{destinations.service}}" + sServiceUrl,
748
+ method: "HEAD",
749
+ headers: {
750
+ "X-CSRF-Token": "Fetch"
751
+ }
752
+ }
753
+ }
754
+ }
755
+ }
756
+ };
757
+ return oCardConfiguration;
758
+ }
759
+
760
+ //create sap.ui5 object for the card manifest
761
+ createSapui5() {
762
+ return {
763
+ _version: "1.1.0",
764
+ contentDensities: {
765
+ compact: true,
766
+ cozy: true
767
+ },
768
+ dependencies: {
769
+ libs: {
770
+ "sap.insights": {
771
+ lazy: false
772
+ }
773
+ }
774
+ }
775
+ };
776
+ }
777
+
778
+ /**
779
+ * Creates the manifest data for an SAP card.
780
+ *
781
+ * @param {string} sServiceUrl - The service URL to be used in the request.
782
+ * @param {string} urlExpand - The URL to expand in the batch request.
783
+ * @returns {IRequestData} The SAP card data object containing the request configuration.
784
+ */
785
+ createManifestSapCardData(sServiceUrl, urlExpand) {
786
+ const oBatch = {
787
+ content: {
788
+ method: "GET",
789
+ url: urlExpand,
790
+ headers: {
791
+ Accept: "application/json"
792
+ }
793
+ }
794
+ };
795
+ const oSapCardData = {
796
+ request: {
797
+ url: "{{destinations.service}}" + sServiceUrl + "/$batch",
798
+ method: "POST",
799
+ headers: {
800
+ "X-CSRF-Token": "{{csrfTokens.token1}}"
801
+ },
802
+ batch: oBatch
803
+ }
804
+ };
805
+ return oSapCardData;
806
+ }
807
+
808
+ /**
809
+ * This function returns card details required for the recommended card manifest
810
+ * based on app manifest and annotations
811
+ * @param {object} manifest - The original app manifest
812
+ * @param {object} oInfo - The object containing details of lineitem, entityset, settings etc
813
+ * @param {object} oParentApp - The parent app object
814
+ * @param {object} oMetaModel - The OData metamodel
815
+ * @returns {object} The card data object with title, subtitle, url, semanticObject, action, id and column details
816
+ * @private
817
+ */
818
+ _getManifestCardData(manifest, oInfo, oParentApp, oMetaModel) {
819
+ const manifestApp = manifest["sap.app"];
820
+ const dataSources = manifestApp?.dataSources;
821
+ const mainServiceUri = dataSources?.mainService?.uri || "";
822
+ const lineItem = oInfo.lineItem;
823
+ const entitySet = oInfo.entitySet;
824
+ const oEntitySet = oMetaModel.getODataEntitySet(entitySet);
825
+ const oEntityType = oMetaModel.getODataEntityType(oEntitySet?.entityType);
826
+ const serviceUrl = `${mainServiceUri.replace(/\/$/, "")}/${entitySet}`; // make '{mainServiceUri}/{entitySet}' format
827
+
828
+ //get the column details for each of the lineitem columns
829
+ const aColumns = lineItem?.map(oColumn => this._getColumnDetail(entitySet, oMetaModel, oColumn)).filter(oItem => oItem !== undefined);
830
+ const oSelectExpand = this._getRelevantColumnPaths(aColumns);
831
+ //get the complete select and expand parameters for url
832
+ const mParameters = this.getParameters(oInfo, oMetaModel, entitySet, oSelectExpand);
833
+ const urlSelectExpand = this.createCustomParams(mParameters);
834
+ const finalUrl = urlSelectExpand ? `${serviceUrl}?$top=5&skip=0&${urlSelectExpand}&$inlinecount=allpages` : `${serviceUrl}?$top=5&skip=0`;
835
+ //sort the column based on their importance and then slice the first 4 columns
836
+ const aColumnSorted = sortCollectionByImportance(aColumns).map(column => {
837
+ return {
838
+ path: column?.path,
839
+ type: column?.type,
840
+ value: column?.value,
841
+ identifier: column?.identifier,
842
+ state: column?.state,
843
+ showStateIcon: column?.showStateIcon
844
+ };
845
+ }).slice(0, 4);
846
+ return {
847
+ cardTitle: manifest?.["sap.app"]?.title,
848
+ subTitle: oEntityType[UIAnnotations.CommonLabel] ? `Top 5 ${oEntityType[UIAnnotations.CommonLabel].String}` : "",
849
+ url: finalUrl,
850
+ semanticObject: oParentApp?.semanticObject || "",
851
+ action: oParentApp?.action || "",
852
+ id: manifest?.["sap.app"]?.id,
853
+ columns: aColumnSorted,
854
+ entitySet: entitySet
855
+ };
856
+ }
857
+
858
+ /**
859
+ * This function returns the column detail object for the given column's context
860
+ * @param {string} entitySet - - The entity set name
861
+ * @param {object} oMetaModel - OData metamodel
862
+ * @param {object} lineItemContext - The line item column context object
863
+ * @returns {object} The column detail containing value, path, importance and type
864
+ * @private
865
+ */
866
+ _getColumnDetail(entitySet, oMetaModel, lineItemContext) {
867
+ let oProperty;
868
+ let oEntitySet = oMetaModel.getODataEntitySet(entitySet);
869
+ let oEntityType = oMetaModel.getODataEntityType(oEntitySet.entityType);
870
+ if (lineItemContext.Value?.Path) {
871
+ oProperty = oMetaModel.getODataProperty(oEntityType, lineItemContext.Value.Path);
872
+ let oPropertyHidden = oProperty[UIAnnotations.UIHidden];
873
+
874
+ // if oProperty not hidden and oLineitemContext not hidden then only consider the column else return undefined
875
+ if (oPropertyHidden?.Bool === "true" || oPropertyHidden?.Bool === true) {
876
+ return undefined;
877
+ }
878
+ //check if lineItemContext is hidden or no oProperty is found
879
+ if (this.isPropertyHidden(lineItemContext) || !oProperty || Object.keys(oProperty).length === 0) {
880
+ return undefined;
881
+ }
882
+ }
883
+ let oP13NDetails = this.createP13N(oEntitySet, oProperty, lineItemContext, oMetaModel);
884
+ oP13NDetails = oP13NDetails.replace(/\\/g, ""); // Remove the double backslashes
885
+ let columnDataObject = oP13NDetails ? JSON.parse(oP13NDetails) : {};
886
+ if (!this.isSupportedColumn(columnDataObject, lineItemContext, oMetaModel, oEntitySet)) {
887
+ return undefined;
888
+ }
889
+ if (oProperty) {
890
+ columnDataObject = this.getColumnObjectDetails(columnDataObject, oProperty, oEntityType, lineItemContext);
891
+ if (lineItemContext?.[FieldAnnotationsType.Importance] !== undefined) {
892
+ const importance = lineItemContext[FieldAnnotationsType.Importance];
893
+ columnDataObject.importance = importance;
894
+ }
895
+ }
896
+ return columnDataObject;
897
+ }
898
+
899
+ /**
900
+ * Retrieves the column object details based on the provided property and entity type.
901
+ *
902
+ * @param {object} columnDataObject - The column information object to be populated.
903
+ * @param {object} propertyDetails - The property object containing metadata about the column.
904
+ * @param {object} entityType - The entity type object containing metadata about the entity.
905
+ * @param {object} dataField - The data field object containing the lineitem column context object
906
+ * @returns {object} The populated column information object.
907
+ * @private
908
+ */
909
+ getColumnObjectDetails(columnDataObject, propertyDetails, entityType, dataField) {
910
+ let sColumnKeyDescription = propertyDetails[UIAnnotations.CommonText]?.Path || "";
911
+ sColumnKeyDescription = "{" + sColumnKeyDescription + "}";
912
+ let sColumnValue = propertyDetails.name ? "{" + propertyDetails.name + "}" : "";
913
+ let sNavigation = "";
914
+ const aSemKeyAnnotation = entityType[UIAnnotations.CommonSemanticKey];
915
+ const bIsPropertySemanticKey = !!aSemKeyAnnotation && aSemKeyAnnotation.some(function (oAnnotation) {
916
+ return oAnnotation.PropertyPath === propertyDetails.name;
917
+ });
918
+ let bIsCriticality = false;
919
+ let criticalityAnnotation = undefined;
920
+ if ((dataField?.Criticality && dataField?.Value?.Path) === propertyDetails.name) {
921
+ criticalityAnnotation = dataField;
922
+ bIsCriticality = true;
923
+ }
924
+ if (propertyDetails[UIAnnotations.MeasuresISOCurrency]?.Path) {
925
+ sColumnValue = sColumnValue.concat(" " + "{" + sNavigation + propertyDetails[UIAnnotations.MeasuresISOCurrency]?.Path + "}");
926
+ }
927
+ if (propertyDetails[UIAnnotations.MeasuresUnit]?.Path) {
928
+ sColumnValue = sColumnValue.concat(" " + "{" + sNavigation + propertyDetails[UIAnnotations.MeasuresUnit]?.Path + "}");
929
+ }
930
+ if (propertyDetails[UIAnnotations.CommonText]?.Path) {
931
+ let sTextArragement = propertyDetails[UIAnnotations.CommonText]?.[UIAnnotations.UITextArrangement];
932
+ if (!sTextArragement) {
933
+ sTextArragement = entityType[UIAnnotations.UITextArrangement];
934
+ }
935
+ this._setColumnTextValue(sTextArragement, columnDataObject, sColumnKeyDescription, sColumnValue);
936
+ } else {
937
+ columnDataObject["value"] = sColumnValue;
938
+ if (bIsPropertySemanticKey) {
939
+ columnDataObject["identifier"] = bIsPropertySemanticKey;
940
+ }
941
+ }
942
+ if (bIsCriticality) {
943
+ columnDataObject["state"] = this.buildExpressionForCriticalityColor(criticalityAnnotation);
944
+ columnDataObject["showStateIcon"] = criticalityAnnotation?.CriticalityRepresentation?.EnumMember !== FieldAnnotationsType.CriticalityRepresentationTypeWithoutIcon || true;
945
+ }
946
+ columnDataObject["path"] = propertyDetails[UIAnnotations.CommonText]?.Path || propertyDetails.name;
947
+ columnDataObject["type"] = propertyDetails.type;
948
+ return columnDataObject;
949
+ }
950
+
951
+ /**
952
+ * Build expression for the criticality annotation, kept same as the one used in LROP
953
+ * @param {object} criticalityAnnotation - The criticality annotation object
954
+ * @returns {string} The expression for the criticality color
955
+ * @private
956
+ */
957
+ buildExpressionForCriticalityColor(criticalityAnnotation) {
958
+ let sFormatCriticalityExpression = ValueState.None;
959
+ let sExpressionTemplate;
960
+ let oCriticalityProperty = criticalityAnnotation?.Criticality;
961
+ let CriticalityType = /*#__PURE__*/function (CriticalityType) {
962
+ CriticalityType["Negative"] = "com.sap.vocabularies.UI.v1.CriticalityType/Negative";
963
+ CriticalityType["Critical"] = "com.sap.vocabularies.UI.v1.CriticalityType/Critical";
964
+ CriticalityType["Positive"] = "com.sap.vocabularies.UI.v1.CriticalityType/Positive";
965
+ return CriticalityType;
966
+ }({});
967
+ if (oCriticalityProperty) {
968
+ sExpressionTemplate = "'{'= ({0} === ''" + CriticalityType.Negative + "'') || ({0} === ''1'') || ({0} === 1) ? ''" + ValueState.Error + "'' : " + "({0} === ''" + CriticalityType.Critical + "'') || ({0} === ''2'') || ({0} === 2) ? ''" + ValueState.Warning + "'' : " + "({0} === ''" + CriticalityType.Positive + "'') || ({0} === ''3'') || ({0} === 3) ? ''" + ValueState.Success + "'' : " + "''" + ValueState.None + "'' '}'";
969
+ if (oCriticalityProperty?.Path) {
970
+ const sCriticalitySimplePath = "${" + oCriticalityProperty.Path + "}";
971
+ sFormatCriticalityExpression = formatMessage(sExpressionTemplate, [sCriticalitySimplePath]);
972
+ } else if (oCriticalityProperty?.EnumMember) {
973
+ const sCriticality = "'" + oCriticalityProperty.EnumMember + "'";
974
+ sFormatCriticalityExpression = formatMessage(sExpressionTemplate, [sCriticality]);
975
+ } else {
976
+ Log.warning("Case not supported, returning the default sap.ui.core.ValueState.None");
977
+ }
978
+ } else {
979
+ // Any other cases are not valid, the default value of 'None' will be returned
980
+ Log.warning("Case not supported, returning the default sap.ui.core.ValueState.None");
981
+ }
982
+ return sFormatCriticalityExpression;
983
+ }
984
+
985
+ /**
986
+ * Sets display text format of column
987
+ *
988
+ * @private
989
+ * @param {{EnumMember: string} | undefined} sTextArragement - sTextArragement object
990
+ * @param { ColumnObjectData} columnDataObject - Object containing column details
991
+ * @param {string} sColumnKeyDescription - Description field to include in text value
992
+ * @param {string} sColumnValue - The value to include in Text value
993
+ */
994
+ _setColumnTextValue(sTextArragement, columnDataObject, sColumnKeyDescription, sColumnValue) {
995
+ let TextArrangementType = /*#__PURE__*/function (TextArrangementType) {
996
+ TextArrangementType["TextOnly"] = "TextOnly";
997
+ TextArrangementType["TextLast"] = "TextLast";
998
+ TextArrangementType["TextSeparate"] = "TextSeparate";
999
+ return TextArrangementType;
1000
+ }({});
1001
+ const sTextArrangementType = sTextArragement?.EnumMember?.split("/")[1];
1002
+ let valueExpr;
1003
+ switch (sTextArrangementType) {
1004
+ case TextArrangementType.TextOnly:
1005
+ valueExpr = `{= $${sColumnKeyDescription} === '' ? '' : $${sColumnKeyDescription} }`;
1006
+ break;
1007
+ case TextArrangementType.TextLast:
1008
+ valueExpr = `{= $${sColumnValue} === '' ? '' : $${sColumnValue} }` + `{= $${sColumnKeyDescription} === '' ? '' : ' (' + ($${sColumnKeyDescription}) + ')' }`;
1009
+ break;
1010
+ case TextArrangementType.TextSeparate:
1011
+ valueExpr = `{= $${sColumnValue} === '' ? '' : $${sColumnValue} }`;
1012
+ break;
1013
+ default:
1014
+ valueExpr = `{= $${sColumnKeyDescription} === '' ? '' : $${sColumnKeyDescription} }` + `{= $${sColumnValue} === '' ? '' : ' (' + ($${sColumnValue}) + ')' }`;
1015
+ break;
1016
+ }
1017
+ columnDataObject["value"] = valueExpr;
1018
+ }
1019
+
1020
+ // get requestAtlLeastFields from PresentationVariant
1021
+ _getRequestAtLeastFields(presentationVariant) {
1022
+ return presentationVariant && Array.isArray(presentationVariant.requestAtLeastFields) ? presentationVariant.requestAtLeastFields : [];
1023
+ }
1024
+
1025
+ /**
1026
+ * Creates a query string with custom parameters for OData requests.
1027
+ *
1028
+ * This method generates a query string containing `$expand` and `$select` parameters
1029
+ * based on the provided input object. The values are URL-encoded to ensure proper formatting.
1030
+ *
1031
+ * @param {object} mParameters - An object containing the parameters for the query string.
1032
+ * @param {string | undefined} mParameters.expand - The value for the `$expand` parameter, if any.
1033
+ * @param {string | undefined} mParameters.select - The value for the `$select` parameter, if any.
1034
+ * @returns {string} A query string containing the `$expand` and `$select` parameters, joined by `&`.
1035
+ * @private
1036
+ */
1037
+ createCustomParams(mParameters) {
1038
+ const aCustomParams = [];
1039
+ if (mParameters?.expand) {
1040
+ aCustomParams.push("$expand=" + encodeURL(mParameters["expand"]));
1041
+ }
1042
+ if (mParameters?.select) {
1043
+ aCustomParams.push("$select=" + encodeURL(mParameters["select"]));
1044
+ }
1045
+ return aCustomParams.join("&");
1046
+ }
1047
+
1048
+ /**
1049
+ * Retrieves an object from the OData meta model based on the given entity type and path.
1050
+ *
1051
+ * This method resolves the provided path to an absolute path if it is relative, using the entity type as the base.
1052
+ * It then retrieves the corresponding object from the meta model. Any "@" characters in the path are removed
1053
+ * to match the meta model's structure.
1054
+ *
1055
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about entities and annotations.
1056
+ * @param {string} entityTypeName - The entity type used as the base for resolving relative paths.
1057
+ * @param {string} path - The path to the object in the meta model. Can be relative or absolute.
1058
+ * @returns {IPresentationVariant | ILineItem[]} The object retrieved from the meta model, which can be a presentation variant or an array of nested objects.
1059
+ * @private
1060
+ */
1061
+ getObject(metaModel, entityTypeName, path) {
1062
+ if (path[0] !== "/") {
1063
+ // relative path - add path of annotation target, i.e. EntityType
1064
+ path = metaModel.getODataEntityType(entityTypeName, true) + "/" + path; //*****check this */
1065
+ }
1066
+ // assumption: absolute paths in annotations are equal to corresponding paths in metaModel
1067
+ // any "@" are removed in the metaModel
1068
+ return metaModel.getObject(path.replace(/@/g, ""));
1069
+ }
1070
+
1071
+ /**
1072
+ * Check If Page is List Report
1073
+ *
1074
+ * @param {object} page - page object
1075
+ * @returns {boolean} returns boolean
1076
+ * @private
1077
+ */
1078
+ _isListReport(page) {
1079
+ return page?.component?.name === "sap.suite.ui.generic.template.ListReport";
1080
+ }
1081
+
1082
+ /**
1083
+ * @param {IPageType[] | PageRecord} pages - pages object from manifest
1084
+ * @returns {ILrSettings} - returns the settings object for the ListReport
1085
+ */
1086
+ getSettingsForPage(pages) {
1087
+ if (!pages) {
1088
+ return {};
1089
+ }
1090
+ let lrSettings = {};
1091
+
1092
+ // Handling array and object structure in LR V2 manifest
1093
+ if (Array.isArray(pages) && this._isListReport(pages[0])) {
1094
+ const listPage = pages[0];
1095
+ if (listPage?.component) {
1096
+ const component = listPage.component;
1097
+ lrSettings = component?.settings || {};
1098
+ lrSettings.bSupressCardRowNavigation = this.shouldSuppressCardRowNavigation(listPage);
1099
+ }
1100
+ } else if (Object.keys(pages).length) {
1101
+ const sListKey = Object.keys(pages).find(key => this._isListReport(pages[key]));
1102
+ if (sListKey) {
1103
+ const listPage = pages[sListKey];
1104
+ if (listPage?.component) {
1105
+ const component = listPage.component;
1106
+ lrSettings = component?.settings ?? {};
1107
+ lrSettings.bSupressCardRowNavigation = this.shouldSuppressCardRowNavigation(listPage);
1108
+ }
1109
+ }
1110
+ }
1111
+ return lrSettings;
1112
+ }
1113
+
1114
+ /**
1115
+ * Determines whether card row navigation should be suppressed for the card
1116
+ *
1117
+ * @param {IPageType} page - The ListReport page object from the manifest.
1118
+ * @returns {boolean} True if card row navigation should be suppressed
1119
+ */
1120
+ shouldSuppressCardRowNavigation(listPage) {
1121
+ // LR only app or if external navigation from OP
1122
+ if (listPage.pages) {
1123
+ // If pages is an array, handle based on its length and navigation property
1124
+ if (Array.isArray(listPage.pages)) {
1125
+ if (listPage.pages.length === 0 || listPage.pages[0]?.navigation) {
1126
+ return true;
1127
+ }
1128
+ } else {
1129
+ // If pages is an object, check if the object keys have navigation
1130
+ const keys = Object.keys(listPage.pages);
1131
+ if (keys.length === 0 || keys.length && listPage.pages[keys[0]]?.navigation) {
1132
+ return true;
1133
+ }
1134
+ }
1135
+ } else {
1136
+ //if no list pages return true
1137
+ return true;
1138
+ }
1139
+
1140
+ // Check for Quick variant selection X in settings
1141
+ if (listPage?.component?.settings?.quickVariantSelectionX) {
1142
+ return true;
1143
+ }
1144
+ return false;
1145
+ }
1146
+
1147
+ /**
1148
+ * @param {object} metaModel - metamodel object
1149
+ * @param {ILrSettings} ILrSettings - settings object from the manifest
1150
+ * @param {string} entitySetName - entity set of the application
1151
+ * @returns {object} - returns the normalized table settings
1152
+ * @private
1153
+ */
1154
+ getNormalizedTableSettings(metaModel, lRVariantSettings, entitySetName) {
1155
+ const settings = deepExtend({}, lRVariantSettings);
1156
+
1157
+ // 1. map boolean settings gridTable and treeTable to tableType
1158
+ if (settings && !settings.tableType) {
1159
+ if (settings.gridTable) {
1160
+ settings.tableType = TABLE_TYPES.GRID;
1161
+ } else if (settings.treeTable) {
1162
+ settings.tableType = TABLE_TYPES.TREE;
1163
+ }
1164
+ }
1165
+
1166
+ // 2. map flat settings to structured ones
1167
+ settings.tableSettings = settings.tableSettings || {};
1168
+ settings.tableSettings.type = settings.tableSettings.type || settings.tableType;
1169
+ const entitySet = metaModel.getODataEntitySet(entitySetName);
1170
+ const entityTypeData = metaModel.getODataEntityType(entitySet.entityType);
1171
+
1172
+ // 3. determine type
1173
+ if (settings.tableSettings.type !== TABLE_TYPES.STANDARD_LIST && settings.tableSettings.type !== TABLE_TYPES.OBJECT_LIST && entitySetName) {
1174
+ settings.tableSettings.type = settings.tableSettings.type || (entityTypeData[UIAnnotations.SapSemantics] === "aggregate" ? TABLE_TYPES.ANALYTICAL : TABLE_TYPES.RESPONSIVE);
1175
+ if (settings.tableSettings.type === TABLE_TYPES.ANALYTICAL && !(entityTypeData[UIAnnotations.SapSemantics] === "aggregate")) {
1176
+ settings.tableSettings.type = TABLE_TYPES.GRID;
1177
+ }
1178
+ }
1179
+ if (entityTypeData[UIAnnotations.UIHeaderInfo]) {
1180
+ settings.tableSettings.headerInfo = entityTypeData[UIAnnotations.UIHeaderInfo];
1181
+ }
1182
+
1183
+ // 4. remove deprecated settings (to avoid new code to rely on them)
1184
+ delete settings.gridTable;
1185
+ delete settings.treeTable;
1186
+ delete settings.tableType;
1187
+ return settings.tableSettings;
1188
+ }
1189
+
1190
+ /**
1191
+ * @param {object} metaModel - metamodel object
1192
+ * @param {string} entitySetName - entity set of the application
1193
+ * @param {object} tabItem - details of the variant tab
1194
+ * @returns {boolean} - returns true if the variant is a smart chart
1195
+ */
1196
+ checkIfSmartChart(metaModel, entitySetName, tabItem) {
1197
+ let entitySetData = metaModel.getODataEntitySet(entitySetName);
1198
+ let entityTypeData = metaModel.getODataEntityType(entitySetData.entityType);
1199
+ let annotationName, annotationPath, variantData;
1200
+ annotationPath = tabItem.annotationPath;
1201
+ //variantData = !!annotationPath && (entityTypeData[annotationPath] as VariantInfo);
1202
+ variantData = annotationPath ? entityTypeData[annotationPath] : undefined;
1203
+ if (variantData?.PresentationVariant) {
1204
+ // oVariant is SelectionPresentationVariant
1205
+ if (variantData.PresentationVariant.Visualizations) {
1206
+ annotationName = variantData.PresentationVariant.Visualizations[0].AnnotationPath;
1207
+ } else if (variantData.PresentationVariant.Path) {
1208
+ let sPresentationVariantPath = variantData.PresentationVariant.Path.split("@")[1];
1209
+ let oPresentationVariantAnnotation = sPresentationVariantPath && entityTypeData[sPresentationVariantPath];
1210
+ annotationName = oPresentationVariantAnnotation ? oPresentationVariantAnnotation?.Visualizations?.[0].AnnotationPath : "";
1211
+ }
1212
+ } else if (variantData?.Visualizations) {
1213
+ // oVariant is PresentationVariant
1214
+ annotationName = variantData.Visualizations[0].AnnotationPath;
1215
+ }
1216
+ return !!((annotationName ?? "").indexOf(UIAnnotations.UIChart) > -1);
1217
+ }
1218
+
1219
+ /**
1220
+ * function returns true if the passed entityset / properties have mandatory properties
1221
+ *
1222
+ * @param {EntitySet} entitySetData - Entity set
1223
+ * @param {Array} propertiesSet - Additional Properties
1224
+ * @returns {boolean} returns boolean
1225
+ * @private
1226
+ */
1227
+ hasMandatoryProperties(entitySetData, propertiesSet) {
1228
+ // if entityset has required properties in filter restrictions return true
1229
+ if (entitySetData?.["Org.OData.Capabilities.V1.FilterRestrictions"]?.["RequiredProperties"]?.length) {
1230
+ return true;
1231
+ } else if (propertiesSet?.length) {
1232
+ // iterate through all properties and return true if any property is mandatory or sap:rquired-in-filter is true
1233
+ return propertiesSet.some(propertyDetail => {
1234
+ return Object.keys(propertyDetail).length && (propertyDetail["sap:parameter"] === "mandatory" || propertyDetail["sap:required-in-filter"] === "true");
1235
+ });
1236
+ }
1237
+ return false;
1238
+ }
1239
+
1240
+ /**
1241
+ * Check if sEntitySet has association with parameterised entityset and if it has give parametersised entityset parameters
1242
+ * @param {object} metaModel OData MetaModel
1243
+ * @param {string} entitySetName of the EntitySet which has Parameter Entityset in association.
1244
+ * @param {boolean} infoParamsRequired If the full info of parameters is needed or only the name of params is needed.
1245
+ * @return {ParameterisedEntity} Contains name of Parameter EntitySet, keys of Parameter EntitySet and Name of Navigation property.
1246
+ * @private
1247
+ */
1248
+ _getParametersisedEntitySetParams(metaModel, entitySetName, infoParamsRequired) {
1249
+ if (!metaModel) {
1250
+ throw new Error("OData Model needs to be passed as an argument");
1251
+ }
1252
+ const oResult = {
1253
+ entitySetName: null,
1254
+ parameters: [],
1255
+ navPropertyName: null
1256
+ };
1257
+ const entitySetData = metaModel.getODataEntitySet(entitySetName);
1258
+ const entityTypeData = metaModel.getODataEntityType(entitySetData.entityType);
1259
+ const aNavigationProperties = entityTypeData.navigationProperty;
1260
+ if (!aNavigationProperties) {
1261
+ return oResult;
1262
+ }
1263
+
1264
+ // filter the parameter entityset for extracting it's key and it's entityset name
1265
+ aNavigationProperties.forEach(function (oNavProperty) {
1266
+ const oNavigationEntitySet = metaModel.getODataAssociationEnd(entityTypeData, oNavProperty.name);
1267
+ const oNavigationEntityType = oNavigationEntitySet && metaModel.getODataEntityType(oNavigationEntitySet.type);
1268
+ if (oNavigationEntityType?.[UIAnnotations.SapSemantics] !== "parameters" || !oNavigationEntityType.key) {
1269
+ return false;
1270
+ }
1271
+ oResult.entitySetName = metaModel.getODataAssociationSetEnd(entityTypeData, oNavProperty.name)?.entitySet;
1272
+ for (let value of oNavigationEntityType.key.propertyRef) {
1273
+ if (infoParamsRequired) {
1274
+ const navProp = oNavigationEntityType.property;
1275
+ for (let navProperty of navProp) {
1276
+ if (navProperty.name === value.name) {
1277
+ oResult.parameters.push(navProperty);
1278
+ }
1279
+ }
1280
+ } else {
1281
+ oResult.parameters.push(value.name);
1282
+ }
1283
+ }
1284
+ const aSubNavigationProperties = oNavigationEntityType.navigationProperty;
1285
+ // Parameter entityset must have association back to main entityset.
1286
+ const bBackAssociationPresent = aSubNavigationProperties?.some(function (oSubNavigationProperty) {
1287
+ const sSubNavigationEntityType = metaModel.getODataAssociationEnd(oNavigationEntityType, oSubNavigationProperty?.name)?.type;
1288
+ //if entityset.entitytype is same as subnavigation entitytype then it's a back association
1289
+ oResult.navPropertyName = sSubNavigationEntityType === entitySetData.entityType ? oSubNavigationProperty?.name : null;
1290
+ return oResult.navPropertyName;
1291
+ });
1292
+ return bBackAssociationPresent && oResult.navPropertyName && oResult.entitySetName;
1293
+ });
1294
+ return oResult;
1295
+ }
1296
+
1297
+ /**
1298
+ * This function check if a lineitem annotation column is visible or not
1299
+ * @param {object} lineItemAnnotations - The column details object
1300
+ * @returns {Boolean} The column visibility status {true/false}
1301
+ * @private
1302
+ */
1303
+ isPropertyHidden(lineItemAnnotations) {
1304
+ let oFieldControl = lineItemAnnotations[UIAnnotations.CommonFieldControl];
1305
+ let uiHidden = lineItemAnnotations[UIAnnotations.UIHidden];
1306
+
1307
+ // Check for FieldControl Hidden
1308
+ if (oFieldControl?.EnumMember === FieldAnnotationsType.FieldControlHiddenType) {
1309
+ return true;
1310
+ }
1311
+
1312
+ // Check for UI Hidden
1313
+ if (uiHidden) {
1314
+ if (Object.prototype.hasOwnProperty.call(uiHidden, "Bool")) {
1315
+ return uiHidden?.Bool === "true";
1316
+ } else if (Object.prototype.hasOwnProperty.call(uiHidden, "Path")) {
1317
+ return false;
1318
+ } else {
1319
+ return true; // <Annotation Term="UI.Hidden"/>
1320
+ }
1321
+ }
1322
+ return false;
1323
+ }
1324
+
1325
+ /**
1326
+ * Creates a P13N string for a given entity set, property, and line item column.
1327
+ *
1328
+ * @param {Object} contextSet - The entity set object.
1329
+ * @param {Object} contextProp - The property details from metadata.
1330
+ * @param {Object} columnDataField - The line item column data field.
1331
+ * @param {Object} metaModel - The metadata model object.
1332
+ * @returns {string} The P13N string for the specified entity set and property.
1333
+ * @private
1334
+ */
1335
+ createP13N(contextSet, contextProp, columnDataField, metaModel) {
1336
+ let p13nDetails = "";
1337
+ let additionalProperties = [];
1338
+ let navigationPath = "";
1339
+ let recordType = columnDataField?.RecordType;
1340
+ let dataFieldValue = columnDataField?.Value;
1341
+ let valuePath = dataFieldValue?.Path || "";
1342
+ if (recordType === FieldAnnotationsType.DataField || recordType === FieldAnnotationsType.DataFieldForAnnotation || recordType === FieldAnnotationsType.DataFieldWithUrl) {
1343
+ if (valuePath) {
1344
+ let columnKey = this.createP13NColumnKey(columnDataField);
1345
+ p13nDetails = '\\{"columnKey":"' + columnKey + '", "leadingProperty":"' + valuePath;
1346
+ navigationPath = this.getNavigationPrefixPath(metaModel, contextSet, valuePath);
1347
+ } else if (dataFieldValue?.Apply?.Name === "odata.concat") {
1348
+ dataFieldValue?.Apply?.Parameters.forEach(function (parameterDetails) {
1349
+ if (parameterDetails.Type === "Path") {
1350
+ if (!p13nDetails) {
1351
+ p13nDetails = '\\{"columnKey":"' + parameterDetails?.Value + '", "leadingProperty":"' + parameterDetails?.Value;
1352
+ } else {
1353
+ additionalProperties.push(parameterDetails.Value);
1354
+ }
1355
+ }
1356
+ });
1357
+ }
1358
+ // Append type information and additional properties
1359
+ p13nDetails += this.processAdditionalProperties(contextProp, columnDataField, navigationPath, additionalProperties);
1360
+ if (recordType === FieldAnnotationsType.DataFieldWithUrl && columnDataField?.Url) {
1361
+ this.processDataFieldWithUrl(columnDataField, additionalProperties);
1362
+ }
1363
+ if (p13nDetails && additionalProperties.length) {
1364
+ p13nDetails += '", "additionalProperty":"' + additionalProperties.join();
1365
+ }
1366
+ if (p13nDetails) {
1367
+ p13nDetails += '"\\}';
1368
+ }
1369
+ }
1370
+ return p13nDetails;
1371
+ }
1372
+
1373
+ //process DataFieldUrl properties and add them to additionalProperties
1374
+ processDataFieldWithUrl(columnDataField, additionalProperties) {
1375
+ const oDataFieldUrl = columnDataField.Url;
1376
+ if (oDataFieldUrl?.Apply?.Parameters) {
1377
+ oDataFieldUrl.Apply.Parameters.forEach(oParameter => {
1378
+ if (oParameter.Type === "LabeledElement" && oParameter.Value?.Path) {
1379
+ additionalProperties.push(oParameter.Value.Path);
1380
+ }
1381
+ });
1382
+ }
1383
+ if (oDataFieldUrl?.Path) {
1384
+ additionalProperties.push(oDataFieldUrl.Path);
1385
+ }
1386
+ }
1387
+
1388
+ /**
1389
+ * Creates a personalized column key based on the provided data field.
1390
+ * @param {Object} oDataField - The data field object containing metadata for generating the column key.
1391
+ * @returns {string} The generated column key based on the data field.
1392
+ */
1393
+ createP13NColumnKey(dataFieldColumn) {
1394
+ let columnKeyName = "",
1395
+ fioriTemplatePrefix = "template",
1396
+ seperatorNotation = "::";
1397
+ let recordType = dataFieldColumn.RecordType;
1398
+ let dataFieldValue = dataFieldColumn?.Value;
1399
+ let dataFieldSemanticObject = dataFieldColumn.SemanticObject?.String || "";
1400
+ let dataFieldActionString = dataFieldColumn.Action?.String || "";
1401
+ let dataFieldPath = dataFieldValue?.Path || "";
1402
+ let annotationPath = "",
1403
+ isRelevantAnnotation = null;
1404
+ let buildKey = function (parts) {
1405
+ return fioriTemplatePrefix + seperatorNotation + parts.join(seperatorNotation);
1406
+ };
1407
+ switch (recordType) {
1408
+ case FieldAnnotationsType.DataField:
1409
+ columnKeyName = dataFieldPath;
1410
+ break;
1411
+ case FieldAnnotationsType.DataFieldWithIntentBasedNavigation:
1412
+ columnKeyName = buildKey([FieldTypes.DataFieldWithIntentBasedNavigation, dataFieldSemanticObject, dataFieldActionString, dataFieldPath]);
1413
+ break;
1414
+ case FieldAnnotationsType.DataFieldWithNavigationPath:
1415
+ columnKeyName = buildKey([FieldTypes.DataFieldWithNavigationPath, dataFieldPath]);
1416
+ break;
1417
+ case FieldAnnotationsType.DataFieldForIntentBasedNavigation:
1418
+ columnKeyName = buildKey([FieldTypes.DataFieldForIntentBasedNavigation, dataFieldSemanticObject, dataFieldActionString]);
1419
+ break;
1420
+ case FieldAnnotationsType.DataFieldForAction:
1421
+ columnKeyName = buildKey([FieldTypes.DataFieldForAction, dataFieldActionString]);
1422
+ break;
1423
+ case FieldAnnotationsType.DataFieldForAnnotation:
1424
+ annotationPath = dataFieldColumn.Target?.AnnotationPath;
1425
+ isRelevantAnnotation = annotationPath && (annotationPath.indexOf(FieldAnnotationsType.Contact) >= 0 || annotationPath.indexOf(FieldAnnotationsType.DataPoint) >= 0 || annotationPath.indexOf(FieldAnnotationsType.FieldGroup) >= 0 || annotationPath.indexOf(FieldAnnotationsType.Chart) >= 0);
1426
+ if (isRelevantAnnotation) {
1427
+ columnKeyName = buildKey([FieldTypes.DataFieldForAnnotation, annotationPath]);
1428
+ //since DataFieldForAnnotation can contain an @ and this is not working with SmartTable.prototype._addTablePersonalisationToToolbar, it is removed
1429
+ columnKeyName = columnKeyName.replace("@", "");
1430
+ }
1431
+ break;
1432
+ default:
1433
+ // Handle cases where the RecordType does not match any of the known types
1434
+ columnKeyName = "";
1435
+ break;
1436
+ }
1437
+ return columnKeyName;
1438
+ }
1439
+
1440
+ /**
1441
+ * Retrieves the navigation prefix path for a given entity type and value path.
1442
+ *
1443
+ * @param {object} oMetaModel - The meta model object.
1444
+ * @param {object} oContextSet - The context set object containing the entity type.
1445
+ * @param {string} sPath - The value path for which the navigation prefix is needed.
1446
+ * @returns {string} The navigation prefix path.
1447
+ */
1448
+ getNavigationPrefixPath(oMetaModel, oContextSet, sPath) {
1449
+ let sNavigation = "";
1450
+ if (oMetaModel) {
1451
+ let oEntityType = oMetaModel.getODataEntityType(oContextSet.entityType);
1452
+ if (oEntityType) {
1453
+ sNavigation = this._getNavigationPrefix(oMetaModel, oEntityType, sPath);
1454
+ if (sNavigation) {
1455
+ sNavigation += "/";
1456
+ }
1457
+ }
1458
+ }
1459
+ return sNavigation;
1460
+ }
1461
+
1462
+ /**
1463
+ * Retrieves the navigation prefix for a given property within an entity type.
1464
+ * @param {Object} metaModel - The metadata model object.
1465
+ * @param {Object} entityTypeData - The entity type object.
1466
+ * @param {string} propertyName - The property path for which the navigation prefix is to be determined.
1467
+ * @returns {string} The navigation prefix for the specified property.
1468
+ */
1469
+ _getNavigationPrefix(metaModel, entityTypeData, propertyName) {
1470
+ let expandName = "";
1471
+ let propertyParts = propertyName.split("/");
1472
+ if (propertyParts.length > 1) {
1473
+ for (let i = 0; i < propertyParts.length - 1; i++) {
1474
+ let associationEndData = metaModel.getODataAssociationEnd(entityTypeData, propertyParts[i]);
1475
+ if (!associationEndData) {
1476
+ return expandName;
1477
+ }
1478
+ if (associationEndData) {
1479
+ entityTypeData = metaModel.getODataEntityType(associationEndData.type);
1480
+ expandName += (expandName ? "/" : "") + propertyParts[i];
1481
+ }
1482
+ }
1483
+ }
1484
+ return expandName;
1485
+ }
1486
+
1487
+ /**
1488
+ * Processes additional properties for a given context property and data field.
1489
+ *
1490
+ * This method analyzes the provided context property and data field to extract additional properties
1491
+ * such as criticality, text annotations, unit annotations, and field control paths. It also determines
1492
+ * the type of the property (e.g., date, string) and appends this information to the P13N string.
1493
+ *
1494
+ * @param {UIAnnotationValue} oContextProp - The context property object containing metadata about the property.
1495
+ * @param {ILineItemContext} oDataField - The data field object containing line item metadata.
1496
+ * @param {string} sNavigationPath - The navigation path to be prefixed to certain properties.
1497
+ * @param {string[]} aAdditionalProperties - An array to which additional property paths will be added.
1498
+ * @returns {string} A P13N string containing additional property details such as type and unit.
1499
+ * @private
1500
+ */
1501
+ processAdditionalProperties(oContextProp, oDataField, sNavigationPath, aAdditionalProperties) {
1502
+ let additionalP13N = "";
1503
+
1504
+ // Check for DateTime type with specific display format
1505
+ if (oContextProp?.type === "Edm.DateTime" && oContextProp?.["sap:display-format"] === "Date") {
1506
+ additionalP13N += '", "type":"date';
1507
+ } else if (oContextProp?.type === "Edm.String") {
1508
+ additionalP13N += '", "type":"string';
1509
+ }
1510
+
1511
+ // Add Criticality property if available
1512
+ if (oDataField?.Criticality?.Path) {
1513
+ aAdditionalProperties.push(oDataField?.Criticality.Path);
1514
+ }
1515
+ let oContextCommonText = oContextProp?.[UIAnnotations.CommonText];
1516
+
1517
+ // Add Text annotation property if available
1518
+ if (oContextCommonText?.Path) {
1519
+ aAdditionalProperties.push(sNavigationPath + oContextCommonText?.Path);
1520
+ }
1521
+
1522
+ // Add Unit annotation property if available
1523
+ const oUnitAnnotation = oContextProp ? oContextProp[UIAnnotations.MeasuresISOCurrency] || oContextProp[UIAnnotations.MeasuresUnit] : null;
1524
+ if (oUnitAnnotation?.Path) {
1525
+ aAdditionalProperties.push(oUnitAnnotation.Path);
1526
+ additionalP13N += '", "unit":"' + oUnitAnnotation.Path;
1527
+ }
1528
+ // Add FieldControl property if available
1529
+ if (oContextProp?.[UIAnnotations.CommonFieldControl]?.Path) {
1530
+ aAdditionalProperties.push(sNavigationPath + oContextProp[UIAnnotations.CommonFieldControl].Path);
1531
+ }
1532
+ return additionalP13N;
1533
+ }
1534
+
1535
+ /**
1536
+ * Determines whether a column is supported for card creation.
1537
+ *
1538
+ * This method checks conditions to determine if a column is eligible for inclusion in a card,
1539
+ * conditions are kept similar to RT cards restrictions in V2 LR.
1540
+ *
1541
+ * @param {Record<string, string>} columnDataObject - The column data object containing metadata about the column.
1542
+ * @param {ILineItemContext} dataFieldDetails - The data field object containing line item metadata.
1543
+ * @param {ODataMetaModel} metaModel - The OData meta model containing metadata about entities and properties.
1544
+ * @param {IEntitySet} entitySetData - The entity set to which the column belongs.
1545
+ * @returns {boolean} `true` if the column is supported for card creation, otherwise `false`.
1546
+ * @private
1547
+ */
1548
+ isSupportedColumn(columnDataObject, dataFieldDetails, metaModel, entitySetData) {
1549
+ let sRecordType = dataFieldDetails.RecordType;
1550
+ if (sRecordType === FieldAnnotationsType.DataFieldForAnnotation || sRecordType === FieldAnnotationsType.DataFieldForAction || sRecordType === FieldAnnotationsType.DataFieldForIntentBasedNavigation || !columnDataObject) {
1551
+ return false;
1552
+ }
1553
+ let entityType = metaModel.getODataEntityType(entitySetData.entityType);
1554
+ let propertyDetails = metaModel.getODataProperty(entityType, columnDataObject.leadingProperty);
1555
+ let columnKeyName = columnDataObject.columnKey;
1556
+ if (this.checkMultiplicityForDataFieldAssociation(metaModel, entitySetData, dataFieldDetails) || columnKeyName && (columnKeyName.indexOf(FieldTypes.DataFieldForAnnotation) > -1 || columnKeyName.indexOf(FieldTypes.DataFieldForAction) > -1 || columnKeyName.indexOf(FieldTypes.DataFieldForIntentBasedNavigation) > -1 || propertyDetails?.[UIAnnotations.UIIsImageURL]?.Bool === "true")) {
1557
+ return false;
1558
+ }
1559
+ return true;
1560
+ }
1561
+
1562
+ /**
1563
+ * Checks the multiplicity of a data field's association in the OData model.
1564
+ *
1565
+ * This method verifies whether the association for a given data field has a multiplicity of `*` (many).
1566
+ * It traverses the navigation path of the data field to determine the multiplicity of the associated entity.
1567
+ *
1568
+ * @param {ODataMetaModel} metaModel - The OData meta model containing entity and association metadata.
1569
+ * @param {IEntitySet} entitySetData - The entity set to which the data field belongs.
1570
+ * @param {ILineItemContext} dataFieldValue - The data field whose association multiplicity is to be checked.
1571
+ * @returns {boolean} `true` if the association has a multiplicity of `*`, otherwise `false`.
1572
+ * @private
1573
+ */
1574
+ checkMultiplicityForDataFieldAssociation(metaModel, entitySetData, dataFieldValue) {
1575
+ if (dataFieldValue?.Value?.Path) {
1576
+ let dataFieldValuePath = dataFieldValue.Value.Path;
1577
+ let entityTypeData = metaModel && metaModel.getODataEntityType(entitySetData.entityType);
1578
+ let associationData;
1579
+ if (!(dataFieldValuePath.indexOf("/") > -1) || !entityTypeData) {
1580
+ return false;
1581
+ }
1582
+ while (dataFieldValuePath.indexOf("/") > -1) {
1583
+ //if complex path exists then check for multiplicity
1584
+ let navigationPropertyPath = dataFieldValuePath.split("/")[0];
1585
+ dataFieldValuePath = dataFieldValuePath.split("/").slice(1).join("/");
1586
+ entityTypeData = metaModel.getODataEntityType(associationData?.type) || entityTypeData;
1587
+ associationData = metaModel.getODataAssociationEnd(entityTypeData, navigationPropertyPath);
1588
+ }
1589
+ if (associationData && associationData.multiplicity === "*") {
1590
+ return true;
1591
+ }
1592
+ }
1593
+ return false;
1594
+ }
1595
+ }
1596
+ RecommendedCardUtil.FieldTypes = FieldTypes;
1597
+ return RecommendedCardUtil;
1598
+ });
1599
+ //# sourceMappingURL=RecommendedCardUtil-dbg.js.map