@sap/ux-specification 1.136.14 → 1.136.16

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 (322) hide show
  1. package/CHANGELOG.md +250 -146
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
  3. package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
  4. package/dist/documentation/v2/v2-ListReport.html +2 -2
  5. package/dist/documentation/v2/v2-ListReportNew.html +2 -2
  6. package/dist/documentation/v2/v2-ObjectPage.html +2 -2
  7. package/dist/documentation/v2/v2-OverviewPage.html +2 -2
  8. package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
  9. package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
  10. package/dist/documentation/v4/v4-FreestylePage.html +2 -2
  11. package/dist/documentation/v4/v4-ListReport.html +2 -2
  12. package/dist/documentation/v4/v4-ObjectPage.html +2 -2
  13. package/dist/index-min.js +269 -266
  14. package/dist/index-min.js.map +4 -4
  15. package/dist/schemas/v2/AnalyticalListPageConfig.json +3 -3
  16. package/dist/schemas/v2/ListReportConfig.json +5 -5
  17. package/dist/schemas/v2/ListReportNewConfig.json +1 -1
  18. package/dist/schemas/v2/ObjectPageConfig.json +5 -5
  19. package/dist/schemas/v4/ApplicationV4.json +1 -1
  20. package/dist/schemas/v4/BuildingBlocksConfig.json +120 -41
  21. package/dist/schemas/v4/ListReportConfig.json +275 -34
  22. package/dist/schemas/v4/ObjectPageConfig.json +417 -138
  23. package/dist/specification/package.json +13 -11
  24. package/dist/specification/scripts/extractDocu.js +18 -1
  25. package/dist/specification/scripts/extractDocu.js.map +1 -1
  26. package/dist/specification/scripts/generate-validity-report.d.ts +15 -0
  27. package/dist/specification/scripts/generate-validity-report.d.ts.map +1 -0
  28. package/dist/specification/scripts/generate-validity-report.js +367 -0
  29. package/dist/specification/scripts/generate-validity-report.js.map +1 -0
  30. package/dist/specification/scripts/macros/corrections.d.ts +40 -0
  31. package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
  32. package/dist/specification/scripts/macros/corrections.js +98 -7
  33. package/dist/specification/scripts/macros/corrections.js.map +1 -1
  34. package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
  35. package/dist/specification/scripts/macros/schema.js +11 -2
  36. package/dist/specification/scripts/macros/schema.js.map +1 -1
  37. package/dist/specification/scripts/macros/types.d.ts +2 -0
  38. package/dist/specification/scripts/macros/types.d.ts.map +1 -1
  39. package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
  40. package/dist/specification/scripts/schema/to-json-schema.js +2 -13
  41. package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
  42. package/dist/specification/src/api.d.ts.map +1 -1
  43. package/dist/specification/src/api.js +2 -1
  44. package/dist/specification/src/api.js.map +1 -1
  45. package/dist/specification/src/sync/common/DataFieldStrategy.d.ts +38 -8
  46. package/dist/specification/src/sync/common/DataFieldStrategy.d.ts.map +1 -1
  47. package/dist/specification/src/sync/common/DataFieldStrategy.js +64 -11
  48. package/dist/specification/src/sync/common/DataFieldStrategy.js.map +1 -1
  49. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +0 -4
  50. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -1
  51. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +0 -3
  52. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -1
  53. package/dist/specification/src/sync/common/appProvider.d.ts +0 -1
  54. package/dist/specification/src/sync/common/appProvider.d.ts.map +1 -1
  55. package/dist/specification/src/sync/common/appProvider.js +0 -1
  56. package/dist/specification/src/sync/common/appProvider.js.map +1 -1
  57. package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +503 -0
  58. package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -0
  59. package/dist/specification/src/sync/common/decoration/decorator-paths.js +497 -0
  60. package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -0
  61. package/dist/specification/src/sync/common/decoration/decorators.d.ts +149 -23
  62. package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
  63. package/dist/specification/src/sync/common/decoration/decorators.js +369 -74
  64. package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
  65. package/dist/specification/src/sync/common/decoration/index.d.ts +1 -0
  66. package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
  67. package/dist/specification/src/sync/common/decoration/index.js +1 -0
  68. package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
  69. package/dist/specification/src/sync/common/dist_tag.json +8 -3
  70. package/dist/specification/src/sync/common/generate/objectPage.d.ts +0 -1
  71. package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
  72. package/dist/specification/src/sync/common/generate/objectPage.js +0 -3
  73. package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
  74. package/dist/specification/src/sync/common/generate/utils.d.ts +3 -3
  75. package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
  76. package/dist/specification/src/sync/common/generate/utils.js +6 -3
  77. package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
  78. package/dist/specification/src/sync/common/i18n.json +2 -1
  79. package/dist/specification/src/sync/common/import/utils.d.ts +0 -1
  80. package/dist/specification/src/sync/common/import/utils.d.ts.map +1 -1
  81. package/dist/specification/src/sync/common/import/utils.js +0 -1
  82. package/dist/specification/src/sync/common/import/utils.js.map +1 -1
  83. package/dist/specification/src/sync/common/rules.js +0 -1
  84. package/dist/specification/src/sync/common/rules.js.map +1 -1
  85. package/dist/specification/src/sync/common/utils.d.ts +35 -8
  86. package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
  87. package/dist/specification/src/sync/common/utils.js +206 -22
  88. package/dist/specification/src/sync/common/utils.js.map +1 -1
  89. package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
  90. package/dist/specification/src/sync/v2/export/exportPageGeneric.js +3 -13
  91. package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
  92. package/dist/specification/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
  93. package/dist/specification/src/sync/v2/generate/analyticalListReport.js +48 -0
  94. package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  95. package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
  96. package/dist/specification/src/sync/v2/generate/listReport.js +3 -1
  97. package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
  98. package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
  99. package/dist/specification/src/sync/v2/generate/objectPage.js +2 -0
  100. package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
  101. package/dist/specification/src/sync/v2/generate/overviewPage.d.ts +1 -9
  102. package/dist/specification/src/sync/v2/generate/overviewPage.d.ts.map +1 -1
  103. package/dist/specification/src/sync/v2/generate/overviewPage.js +30 -1
  104. package/dist/specification/src/sync/v2/generate/overviewPage.js.map +1 -1
  105. package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
  106. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +28 -1
  107. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
  108. package/dist/specification/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
  109. package/dist/specification/src/sync/v2/import/app/appProvider.js +2 -0
  110. package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
  111. package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -1
  112. package/dist/specification/src/sync/v2/import/importPage.js +5 -6
  113. package/dist/specification/src/sync/v2/import/importPage.js.map +1 -1
  114. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts +2 -1
  115. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -1
  116. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js +5 -0
  117. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
  118. package/dist/specification/src/sync/v2/import/pages/listReport.d.ts +2 -1
  119. package/dist/specification/src/sync/v2/import/pages/listReport.d.ts.map +1 -1
  120. package/dist/specification/src/sync/v2/import/pages/listReport.js +5 -0
  121. package/dist/specification/src/sync/v2/import/pages/listReport.js.map +1 -1
  122. package/dist/specification/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
  123. package/dist/specification/src/sync/v2/import/pages/objectPage.js +2 -1
  124. package/dist/specification/src/sync/v2/import/pages/objectPage.js.map +1 -1
  125. package/dist/specification/src/sync/v2/import/utils.d.ts +28 -1
  126. package/dist/specification/src/sync/v2/import/utils.d.ts.map +1 -1
  127. package/dist/specification/src/sync/v2/import/utils.js +37 -0
  128. package/dist/specification/src/sync/v2/import/utils.js.map +1 -1
  129. package/dist/specification/src/sync/v2/utils.d.ts +12 -2
  130. package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
  131. package/dist/specification/src/sync/v2/utils.js +19 -2
  132. package/dist/specification/src/sync/v2/utils.js.map +1 -1
  133. package/dist/specification/src/sync/v4/application.d.ts +21 -3
  134. package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
  135. package/dist/specification/src/sync/v4/application.js +28 -3
  136. package/dist/specification/src/sync/v4/application.js.map +1 -1
  137. package/dist/specification/src/sync/v4/export/actions.d.ts +39 -0
  138. package/dist/specification/src/sync/v4/export/actions.d.ts.map +1 -0
  139. package/dist/specification/src/sync/v4/export/actions.js +99 -0
  140. package/dist/specification/src/sync/v4/export/actions.js.map +1 -0
  141. package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts +2 -1
  142. package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -1
  143. package/dist/specification/src/sync/v4/export/controls/FilterBar.js +2 -1
  144. package/dist/specification/src/sync/v4/export/controls/FilterBar.js.map +1 -1
  145. package/dist/specification/src/sync/v4/export/controls/Header.d.ts +4 -3
  146. package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
  147. package/dist/specification/src/sync/v4/export/controls/Header.js +7 -3
  148. package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
  149. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +2 -1
  150. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
  151. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -0
  152. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
  153. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +2 -1
  154. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
  155. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js +2 -1
  156. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
  157. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts +2 -1
  158. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -1
  159. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js.map +1 -1
  160. package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.d.ts +2 -4
  161. package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.d.ts.map +1 -1
  162. package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.js +2 -21
  163. package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.js.map +1 -1
  164. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts +2 -2
  165. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
  166. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
  167. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts +14 -3
  168. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
  169. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js +52 -9
  170. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js.map +1 -1
  171. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +1 -1
  172. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
  173. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +0 -13
  174. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
  175. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +15 -3
  176. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts.map +1 -1
  177. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js +53 -10
  178. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -1
  179. package/dist/specification/src/sync/v4/export/controls/Table.d.ts +24 -18
  180. package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
  181. package/dist/specification/src/sync/v4/export/controls/Table.js +40 -49
  182. package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
  183. package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
  184. package/dist/specification/src/sync/v4/export/controls/TableColumn.js +2 -2
  185. package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  186. package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +9 -2
  187. package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
  188. package/dist/specification/src/sync/v4/export/controls/ToolBar.js +39 -1
  189. package/dist/specification/src/sync/v4/export/controls/ToolBar.js.map +1 -1
  190. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +17 -4
  191. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
  192. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +76 -19
  193. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
  194. package/dist/specification/src/sync/v4/export/export.d.ts +7 -0
  195. package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
  196. package/dist/specification/src/sync/v4/export/export.js +125 -14
  197. package/dist/specification/src/sync/v4/export/export.js.map +1 -1
  198. package/dist/specification/src/sync/v4/export/pages/ListReport.js +1 -1
  199. package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
  200. package/dist/specification/src/sync/v4/export/types.d.ts +2 -0
  201. package/dist/specification/src/sync/v4/export/types.d.ts.map +1 -1
  202. package/dist/specification/src/sync/v4/generate/actions.d.ts +35 -0
  203. package/dist/specification/src/sync/v4/generate/actions.d.ts.map +1 -0
  204. package/dist/specification/src/sync/v4/generate/actions.js +112 -0
  205. package/dist/specification/src/sync/v4/generate/actions.js.map +1 -0
  206. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +3 -3
  207. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts.map +1 -1
  208. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +11 -3
  209. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
  210. package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.d.ts +1 -1
  211. package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.d.ts.map +1 -1
  212. package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js +3 -2
  213. package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js.map +1 -1
  214. package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.d.ts.map +1 -1
  215. package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +25 -3
  216. package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
  217. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.d.ts.map +1 -1
  218. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +11 -2
  219. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
  220. package/dist/specification/src/sync/v4/generate/index.d.ts +1 -1
  221. package/dist/specification/src/sync/v4/generate/index.d.ts.map +1 -1
  222. package/dist/specification/src/sync/v4/generate/index.js +1 -1
  223. package/dist/specification/src/sync/v4/generate/index.js.map +1 -1
  224. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts +73 -0
  225. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts.map +1 -0
  226. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js +354 -0
  227. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js.map +1 -0
  228. package/dist/specification/src/sync/v4/generate/{listReport.d.ts → list-report/listReport.d.ts} +46 -19
  229. package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts.map +1 -0
  230. package/dist/specification/src/sync/v4/generate/{listReport.js → list-report/listReport.js} +195 -316
  231. package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -0
  232. package/dist/specification/src/sync/v4/generate/objectPage.d.ts +0 -1
  233. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  234. package/dist/specification/src/sync/v4/generate/objectPage.js +148 -56
  235. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  236. package/dist/specification/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
  237. package/dist/specification/src/sync/v4/import/pages/listReport.js +2 -1
  238. package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
  239. package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
  240. package/dist/specification/src/sync/v4/import/pages/objectPage.js +16 -3
  241. package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
  242. package/dist/specification/src/sync/v4/import/utils.d.ts +0 -1
  243. package/dist/specification/src/sync/v4/import/utils.d.ts.map +1 -1
  244. package/dist/specification/src/sync/v4/import/utils.js +5 -4
  245. package/dist/specification/src/sync/v4/import/utils.js.map +1 -1
  246. package/dist/specification/src/sync/v4/sync-rules/App.d.ts +9 -7
  247. package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
  248. package/dist/specification/src/sync/v4/sync-rules/App.js +4 -8
  249. package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -1
  250. package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +2 -9
  251. package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
  252. package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +2 -11
  253. package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
  254. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +177 -46
  255. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
  256. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +498 -152
  257. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
  258. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +17 -22
  259. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
  260. package/dist/specification/src/sync/v4/sync-rules/Page.js +15 -22
  261. package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
  262. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts +1 -0
  263. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts.map +1 -1
  264. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js +17 -9
  265. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js.map +1 -1
  266. package/dist/specification/src/sync/v4/sync-rules/index.d.ts +5 -0
  267. package/dist/specification/src/sync/v4/sync-rules/index.d.ts.map +1 -0
  268. package/dist/specification/src/sync/v4/sync-rules/index.js +21 -0
  269. package/dist/specification/src/sync/v4/sync-rules/index.js.map +1 -0
  270. package/dist/specification/src/sync/v4/sync-rules/utils.d.ts.map +1 -1
  271. package/dist/specification/src/sync/v4/sync-rules/utils.js +4 -0
  272. package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -1
  273. package/dist/specification/src/sync/v4/utils/index.d.ts +2 -0
  274. package/dist/specification/src/sync/v4/utils/index.d.ts.map +1 -0
  275. package/dist/specification/src/sync/v4/utils/index.js +18 -0
  276. package/dist/specification/src/sync/v4/utils/index.js.map +1 -0
  277. package/dist/specification/src/sync/v4/utils/utils.d.ts +112 -26
  278. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  279. package/dist/specification/src/sync/v4/utils/utils.js +374 -46
  280. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  281. package/dist/specification/test/test-projects/v2sttaProdMan2/webapp/manifest.json +550 -0
  282. package/dist/specification/test/test-projects/v4new/webapp/manifest.json +147 -0
  283. package/dist/specification/test/test-utils/utils.d.ts +71 -0
  284. package/dist/specification/test/test-utils/utils.d.ts.map +1 -0
  285. package/dist/specification/test/test-utils/utils.js +400 -0
  286. package/dist/specification/test/test-utils/utils.js.map +1 -0
  287. package/dist/specification/test/unit/decorators/validity-test-utils.d.ts +131 -0
  288. package/dist/specification/test/unit/decorators/validity-test-utils.d.ts.map +1 -0
  289. package/dist/specification/test/unit/decorators/validity-test-utils.js +661 -0
  290. package/dist/specification/test/unit/decorators/validity-test-utils.js.map +1 -0
  291. package/dist/types/src/apiTypes.d.ts +5 -5
  292. package/dist/types/src/apiTypes.d.ts.map +1 -1
  293. package/dist/types/src/apiTypes.js +1 -0
  294. package/dist/types/src/apiTypes.js.map +1 -1
  295. package/dist/types/src/common/types.d.ts +162 -15
  296. package/dist/types/src/common/types.d.ts.map +1 -1
  297. package/dist/types/src/common/types.js +41 -2
  298. package/dist/types/src/common/types.js.map +1 -1
  299. package/dist/types/src/v2/controls/ObjectPageTable.d.ts +1 -1
  300. package/dist/types/src/v2/controls/Table.d.ts +1 -1
  301. package/dist/types/src/v4/controls/CustomAction.d.ts +133 -19
  302. package/dist/types/src/v4/controls/CustomAction.d.ts.map +1 -1
  303. package/dist/types/src/v4/controls/CustomAction.js.map +1 -1
  304. package/dist/types/src/v4/controls/ObjectPageForm.d.ts +2 -2
  305. package/dist/types/src/v4/controls/ObjectPageForm.d.ts.map +1 -1
  306. package/dist/types/src/v4/controls/ObjectPageHeader.d.ts +22 -3
  307. package/dist/types/src/v4/controls/ObjectPageHeader.d.ts.map +1 -1
  308. package/dist/types/src/v4/controls/ObjectPageTable.d.ts +1 -1
  309. package/dist/types/src/v4/controls/ObjectPageTable.d.ts.map +1 -1
  310. package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts +2 -2
  311. package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts.map +1 -1
  312. package/dist/types/src/v4/controls/Table.d.ts +3 -3
  313. package/dist/types/src/v4/controls/Table.d.ts.map +1 -1
  314. package/dist/types/src/v4/controls/ToolBar.d.ts +3 -3
  315. package/dist/types/src/v4/controls/ToolBar.d.ts.map +1 -1
  316. package/package.json +14 -12
  317. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +0 -107
  318. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +0 -1
  319. package/dist/specification/src/sync/v4/generate/ListReportUtils.js +0 -392
  320. package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +0 -1
  321. package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +0 -1
  322. package/dist/specification/src/sync/v4/generate/listReport.js.map +0 -1
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Decorator = exports.BaseClass = void 0;
6
+ exports.Decorator = exports.BaseClass = exports.BaseConstruct = void 0;
7
7
  const ux_specification_types_1 = require("@sap/ux-specification-types");
8
8
  const decoration_1 = require("../../common/decoration");
9
9
  const i18next_1 = __importDefault(require("i18next"));
10
+ const jsonpath_plus_1 = require("jsonpath-plus");
10
11
  const utils_1 = require("./utils");
11
12
  /**
12
13
  * Adds a message to a schema element.
@@ -23,25 +24,67 @@ function addMessageToSchema(element, { text, deletable = false }) {
23
24
  }
24
25
  element[ux_specification_types_1.SchemaTag.messages].push({ text, deletable });
25
26
  }
26
- class BaseClass {
27
+ class BaseConstruct {
27
28
  /**
28
- * Creates an instance of BaseClass.
29
+ * Constructor for BaseConstruct.
29
30
  *
30
- * @param appSchema - The application schema definition
31
+ * @param settings - General settings including appSchema, app, page, and logger
31
32
  */
32
- constructor(appSchema) {
33
- // Define appSchema as non-enumerable to hide it from serialization and Object.keys()
33
+ constructor(settings) {
34
+ const { app, appSchema, page, logger } = settings || {};
35
+ // Define properties as non-enumerable to hide them from serialization and Object.keys()
34
36
  Object.defineProperty(this, 'appSchema', {
35
37
  value: appSchema,
36
- writable: true,
38
+ writable: false,
39
+ enumerable: false,
40
+ configurable: true
41
+ });
42
+ Object.defineProperty(this, 'app', {
43
+ value: app,
44
+ writable: false,
45
+ enumerable: false,
46
+ configurable: true
47
+ });
48
+ Object.defineProperty(this, 'page', {
49
+ value: page,
50
+ writable: false,
51
+ enumerable: false,
52
+ configurable: true
53
+ });
54
+ Object.defineProperty(this, 'logger', {
55
+ value: logger,
56
+ writable: false,
37
57
  enumerable: false,
38
58
  configurable: true
39
59
  });
60
+ }
61
+ /**
62
+ * Gets the general settings.
63
+ *
64
+ * @returns The general settings object
65
+ */
66
+ getSettings() {
67
+ return {
68
+ appSchema: this.appSchema,
69
+ app: this.app,
70
+ page: this.page,
71
+ logger: this.logger
72
+ };
73
+ }
74
+ }
75
+ exports.BaseConstruct = BaseConstruct;
76
+ class BaseClass extends BaseConstruct {
77
+ /**
78
+ * Creates an instance of BaseClass.
79
+ *
80
+ * @param settings - General settings including appSchema, app, page, and logger
81
+ */
82
+ constructor(settings) {
83
+ super(settings);
40
84
  const name = this.getClassName();
41
- const definitions = appSchema?.definitions;
42
85
  // Define base as non-enumerable to hide it from serialization and Object.keys()
43
86
  Object.defineProperty(this, 'base', {
44
- value: { name, definition: definitions?.[name] },
87
+ value: { name, definition: this.appSchema?.get().definitions?.[name] },
45
88
  writable: true,
46
89
  enumerable: false,
47
90
  configurable: true
@@ -71,22 +114,6 @@ class BaseClass {
71
114
  getBase() {
72
115
  return this.base.definition;
73
116
  }
74
- /**
75
- * Sets the base definition and name.
76
- *
77
- * @param base - The base object containing name and definition
78
- */
79
- setBase(base) {
80
- this.base = base;
81
- }
82
- /**
83
- * Gets the definitions from the app schema.
84
- *
85
- * @returns The definitions object or undefined
86
- */
87
- getDefinitions() {
88
- return this.appSchema?.definitions;
89
- }
90
117
  /**
91
118
  * Creates an annotation path for schema based on entity type, term, and qualifier.
92
119
  *
@@ -110,57 +137,106 @@ class BaseClass {
110
137
  exports.BaseClass = BaseClass;
111
138
  class Decorator extends BaseClass {
112
139
  /**
113
- * Sets the parent decorator instance for this object.
114
- * This enables nested decorators to access parent properties using the '../' prefix in @dependsOn.
140
+ * Creates an instance of Decorator.
115
141
  *
116
- * @param parent - The parent Decorator instance
117
- * @returns this (for method chaining)
142
+ * @param settings - General settings including appSchema, app, page, and logger
118
143
  */
119
- setParent(parent) {
120
- this.__parent__ = parent;
121
- return this;
144
+ constructor(settings) {
145
+ super(settings);
146
+ // Define decoratorContext as non-enumerable to hide from serialization
147
+ Object.defineProperty(this, 'decoratorContext', {
148
+ value: {},
149
+ writable: true,
150
+ enumerable: false,
151
+ configurable: true
152
+ });
122
153
  }
123
154
  /**
124
- * Gets the parent decorator instance if it exists.
155
+ * Initializes the decorator by applying all decorators to the schema definition.
156
+ *
157
+ * The decorator context is structured as:
158
+ * - `app`: The App configuration (from `this.app.config`, includes manifest)
159
+ * - `page`: The Page configuration (from `this.page.config`)
160
+ * - `custom`: Custom context provided by the caller.
161
+ *
162
+ * @param customContext - Optional custom context for decorator conditions.
163
+ * Use this for runtime-specific conditions like table state, section state, etc.
164
+ * @param definition - Optional custom definition to apply decorators to.
165
+ * If provided, decorators are applied to this definition instead of the one from appSchema.
166
+ * @example
167
+ * ```typescript
168
+ * // Basic initialization (app and page auto-injected)
169
+ * decorator.init();
170
+ *
171
+ * // With custom context for table-specific conditions
172
+ * decorator.init({
173
+ * table: { type: 'GridTable', views: [] }
174
+ * });
125
175
  *
126
- * @returns The parent Decorator instance or undefined
176
+ * // With custom definition (for dynamically created definitions)
177
+ * decorator.init({ table: { type: 'GridTable' } }, customTableDefinition);
178
+ * ```
127
179
  */
128
- getParent() {
129
- return this.__parent__;
180
+ init(customContext, definition) {
181
+ this.decoratorContext = {
182
+ app: this.app?.config,
183
+ page: this.page?.config,
184
+ custom: customContext
185
+ };
186
+ // @ToDo activate for actual use of minUI5Version.
187
+ // const minUi5Version = this.app?.getMinUI5Version();
188
+ this.applyDecorators(undefined, undefined, definition);
130
189
  }
131
190
  /**
132
- * Helper method to get property value from an object using a property path.
133
- * Supports simple property names (e.g., 'visualFilters'), nested paths (e.g., 'settings.enabled'),
134
- * and parent traversal (e.g., '../type' to access parent object's type property).
191
+ * Gets property value from the decorator context using a property path.
135
192
  *
136
- * @param syncInstance - The object instance to retrieve the property value from
137
- * @param propertyPath - The property path (e.g., 'visualFilters', 'settings.enabled', or '../type')
193
+ * The path must include an explicit source prefix ('app', 'page', or 'custom').
194
+ *
195
+ * @param propertyPath - The property path with explicit source prefix - supports full jsonpath syntax
138
196
  * @returns Object containing the final key and its value, or undefined if not found
197
+ * @example
198
+ * ```typescript
199
+ * // With decoratorContext = {
200
+ * // app: { manifest: { 'sap.ui5': { routing: {...} } } },
201
+ * // page: { isALP: true },
202
+ * // custom: { type: 'GridTable', items: [{ name: 'Item1' }, { name: 'Item2' }] }
203
+ * // }
204
+ * getPropertyKeyValue('page.isALP') // { key: 'isALP', value: true }
205
+ * getPropertyKeyValue('custom.items[0]') // { key: '0', value: { name: 'Item1' } }
206
+ * getPropertyKeyValue('custom.items[1].name') // { key: 'name', value: 'Item2' }
207
+ * getPropertyKeyValue('app.manifest["sap.ui5"]') // Access property with dot in name
208
+ * getPropertyKeyValue('$.app.manifest["sap.ui5"].routing') // JSONPath with root reference
209
+ * getPropertyKeyValue('$app["manifest"]["sap.ui5"]') // Alternative JSONPath format
210
+ * ```
139
211
  */
140
- getPropertyKeyValue(syncInstance, propertyPath) {
141
- if (!syncInstance || !propertyPath) {
212
+ getPropertyKeyValue(propertyPath) {
213
+ if (!propertyPath || !this.decoratorContext) {
142
214
  return undefined;
143
215
  }
144
- // Handle parent traversal (../)
145
- if (propertyPath.startsWith('../')) {
146
- const parent = this.getParent();
147
- if (!parent) {
148
- return undefined;
149
- }
150
- // Remove '../' and get the property from parent
151
- const parentPath = propertyPath.substring(3);
152
- return this.getPropertyKeyValue(parent, parentPath);
153
- }
154
- const keys = propertyPath.split('.');
155
- let value = syncInstance;
156
- for (const key of keys) {
157
- if (value === null || value === undefined) {
216
+ try {
217
+ // Ensure path starts with $ for JSONPath
218
+ const jsonPath = propertyPath.startsWith('$') ? propertyPath : `$.${propertyPath}`;
219
+ // Use JSONPath to query with resultType 'all' to get both value and metadata
220
+ const results = (0, jsonpath_plus_1.JSONPath)({
221
+ path: jsonPath,
222
+ json: this.decoratorContext,
223
+ resultType: 'all'
224
+ });
225
+ // JSONPath with resultType 'all' returns an array of result objects
226
+ if (!results || results.length === 0) {
158
227
  return undefined;
159
228
  }
160
- value = value[key];
229
+ // Get the first result (wrap: false behavior)
230
+ const result = results[0];
231
+ // parentProperty contains the last key in the path
232
+ const key = String(result.parentProperty);
233
+ const value = result.value;
234
+ return { key, value };
235
+ }
236
+ catch {
237
+ // If JSONPath fails, return undefined
238
+ return undefined;
161
239
  }
162
- const key = keys[keys.length - 1];
163
- return { key, value };
164
240
  }
165
241
  /**
166
242
  * Evaluates a single dependency condition.
@@ -169,11 +245,17 @@ class Decorator extends BaseClass {
169
245
  * @param condition.path - The property path to check
170
246
  * @param condition.dependsOn - Optional custom condition function
171
247
  * @param condition.expectedValue - Optional expected value for equality check
172
- * @param syncRuleProviderInstance - The sync rule provider instance
248
+ * @param condition.negate - Optional flag to invert the condition result
173
249
  * @returns Object containing whether condition passed and the dependency value
174
250
  */
175
- evaluateSingleCondition(condition, syncRuleProviderInstance) {
176
- const { key, value } = this.getPropertyKeyValue(syncRuleProviderInstance, condition.path);
251
+ evaluateSingleCondition(condition) {
252
+ // Handle special __always__ path (from @hide(true))
253
+ if (condition.path === '__always__') {
254
+ return { passed: true, value: true, key: '__always__' };
255
+ }
256
+ const result = this.getPropertyKeyValue(condition.path);
257
+ const key = result?.key ?? condition.path;
258
+ const value = result?.value;
177
259
  let passed = false;
178
260
  if (condition.dependsOn) {
179
261
  // Use custom condition function
@@ -187,12 +269,16 @@ class Decorator extends BaseClass {
187
269
  // Default: truthy check
188
270
  passed = !!value;
189
271
  }
272
+ // Apply negation if negate flag is set (from not() helper)
273
+ if (condition.negate) {
274
+ passed = !passed;
275
+ }
190
276
  return { passed, value, key };
191
277
  }
192
278
  /**
193
279
  * Helper method to add a message to the schema property based on value condition.
194
280
  *
195
- * @param condition - EnumValueCondition object containing condition details
281
+ * @param condition - DecoratorMetadata or EnumValueCondition object containing condition details
196
282
  * @param syncRuleProviderInstance - The instance of the sync rule provider
197
283
  * @param definition - The schema property definition
198
284
  * @param i18nProperties - i18n properties for message translation
@@ -200,11 +286,58 @@ class Decorator extends BaseClass {
200
286
  * @param i18nProperties.context - The context for the message
201
287
  */
202
288
  addConditionalMessage(condition, syncRuleProviderInstance, definition, i18nProperties) {
203
- const messageText = typeof condition.message.text === 'function'
204
- ? condition.message.text(syncRuleProviderInstance)
205
- : i18next_1.default.t('PROPERTY_NOT_ALLOWED', { ...i18nProperties });
289
+ // Handle new MessageConfig format (from msg() helper)
290
+ const metadata = condition;
291
+ if (metadata.messageConfig && (0, decoration_1.isMessageConfig)(metadata.messageConfig)) {
292
+ // Resolve any PathNode values in the params
293
+ const resolvedParams = this.resolveMessageParams(metadata.messageConfig.params);
294
+ const messageText = i18next_1.default.t(metadata.messageConfig.i18nKey, resolvedParams);
295
+ addMessageToSchema(definition, { text: messageText, deletable: metadata.messageConfig.deletable });
296
+ return;
297
+ }
298
+ // Handle legacy DependsOnMessage format
299
+ if (!condition.message) {
300
+ return;
301
+ }
302
+ let messageText;
303
+ if (typeof condition.message.text === 'function') {
304
+ messageText = condition.message.text(syncRuleProviderInstance);
305
+ }
306
+ else if (typeof condition.message.text === 'string') {
307
+ messageText = condition.message.text;
308
+ }
309
+ else if (condition.message.text === true) {
310
+ // true means use default i18n translation
311
+ messageText = i18next_1.default.t('PROPERTY_NOT_ALLOWED', { ...i18nProperties });
312
+ }
313
+ else {
314
+ messageText = i18next_1.default.t('PROPERTY_NOT_ALLOWED', { ...i18nProperties });
315
+ }
206
316
  addMessageToSchema(definition, { text: messageText, deletable: condition.message.deletable });
207
317
  }
318
+ /**
319
+ * Resolves PathNode values in message params to their actual values from the decorator context.
320
+ *
321
+ * @param params - The message params potentially containing PathNode values
322
+ * @returns The params with PathNode values resolved to actual values
323
+ */
324
+ resolveMessageParams(params) {
325
+ if (!params) {
326
+ return params;
327
+ }
328
+ const resolved = {};
329
+ for (const [key, value] of Object.entries(params)) {
330
+ if ((0, decoration_1.isPathNode)(value)) {
331
+ // Resolve PathNode to actual value
332
+ const result = this.getPropertyKeyValue((0, decoration_1.getPath)(value));
333
+ resolved[key] = result?.value ?? '';
334
+ }
335
+ else {
336
+ resolved[key] = value;
337
+ }
338
+ }
339
+ return resolved;
340
+ }
208
341
  /**
209
342
  * Gets the context message from evaluation results.
210
343
  *
@@ -218,43 +351,217 @@ class Decorator extends BaseClass {
218
351
  .join(', ');
219
352
  }
220
353
  /**
221
- * Applies the dependsOn decorator to the schema definition.
354
+ * Evaluates an AND condition item which can be either a single condition or a nested OR group.
222
355
  *
223
- * @param schemaDefinition - The schema definition to apply the decorator to
224
- * @param syncRuleProviderInstance - The sync rule provider instance
356
+ * @param conditionItem - The condition item to evaluate
357
+ * @returns Object containing whether condition passed and evaluation details
358
+ */
359
+ evaluateAndConditionItem(conditionItem) {
360
+ // Check if this is a nested OR group
361
+ if ((0, decoration_1.isOrConditionGroup)(conditionItem)) {
362
+ // Evaluate the nested OR - at least one must pass
363
+ return this.evaluateOrConditions(conditionItem.__orConditions);
364
+ }
365
+ // It's a single condition
366
+ const result = this.evaluateSingleCondition(conditionItem);
367
+ return { passed: result.passed, results: [result] };
368
+ }
369
+ /**
370
+ * Evaluates OR conditions (at least one condition must match).
371
+ * Supports both single conditions and nested AND groups.
372
+ *
373
+ * @param orConditions - Array of condition items (single conditions or AND groups)
374
+ * @returns Object containing whether any condition passed and evaluation details
375
+ */
376
+ evaluateOrConditions(orConditions) {
377
+ const allResults = [];
378
+ for (const conditionItem of orConditions) {
379
+ // Check if this is a nested AND group
380
+ if ((0, decoration_1.isAndConditionGroup)(conditionItem)) {
381
+ // Evaluate all conditions in the AND group - all must pass
382
+ const andResults = [];
383
+ let allAndPassed = true;
384
+ for (const andItem of conditionItem.__andConditions) {
385
+ const { passed, results } = this.evaluateAndConditionItem(andItem);
386
+ andResults.push(...results);
387
+ if (!passed) {
388
+ allAndPassed = false;
389
+ // Don't break - we want all results for context
390
+ }
391
+ }
392
+ allResults.push(...andResults);
393
+ if (allAndPassed) {
394
+ // Short-circuit: if this AND group passes, the OR passes
395
+ return { passed: true, results: allResults };
396
+ }
397
+ }
398
+ else {
399
+ // Single condition (symmetric with AND handling)
400
+ const result = this.evaluateSingleCondition(conditionItem);
401
+ allResults.push(result);
402
+ if (result.passed) {
403
+ // Short-circuit: if any condition passes, the OR passes
404
+ return { passed: true, results: allResults };
405
+ }
406
+ }
407
+ }
408
+ return { passed: false, results: allResults };
409
+ }
410
+ /**
411
+ * Evaluates AND conditions (all conditions must match).
412
+ * Supports both single conditions and nested OR groups.
413
+ *
414
+ * @param andConditions - Array of condition items (single conditions or OR groups)
415
+ * @returns Object containing whether all conditions passed and evaluation details
416
+ */
417
+ evaluateAndConditions(andConditions) {
418
+ const allResults = [];
419
+ let allPassed = true;
420
+ for (const conditionItem of andConditions) {
421
+ const { passed, results } = this.evaluateAndConditionItem(conditionItem);
422
+ allResults.push(...results);
423
+ if (!passed) {
424
+ allPassed = false;
425
+ // Continue to collect all results for context
426
+ }
427
+ }
428
+ return { passed: allPassed, results: allResults };
429
+ }
430
+ /**
431
+ * Evaluates condition metadata and returns whether the condition is met and the context.
432
+ *
433
+ * @param conditionInfo - The condition metadata
434
+ * @returns Object with passed (boolean) and context (string)
435
+ */
436
+ evaluateCondition(conditionInfo) {
437
+ let passed = false;
438
+ let context = '';
439
+ if (conditionInfo.orConditions && Array.isArray(conditionInfo.orConditions)) {
440
+ // OR logic: At least one condition object must match
441
+ const result = this.evaluateOrConditions(conditionInfo.orConditions);
442
+ passed = result.passed;
443
+ context = this.getContextForMessage(result.results);
444
+ }
445
+ else if (conditionInfo.conditions && Array.isArray(conditionInfo.conditions)) {
446
+ // Multi-condition: ALL must be met (AND logic)
447
+ // Now supports nested OR groups via evaluateAndConditions
448
+ const result = this.evaluateAndConditions(conditionInfo.conditions);
449
+ passed = result.passed;
450
+ context = this.getContextForMessage(result.results);
451
+ }
452
+ else if (conditionInfo.path) {
453
+ // Single condition
454
+ const result = this.evaluateSingleCondition(conditionInfo);
455
+ passed = result.passed;
456
+ context = this.getContextForMessage([result]);
457
+ }
458
+ return { passed, context };
459
+ }
460
+ /**
461
+ * Iterates over schema properties and yields property info for decorator processing.
462
+ * Centralizes the guard clause and property iteration logic.
463
+ *
464
+ * @param schemaDefinition - The schema definition to process
465
+ * @param target - The target object (used for guard clause validation)
466
+ * @yields Property name and definition for each property in the schema
225
467
  */
226
- applyDependsOnDecorator(schemaDefinition, syncRuleProviderInstance) {
227
- if (!schemaDefinition?.properties || !syncRuleProviderInstance) {
468
+ *iterateProperties(schemaDefinition, target) {
469
+ if (!schemaDefinition?.properties || !target) {
228
470
  return;
229
471
  }
230
472
  for (const propertyName in schemaDefinition.properties) {
231
473
  const property = schemaDefinition.properties[propertyName];
232
- const dependsOnInfo = (0, decoration_1.getDependsOnMetadata)(syncRuleProviderInstance, propertyName);
233
- if (dependsOnInfo) {
234
- let shouldHide = false;
235
- let context = '';
236
- // Check if this is multi-condition or single condition
237
- if (dependsOnInfo.conditions && Array.isArray(dependsOnInfo.conditions)) {
238
- // Multi-condition: ALL must be met (AND logic)
239
- const results = dependsOnInfo.conditions.map((condition) => this.evaluateSingleCondition(condition, syncRuleProviderInstance));
240
- // All conditions must pass
241
- shouldHide = !results.every((result) => result.passed);
242
- context = this.getContextForMessage(results);
243
- }
244
- else {
245
- const result = this.evaluateSingleCondition(dependsOnInfo, syncRuleProviderInstance);
246
- context = this.getContextForMessage([result]);
247
- shouldHide = !result.passed;
474
+ yield { propertyName, property };
475
+ }
476
+ }
477
+ /**
478
+ * Applies the hide decorator to the schema definition.
479
+ * Hides properties when their condition evaluates to true, but only if
480
+ * the message decorator did not add any messages to the property.
481
+ *
482
+ * @param schemaDefinition - The schema definition to apply the decorator to
483
+ * @param syncRuleProviderInstance - The sync rule provider instance
484
+ */
485
+ applyHideDecorator(schemaDefinition, syncRuleProviderInstance) {
486
+ for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
487
+ const hideInfo = (0, decoration_1.getHideMetadata)(syncRuleProviderInstance, propertyName);
488
+ if (hideInfo) {
489
+ const { passed } = this.evaluateCondition(hideInfo);
490
+ // Hide when condition IS met (passed=true means hide)
491
+ // But only if no messages were added by the message decorator
492
+ const hasMessages = Array.isArray(property[ux_specification_types_1.SchemaTag.messages]) && property[ux_specification_types_1.SchemaTag.messages].length > 0;
493
+ if (passed && !hasMessages) {
494
+ property[ux_specification_types_1.SchemaTag.hidden] = true;
248
495
  }
249
- if (shouldHide) {
250
- if (dependsOnInfo.message) {
251
- this.addConditionalMessage(dependsOnInfo, syncRuleProviderInstance, property, {
496
+ }
497
+ }
498
+ }
499
+ /**
500
+ * Applies the message decorator to the schema definition.
501
+ * Shows messages when their condition evaluates to true.
502
+ *
503
+ * @param schemaDefinition - The schema definition to apply the decorator to
504
+ * @param syncRuleProviderInstance - The sync rule provider instance
505
+ */
506
+ applyMessageDecorator(schemaDefinition, syncRuleProviderInstance) {
507
+ for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
508
+ const messageInfoList = (0, decoration_1.getMessageMetadata)(syncRuleProviderInstance, propertyName);
509
+ if (messageInfoList) {
510
+ for (const messageInfo of messageInfoList) {
511
+ const { passed, context } = this.evaluateCondition(messageInfo);
512
+ if (passed && (messageInfo.message || messageInfo.messageConfig)) {
513
+ this.addConditionalMessage(messageInfo, syncRuleProviderInstance, property, {
252
514
  propertyName,
253
515
  context
254
516
  });
255
517
  }
256
- // Alternative to hide: delete schemaDefinition.properties[propertyName];
257
- property[ux_specification_types_1.SchemaTag.hidden] = true;
518
+ }
519
+ }
520
+ }
521
+ }
522
+ /**
523
+ * Applies the readonly decorator to the schema definition.
524
+ * Marks properties as readonly when their condition evaluates to true.
525
+ *
526
+ * @param schemaDefinition - The schema definition to apply the decorator to
527
+ * @param syncRuleProviderInstance - The sync rule provider instance
528
+ */
529
+ applyReadonlyDecorator(schemaDefinition, syncRuleProviderInstance) {
530
+ for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
531
+ const readonlyInfo = (0, decoration_1.getReadonlyMetadata)(syncRuleProviderInstance, propertyName);
532
+ if (readonlyInfo) {
533
+ const { passed } = this.evaluateCondition(readonlyInfo);
534
+ if (passed) {
535
+ property.readOnly = true;
536
+ }
537
+ }
538
+ }
539
+ }
540
+ /**
541
+ * Applies the enums decorator to the schema definition.
542
+ * Restricts enum values when their condition evaluates to true.
543
+ * If multiple @enums decorators exist on the same property, the first matching condition wins.
544
+ *
545
+ * @param schemaDefinition - The schema definition to apply the decorator to
546
+ * @param syncRuleProviderInstance - The sync rule provider instance
547
+ */
548
+ applyEnumsDecorator(schemaDefinition, syncRuleProviderInstance) {
549
+ for (const { propertyName, property } of this.iterateProperties(schemaDefinition, syncRuleProviderInstance)) {
550
+ const enumsMetadataList = (0, decoration_1.getEnumsMetadata)(syncRuleProviderInstance, propertyName);
551
+ if (!enumsMetadataList?.length) {
552
+ continue;
553
+ }
554
+ // Find first matching condition (first match wins)
555
+ for (const enumsMetadata of enumsMetadataList) {
556
+ const { passed } = this.evaluateCondition(enumsMetadata);
557
+ if (passed) {
558
+ const currentEnumValues = this.resolveEnumFromProperty(property);
559
+ if (currentEnumValues) {
560
+ // Filter to only allowed values that exist in original enum
561
+ const filteredValues = enumsMetadata.allowedValues.filter((v) => currentEnumValues.includes(v));
562
+ this.applyFilteredEnumToProperty(property, filteredValues);
563
+ }
564
+ break; // First match wins, stop processing
258
565
  }
259
566
  }
260
567
  }
@@ -273,6 +580,56 @@ class Decorator extends BaseClass {
273
580
  }
274
581
  return validityInfo;
275
582
  }
583
+ /**
584
+ * Resolves an enum array from a property definition.
585
+ * Handles both inline enums and $ref to enum definitions.
586
+ *
587
+ * @param property - The property definition
588
+ * @returns The enum array or undefined if not found
589
+ */
590
+ resolveEnumFromProperty(property) {
591
+ // Check for inline enum
592
+ if (property?.enum && Array.isArray(property.enum)) {
593
+ return property.enum;
594
+ }
595
+ // Check for $ref to an enum definition
596
+ if (property?.$ref) {
597
+ const refName = property.$ref.replace('#/definitions/', '');
598
+ const schema = this.appSchema?.get();
599
+ const refDef = schema?.definitions?.[refName];
600
+ if (refDef?.enum && Array.isArray(refDef.enum)) {
601
+ return refDef.enum;
602
+ }
603
+ }
604
+ return undefined;
605
+ }
606
+ /**
607
+ * Applies filtered enum values to a property.
608
+ * For $ref properties, inlines the filtered enum, copies the type from the referenced definition, and removes the $ref.
609
+ * For inline enum properties, updates the enum directly.
610
+ *
611
+ * @param property - The property definition to update
612
+ * @param filteredEnum - The filtered enum values
613
+ */
614
+ applyFilteredEnumToProperty(property, filteredEnum) {
615
+ if (property.$ref) {
616
+ // For $ref properties, resolve the referenced definition to get the type
617
+ const refName = property.$ref.replace('#/definitions/', '');
618
+ const schema = this.appSchema?.get();
619
+ const refDef = schema?.definitions?.[refName];
620
+ // Copy the type from the referenced definition if it exists
621
+ if (refDef?.type) {
622
+ property.type = refDef.type;
623
+ }
624
+ // Remove the $ref and inline the filtered enum
625
+ delete property.$ref;
626
+ property.enum = filteredEnum;
627
+ }
628
+ else {
629
+ // For inline enum properties, update directly
630
+ property.enum = filteredEnum;
631
+ }
632
+ }
276
633
  /**
277
634
  * Applies the validity decorator to the schema definition based on the sync rule provider instance and minimum UI5 version.
278
635
  *
@@ -292,39 +649,46 @@ class Decorator extends BaseClass {
292
649
  property[ux_specification_types_1.SchemaTag.hidden] = true;
293
650
  // possible message?
294
651
  }
295
- // Process inline enum validity configuration from @validity decorator
296
- if (validityInfo?.enum && property?.enum && Array.isArray(property.enum)) {
297
- const filteredEnum = property.enum.filter((enumValue) => {
298
- const enumValueStr = String(enumValue);
299
- const condition = validityInfo.enum[enumValueStr];
300
- if (!condition) {
301
- return true; // Keep values without conditions
302
- }
303
- // Check UI5 version requirement (if specified)
304
- if (condition.since && minUI5Version) {
305
- if (!(0, utils_1.compareUI5Versions)(minUI5Version, condition.since)) {
306
- if (condition.message) {
307
- this.addConditionalMessage(condition, syncRuleProviderInstance, property, {
308
- propertyName: enumValueStr
309
- });
652
+ // Process enum validity configuration from @validity decorator
653
+ // Supports both inline enums and $ref to enum definitions
654
+ if (validityInfo?.enum) {
655
+ const enumValues = this.resolveEnumFromProperty(property);
656
+ if (enumValues) {
657
+ const filteredEnum = enumValues.filter((enumValue) => {
658
+ const enumValueStr = String(enumValue);
659
+ const condition = validityInfo.enum[enumValueStr];
660
+ if (!condition) {
661
+ return true; // Keep values without conditions
662
+ }
663
+ // Check UI5 version requirement (if specified)
664
+ if (condition.since && minUI5Version) {
665
+ if (!(0, utils_1.compareUI5Versions)(minUI5Version, condition.since)) {
666
+ if (condition.message) {
667
+ this.addConditionalMessage(condition, syncRuleProviderInstance, property, {
668
+ propertyName: enumValueStr
669
+ });
670
+ }
671
+ return false; // Version requirement not met
310
672
  }
311
- return false; // Version requirement not met
312
673
  }
313
- }
314
- // Check property dependency using dependsOn function
315
- if (condition.dependsOn) {
316
- if (!condition.dependsOn(syncRuleProviderInstance)) {
317
- if (condition.message) {
318
- this.addConditionalMessage(condition, syncRuleProviderInstance, property, {
319
- propertyName: enumValueStr
320
- });
674
+ // Check property dependency using dependsOn function
675
+ if (condition.dependsOn) {
676
+ if (!condition.dependsOn(syncRuleProviderInstance)) {
677
+ if (condition.message) {
678
+ this.addConditionalMessage(condition, syncRuleProviderInstance, property, {
679
+ propertyName: enumValueStr
680
+ });
681
+ }
682
+ return false; // Dependency condition not met
321
683
  }
322
- return false; // Dependency condition not met
323
684
  }
685
+ return true;
686
+ });
687
+ // Only update if enum was actually filtered
688
+ if (filteredEnum.length !== enumValues.length) {
689
+ this.applyFilteredEnumToProperty(property, filteredEnum);
324
690
  }
325
- return true;
326
- });
327
- property.enum = filteredEnum;
691
+ }
328
692
  }
329
693
  }
330
694
  }
@@ -355,40 +719,16 @@ class Decorator extends BaseClass {
355
719
  schemaDefinition.description = description;
356
720
  }
357
721
  }
358
- /**
359
- * Applies the hidden decorator to the schema definition.
360
- *
361
- * @param schemaDefinition - The schema definition to apply the decorator to
362
- * @param target - The target object or function
363
- * @param propertyName - The property name (optional)
364
- */
365
- applyHiddenDecorator(schemaDefinition, target, propertyName) {
366
- const hiddenCondition = Reflect.getMetadata(decoration_1.metadataKeys.hidden, target, propertyName);
367
- if (typeof hiddenCondition === 'function') {
368
- const shouldHide = hiddenCondition(this);
369
- if (shouldHide) {
370
- schemaDefinition[ux_specification_types_1.SchemaTag.hidden] = true;
371
- }
372
- }
373
- else if (hiddenCondition === true) {
374
- schemaDefinition[ux_specification_types_1.SchemaTag.hidden] = true;
375
- }
376
- if (!schemaDefinition?.properties) {
377
- return;
378
- }
379
- for (const propertyName in schemaDefinition.properties) {
380
- this.applyHiddenDecorator(schemaDefinition.properties[propertyName], target, propertyName);
381
- }
382
- }
383
722
  /**
384
723
  * Applies all decorators to the schema definition.
385
724
  *
386
725
  * @param minUi5Version - The minimum UI5 version (optional)
387
726
  * @param propertyName - The property name (optional)
727
+ * @param customDefinition - Optional custom definition to apply decorators to (overrides getBase())
388
728
  * @returns Object containing the definition
389
729
  */
390
- applyDecorators(minUi5Version, propertyName) {
391
- const definition = this.getDefinitions()?.[this.getBaseName()];
730
+ applyDecorators(minUi5Version, propertyName, customDefinition) {
731
+ const definition = customDefinition ?? this.getBase();
392
732
  if (!definition) {
393
733
  return;
394
734
  }
@@ -399,10 +739,16 @@ class Decorator extends BaseClass {
399
739
  this.applyIsViewNodeDecorator(definition, target, propertyName);
400
740
  // Apply validity decorator (for properties)
401
741
  this.applyValidityDecorator(definition, this, minUi5Version);
402
- // Apply dependsOn decorator - check property dependencies
403
- this.applyDependsOnDecorator(definition, this);
404
- // Apply hidden decorator - evaluate condition function if provided
405
- this.applyHiddenDecorator(definition, this);
742
+ // Apply enums decorator - filter enum values based on conditions
743
+ this.applyEnumsDecorator(definition, this);
744
+ // Apply message decorator - show messages based on conditions
745
+ // NOTE: Message decorator must run before hide decorator so hide can check for messages
746
+ this.applyMessageDecorator(definition, this);
747
+ // Apply hide decorator - hide properties based on conditions
748
+ // NOTE: Only hides if message decorator did not add any messages
749
+ this.applyHideDecorator(definition, this);
750
+ // Apply readonly decorator - mark properties as readonly based on conditions
751
+ this.applyReadonlyDecorator(definition, this);
406
752
  return { definition };
407
753
  }
408
754
  }