@sap/ux-ui5-tooling 1.20.4 → 1.21.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 (287) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/adp-tooling/templates/cf/_gitignore +6 -0
  3. package/dist/adp-tooling/templates/cf/approuter/package.json +13 -0
  4. package/dist/adp-tooling/templates/cf/approuter/xs-app.json +15 -0
  5. package/dist/adp-tooling/templates/cf/i18n/i18n.properties +3 -0
  6. package/dist/adp-tooling/templates/cf/package.json +35 -0
  7. package/dist/adp-tooling/templates/cf/ui5.yaml +5 -0
  8. package/dist/adp-tooling/templates/cf/xs-security.json +7 -0
  9. package/dist/adp-tooling/templates/changes/annotation.xml +18 -0
  10. package/dist/adp-tooling/templates/project/gitignore.tmpl +5 -0
  11. package/dist/adp-tooling/templates/project/package.json +31 -0
  12. package/dist/adp-tooling/templates/project/ui5.yaml +6 -0
  13. package/dist/adp-tooling/templates/project/webapp/i18n/i18n.properties +6 -0
  14. package/dist/adp-tooling/templates/project/webapp/manifest.appdescr_variant +10 -0
  15. package/dist/adp-tooling/templates/rta/common/analytical-custom-column.xml +25 -0
  16. package/dist/adp-tooling/templates/rta/common/custom-action.xml +8 -0
  17. package/dist/adp-tooling/templates/rta/common/grid-tree-custom-column.xml +22 -0
  18. package/dist/adp-tooling/templates/rta/common/header-field.xml +13 -0
  19. package/dist/adp-tooling/templates/rta/common/op-custom-section.xml +20 -0
  20. package/dist/adp-tooling/templates/rta/common/v4-table-action.xml +8 -0
  21. package/dist/adp-tooling/templates/rta/controller.ejs +80 -0
  22. package/dist/adp-tooling/templates/rta/fragment.xml +7 -0
  23. package/dist/adp-tooling/templates/rta/ts-controller.ejs +18 -0
  24. package/dist/adp-tooling/templates/rta/v2/m-table-custom-column-cell.xml +7 -0
  25. package/dist/adp-tooling/templates/rta/v2/m-table-custom-column.xml +18 -0
  26. package/dist/adp-tooling/templates/rta/v4/custom-section.xml +12 -0
  27. package/dist/adp-tooling/templates/rta/v4/mdc-custom-column-config.xml +6 -0
  28. package/dist/adp-tooling/templates/rta/v4/mdc-custom-column.xml +11 -0
  29. package/dist/adp-tooling/templates/typescript/tsconfig.json +19 -0
  30. package/dist/cli/index.js +15811 -9929
  31. package/dist/control-property-editor/app.css +2 -0
  32. package/dist/control-property-editor/app.js +175 -0
  33. package/dist/livereload-js/livereload.js +3795 -0
  34. package/dist/middlewares/fiori-tools-appreload.js +43486 -41472
  35. package/dist/middlewares/fiori-tools-preview.js +56962 -3066
  36. package/dist/middlewares/fiori-tools-proxy.js +55281 -32282
  37. package/dist/middlewares/fiori-tools-servestatic.js +31629 -29
  38. package/dist/preview-middleware/dist/client/adp/add-fragment.js +48 -0
  39. package/dist/preview-middleware/dist/client/adp/add-fragment.ts +51 -0
  40. package/dist/preview-middleware/dist/client/adp/api-handler.js +162 -0
  41. package/dist/preview-middleware/dist/client/adp/api-handler.ts +188 -0
  42. package/dist/preview-middleware/dist/client/adp/command-executor.js +100 -0
  43. package/dist/preview-middleware/dist/client/adp/command-executor.ts +105 -0
  44. package/dist/preview-middleware/dist/client/adp/control-utils.js +46 -0
  45. package/dist/preview-middleware/dist/client/adp/control-utils.ts +48 -0
  46. package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.js +198 -0
  47. package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.ts +232 -0
  48. package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.js +223 -0
  49. package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.ts +257 -0
  50. package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.js +195 -0
  51. package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.ts +264 -0
  52. package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.js +146 -0
  53. package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.ts +209 -0
  54. package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.js +232 -0
  55. package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +306 -0
  56. package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.js +187 -0
  57. package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.ts +254 -0
  58. package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.js +330 -0
  59. package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.ts +408 -0
  60. package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.js +160 -0
  61. package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.ts +195 -0
  62. package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.js +68 -0
  63. package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.ts +86 -0
  64. package/dist/preview-middleware/dist/client/adp/controllers/types.js +2 -0
  65. package/dist/preview-middleware/dist/client/adp/controllers/types.ts +10 -0
  66. package/dist/preview-middleware/dist/client/adp/dialog-factory.js +151 -0
  67. package/dist/preview-middleware/dist/client/adp/dialog-factory.ts +210 -0
  68. package/dist/preview-middleware/dist/client/adp/extend-controller.js +48 -0
  69. package/dist/preview-middleware/dist/client/adp/extend-controller.ts +49 -0
  70. package/dist/preview-middleware/dist/client/adp/extension-point.js +83 -0
  71. package/dist/preview-middleware/dist/client/adp/extension-point.ts +116 -0
  72. package/dist/preview-middleware/dist/client/adp/init-dialogs.js +142 -0
  73. package/dist/preview-middleware/dist/client/adp/init-dialogs.ts +178 -0
  74. package/dist/preview-middleware/dist/client/adp/init.js +102 -0
  75. package/dist/preview-middleware/dist/client/adp/init.ts +85 -0
  76. package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +97 -0
  77. package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +140 -0
  78. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.js +74 -0
  79. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.ts +92 -0
  80. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.js +171 -0
  81. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +174 -0
  82. package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.js +56 -0
  83. package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.ts +56 -0
  84. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.js +41 -0
  85. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.ts +51 -0
  86. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.js +69 -0
  87. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.ts +81 -0
  88. package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.js +20 -0
  89. package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.ts +7 -0
  90. package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.js +25 -0
  91. package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.ts +7 -0
  92. package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
  93. package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
  94. package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.js +2 -0
  95. package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.ts +19 -0
  96. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +82 -0
  97. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +87 -0
  98. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +69 -0
  99. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +71 -0
  100. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +103 -0
  101. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +105 -0
  102. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.js +111 -0
  103. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +110 -0
  104. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +108 -0
  105. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +141 -0
  106. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +80 -0
  107. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +93 -0
  108. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +79 -0
  109. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +102 -0
  110. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +71 -0
  111. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +98 -0
  112. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +61 -0
  113. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +77 -0
  114. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  115. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +102 -0
  116. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +86 -0
  117. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.ts +116 -0
  118. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.js +79 -0
  119. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.ts +121 -0
  120. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.js +138 -0
  121. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.ts +134 -0
  122. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +140 -0
  123. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +181 -0
  124. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +81 -0
  125. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +81 -0
  126. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +90 -0
  127. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +97 -0
  128. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.js +81 -0
  129. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.ts +98 -0
  130. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.js +129 -0
  131. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.ts +149 -0
  132. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.js +142 -0
  133. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.ts +178 -0
  134. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +83 -0
  135. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.ts +96 -0
  136. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +58 -0
  137. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +70 -0
  138. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +86 -0
  139. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +96 -0
  140. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +55 -0
  141. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +61 -0
  142. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.js +73 -0
  143. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.ts +91 -0
  144. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  145. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +88 -0
  146. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.js +62 -0
  147. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.ts +86 -0
  148. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.js +158 -0
  149. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.ts +175 -0
  150. package/dist/preview-middleware/dist/client/adp/quick-actions/load.js +46 -0
  151. package/dist/preview-middleware/dist/client/adp/quick-actions/load.ts +23 -0
  152. package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.js +64 -0
  153. package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.ts +71 -0
  154. package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -0
  155. package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.ts +51 -0
  156. package/dist/preview-middleware/dist/client/adp/quick-actions/supported-ui5versions.md +40 -0
  157. package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.js +372 -0
  158. package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.ts +433 -0
  159. package/dist/preview-middleware/dist/client/adp/sync-views-utils.js +123 -0
  160. package/dist/preview-middleware/dist/client/adp/sync-views-utils.ts +90 -0
  161. package/dist/preview-middleware/dist/client/adp/ui/AddAction.fragment.xml +49 -0
  162. package/dist/preview-middleware/dist/client/adp/ui/AddCustomFragment.fragment.xml +48 -0
  163. package/dist/preview-middleware/dist/client/adp/ui/AddFragment.fragment.xml +83 -0
  164. package/dist/preview-middleware/dist/client/adp/ui/AddSubpage.fragment.xml +73 -0
  165. package/dist/preview-middleware/dist/client/adp/ui/AddTableColumnFragments.fragment.xml +63 -0
  166. package/dist/preview-middleware/dist/client/adp/ui/ControllerExtension.fragment.xml +63 -0
  167. package/dist/preview-middleware/dist/client/adp/ui/ExtensionPoint.fragment.xml +61 -0
  168. package/dist/preview-middleware/dist/client/adp/ui/FileExistsDialog.fragment.xml +43 -0
  169. package/dist/preview-middleware/dist/client/adp/utils.js +199 -0
  170. package/dist/preview-middleware/dist/client/adp/utils.ts +200 -0
  171. package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.js +85 -0
  172. package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +107 -0
  173. package/dist/preview-middleware/dist/client/cpe/changes/flex-change.js +66 -0
  174. package/dist/preview-middleware/dist/client/cpe/changes/flex-change.ts +66 -0
  175. package/dist/preview-middleware/dist/client/cpe/changes/generic-change.js +321 -0
  176. package/dist/preview-middleware/dist/client/cpe/changes/generic-change.ts +462 -0
  177. package/dist/preview-middleware/dist/client/cpe/changes/index.js +12 -0
  178. package/dist/preview-middleware/dist/client/cpe/changes/index.ts +1 -0
  179. package/dist/preview-middleware/dist/client/cpe/changes/service.js +527 -0
  180. package/dist/preview-middleware/dist/client/cpe/changes/service.ts +595 -0
  181. package/dist/preview-middleware/dist/client/cpe/changes/validator.js +41 -0
  182. package/dist/preview-middleware/dist/client/cpe/changes/validator.ts +35 -0
  183. package/dist/preview-middleware/dist/client/cpe/communication-service.js +44 -0
  184. package/dist/preview-middleware/dist/client/cpe/communication-service.ts +41 -0
  185. package/dist/preview-middleware/dist/client/cpe/connector-service.js +88 -0
  186. package/dist/preview-middleware/dist/client/cpe/connector-service.ts +74 -0
  187. package/dist/preview-middleware/dist/client/cpe/context-menu-service.js +90 -0
  188. package/dist/preview-middleware/dist/client/cpe/context-menu-service.ts +77 -0
  189. package/dist/preview-middleware/dist/client/cpe/control-data.js +366 -0
  190. package/dist/preview-middleware/dist/client/cpe/control-data.ts +400 -0
  191. package/dist/preview-middleware/dist/client/cpe/documentation.js +191 -0
  192. package/dist/preview-middleware/dist/client/cpe/documentation.ts +187 -0
  193. package/dist/preview-middleware/dist/client/cpe/feature-service.js +39 -0
  194. package/dist/preview-middleware/dist/client/cpe/feature-service.ts +25 -0
  195. package/dist/preview-middleware/dist/client/cpe/init.js +92 -0
  196. package/dist/preview-middleware/dist/client/cpe/init.ts +114 -0
  197. package/dist/preview-middleware/dist/client/cpe/logger.js +32 -0
  198. package/dist/preview-middleware/dist/client/cpe/logger.ts +24 -0
  199. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.js +126 -0
  200. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.ts +150 -0
  201. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.js +63 -0
  202. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.ts +52 -0
  203. package/dist/preview-middleware/dist/client/cpe/outline/editable.js +38 -0
  204. package/dist/preview-middleware/dist/client/cpe/outline/editable.ts +30 -0
  205. package/dist/preview-middleware/dist/client/cpe/outline/nodes.js +212 -0
  206. package/dist/preview-middleware/dist/client/cpe/outline/nodes.ts +236 -0
  207. package/dist/preview-middleware/dist/client/cpe/outline/service.js +62 -0
  208. package/dist/preview-middleware/dist/client/cpe/outline/service.ts +66 -0
  209. package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.js +161 -0
  210. package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.ts +184 -0
  211. package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.js +145 -0
  212. package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.ts +157 -0
  213. package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.js +94 -0
  214. package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.ts +113 -0
  215. package/dist/preview-middleware/dist/client/cpe/rta-service.js +94 -0
  216. package/dist/preview-middleware/dist/client/cpe/rta-service.ts +86 -0
  217. package/dist/preview-middleware/dist/client/cpe/selection.js +249 -0
  218. package/dist/preview-middleware/dist/client/cpe/selection.ts +267 -0
  219. package/dist/preview-middleware/dist/client/cpe/ui5-utils.js +35 -0
  220. package/dist/preview-middleware/dist/client/cpe/ui5-utils.ts +28 -0
  221. package/dist/preview-middleware/dist/client/cpe/utils.js +113 -0
  222. package/dist/preview-middleware/dist/client/cpe/utils.ts +162 -0
  223. package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.js +96 -0
  224. package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.ts +99 -0
  225. package/dist/preview-middleware/dist/client/flp/common.js +30 -0
  226. package/dist/preview-middleware/dist/client/flp/common.ts +28 -0
  227. package/dist/preview-middleware/dist/client/flp/enableFakeConnector.js +92 -0
  228. package/dist/preview-middleware/dist/client/flp/enableFakeConnector.ts +113 -0
  229. package/dist/preview-middleware/dist/client/flp/homepage/Component.js +16 -0
  230. package/dist/preview-middleware/dist/client/flp/homepage/Component.ts +10 -0
  231. package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.js +54 -0
  232. package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.ts +41 -0
  233. package/dist/preview-middleware/dist/client/flp/homepage/css/style.css +3 -0
  234. package/dist/preview-middleware/dist/client/flp/homepage/manifest.json +41 -0
  235. package/dist/preview-middleware/dist/client/flp/homepage/view/MyHome.view.xml +18 -0
  236. package/dist/preview-middleware/dist/client/flp/init.js +418 -0
  237. package/dist/preview-middleware/dist/client/flp/init.ts +448 -0
  238. package/dist/preview-middleware/dist/client/flp/initCdm.js +117 -0
  239. package/dist/preview-middleware/dist/client/flp/initCdm.ts +111 -0
  240. package/dist/preview-middleware/dist/client/flp/initConnectors.js +31 -0
  241. package/dist/preview-middleware/dist/client/flp/initConnectors.ts +20 -0
  242. package/dist/preview-middleware/dist/client/flp/initRta.js +180 -0
  243. package/dist/preview-middleware/dist/client/flp/initRta.ts +194 -0
  244. package/dist/preview-middleware/dist/client/i18n.js +56 -0
  245. package/dist/preview-middleware/dist/client/i18n.ts +49 -0
  246. package/dist/preview-middleware/dist/client/manifest.json +8 -0
  247. package/dist/preview-middleware/dist/client/messagebundle.properties +143 -0
  248. package/dist/preview-middleware/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +486 -0
  249. package/dist/preview-middleware/dist/client/utils/additional-change-info.js +69 -0
  250. package/dist/preview-middleware/dist/client/utils/additional-change-info.ts +73 -0
  251. package/dist/preview-middleware/dist/client/utils/application.js +34 -0
  252. package/dist/preview-middleware/dist/client/utils/application.ts +27 -0
  253. package/dist/preview-middleware/dist/client/utils/core.js +144 -0
  254. package/dist/preview-middleware/dist/client/utils/core.ts +145 -0
  255. package/dist/preview-middleware/dist/client/utils/error.js +28 -0
  256. package/dist/preview-middleware/dist/client/utils/error.ts +18 -0
  257. package/dist/preview-middleware/dist/client/utils/fe-v2.js +58 -0
  258. package/dist/preview-middleware/dist/client/utils/fe-v2.ts +61 -0
  259. package/dist/preview-middleware/dist/client/utils/fe-v4.js +168 -0
  260. package/dist/preview-middleware/dist/client/utils/fe-v4.ts +186 -0
  261. package/dist/preview-middleware/dist/client/utils/info-center-message.js +60 -0
  262. package/dist/preview-middleware/dist/client/utils/info-center-message.ts +60 -0
  263. package/dist/preview-middleware/dist/client/utils/version.js +126 -0
  264. package/dist/preview-middleware/dist/client/utils/version.ts +138 -0
  265. package/dist/preview-middleware/templates/flp/cdm.base.json +47 -0
  266. package/dist/preview-middleware/templates/flp/cdm.ejs +72 -0
  267. package/dist/preview-middleware/templates/flp/editor.ejs +28 -0
  268. package/dist/preview-middleware/templates/flp/sandbox.ejs +88 -0
  269. package/dist/preview-middleware/templates/flp/sandbox2.ejs +86 -0
  270. package/dist/preview-middleware/templates/test/qunit.ejs +26 -0
  271. package/dist/preview-middleware/templates/test/qunit.js +29 -0
  272. package/dist/preview-middleware/templates/test/testsuite.qunit.ejs +10 -0
  273. package/dist/preview-middleware/templates/test/testsuite.qunit.js +8 -0
  274. package/dist/tasks/cf-deploy/index.js +1780 -1464
  275. package/dist/tasks/deploy/index.js +14857 -9062
  276. package/package.json +31 -34
  277. package/prebuilds/keyring.darwin-arm64.node +0 -0
  278. package/prebuilds/keyring.darwin-x64.node +0 -0
  279. package/prebuilds/keyring.linux-arm-gnueabihf.node +0 -0
  280. package/prebuilds/keyring.linux-arm64-gnu.node +0 -0
  281. package/prebuilds/keyring.linux-arm64-musl.node +0 -0
  282. package/prebuilds/keyring.linux-ia32-gnu.node +0 -0
  283. package/prebuilds/keyring.linux-x64-gnu.node +0 -0
  284. package/prebuilds/keyring.linux-x64-musl.node +0 -0
  285. package/prebuilds/keyring.win32-arm64-msvc.node +0 -0
  286. package/prebuilds/keyring.win32-ia32-msvc.node +0 -0
  287. package/prebuilds/keyring.win32-x64-msvc.node +0 -0
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../dialog-enablement-validator", "../control-types"], function (_____utils_core, ___table_quick_action_base, ___dialog_enablement_validator, ___control_types) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
9
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
+ const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
11
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
12
+ const CHANGE_TABLE_COLUMNS = 'change-table-columns';
13
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
14
+ class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
15
+ constructor(context) {
16
+ super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
17
+ includeServiceAction: true,
18
+ validatePageVariantManagement: true
19
+ }, [DIALOG_ENABLEMENT_VALIDATOR]);
20
+ }
21
+ async execute(path) {
22
+ const {
23
+ table,
24
+ iconTabBarFilterKey,
25
+ changeColumnActionId,
26
+ sectionInfo
27
+ } = this.tableMap[path];
28
+ if (!table) {
29
+ return [];
30
+ }
31
+ if (sectionInfo) {
32
+ const {
33
+ layout,
34
+ section,
35
+ subSection
36
+ } = sectionInfo;
37
+ layout?.setSelectedSection(section);
38
+ section.setSelectedSubSection(subSection);
39
+ this.selectOverlay(table);
40
+ } else {
41
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
42
+ this.selectOverlay(table);
43
+ }
44
+ if (this.iconTabBar && iconTabBarFilterKey) {
45
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
46
+ }
47
+ if (changeColumnActionId) {
48
+ const executeAction = async () => await this.context.actionService.execute(table.getId(), changeColumnActionId);
49
+ if (isA(SMART_TABLE_TYPE, table)) {
50
+ await executeAction();
51
+ } else if (isA(M_TABLE_TYPE, table)) {
52
+ // if table is busy, i.e. lazy loading, then we subscribe to 'updateFinished' event and call action service when loading is done
53
+ // to avoid reopening the dialog after close
54
+ if (this.isTableLoaded(table)) {
55
+ await executeAction();
56
+ } else {
57
+ table.attachEventOnce('updateFinished', executeAction, this);
58
+ }
59
+ }
60
+ }
61
+ return [];
62
+ }
63
+ isAbsoluteAggregationBinding(element, aggregationName) {
64
+ const mBindingInfo = element.getBindingInfo(aggregationName);
65
+ const path = mBindingInfo?.path;
66
+ if (!path) {
67
+ return false;
68
+ }
69
+ return path.indexOf('/') === 0;
70
+ }
71
+
72
+ /**
73
+ * Checks if table is loaded and has binding context available.
74
+ * This is needed to properly render change columns dialog.
75
+ * Based on {@link https://github.com/SAP/openui5/blob/rel-1.127/src/sap.ui.fl/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js#L269-L271| ODataV2ReadDelegate.getPropertyInfo}.
76
+ *
77
+ * @param element - Table control.
78
+ * @returns True if binding context is available.
79
+ */
80
+ isTableLoaded(element) {
81
+ const aggregationName = 'items';
82
+ if (this.isAbsoluteAggregationBinding(element, aggregationName)) {
83
+ const bindingInfo = element.getBindingInfo(aggregationName);
84
+ // check to be default model binding otherwise return undefined
85
+ if (typeof bindingInfo.model === 'string' && bindingInfo.model !== '') {
86
+ return false;
87
+ }
88
+ return bindingInfo.path !== undefined;
89
+ } else {
90
+ // here we explicitly request the default models binding context
91
+ const bindingContext = element.getBindingContext();
92
+ return !!bindingContext;
93
+ }
94
+ }
95
+ }
96
+ var __exports = {
97
+ __esModule: true
98
+ };
99
+ __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
100
+ __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
101
+ return __exports;
102
+ });
103
+ //# sourceMappingURL=change-table-columns.js.map
@@ -0,0 +1,105 @@
1
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+ import type Table from 'sap/m/Table';
3
+ import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
4
+ import type ManagedObject from 'sap/ui/base/ManagedObject';
5
+
6
+ import type {
7
+ QuickActionContext,
8
+ NestedQuickActionDefinition
9
+ } from '../../../cpe/quick-actions/quick-action-definition';
10
+ import { getControlById, isA } from '../../../utils/core';
11
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
12
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
13
+ import { M_TABLE_TYPE, SMART_TABLE_TYPE } from '../control-types';
14
+
15
+ export const CHANGE_TABLE_COLUMNS = 'change-table-columns';
16
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
17
+
18
+ export class ChangeTableColumnsQuickAction
19
+ extends TableQuickActionDefinitionBase
20
+ implements NestedQuickActionDefinition
21
+ {
22
+ constructor(context: QuickActionContext) {
23
+ super(
24
+ CHANGE_TABLE_COLUMNS,
25
+ CONTROL_TYPES,
26
+ 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS',
27
+ context,
28
+ {
29
+ includeServiceAction: true,
30
+ validatePageVariantManagement: true
31
+ },
32
+ [DIALOG_ENABLEMENT_VALIDATOR]
33
+ );
34
+ }
35
+ async execute(path: string): Promise<FlexCommand[]> {
36
+ const { table, iconTabBarFilterKey, changeColumnActionId, sectionInfo } = this.tableMap[path];
37
+ if (!table) {
38
+ return [];
39
+ }
40
+
41
+ if (sectionInfo) {
42
+ const { layout, section, subSection } = sectionInfo;
43
+ layout?.setSelectedSection(section);
44
+ section.setSelectedSubSection(subSection);
45
+ this.selectOverlay(table);
46
+ } else {
47
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
48
+ this.selectOverlay(table);
49
+ }
50
+
51
+ if (this.iconTabBar && iconTabBarFilterKey) {
52
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
53
+ }
54
+ if (changeColumnActionId) {
55
+ const executeAction = async () =>
56
+ await this.context.actionService.execute(table.getId(), changeColumnActionId);
57
+ if (isA<SmartTable>(SMART_TABLE_TYPE, table)) {
58
+ await executeAction();
59
+ } else if (isA<Table>(M_TABLE_TYPE, table)) {
60
+ // if table is busy, i.e. lazy loading, then we subscribe to 'updateFinished' event and call action service when loading is done
61
+ // to avoid reopening the dialog after close
62
+ if (this.isTableLoaded(table)) {
63
+ await executeAction();
64
+ } else {
65
+ table.attachEventOnce('updateFinished', executeAction, this);
66
+ }
67
+ }
68
+ }
69
+
70
+ return [];
71
+ }
72
+
73
+ private isAbsoluteAggregationBinding(element: ManagedObject, aggregationName: string): boolean {
74
+ const mBindingInfo = element.getBindingInfo(aggregationName);
75
+ const path = mBindingInfo?.path;
76
+ if (!path) {
77
+ return false;
78
+ }
79
+ return path.indexOf('/') === 0;
80
+ }
81
+
82
+ /**
83
+ * Checks if table is loaded and has binding context available.
84
+ * This is needed to properly render change columns dialog.
85
+ * Based on {@link https://github.com/SAP/openui5/blob/rel-1.127/src/sap.ui.fl/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js#L269-L271| ODataV2ReadDelegate.getPropertyInfo}.
86
+ *
87
+ * @param element - Table control.
88
+ * @returns True if binding context is available.
89
+ */
90
+ private isTableLoaded(element: ManagedObject): boolean {
91
+ const aggregationName = 'items';
92
+ if (this.isAbsoluteAggregationBinding(element, aggregationName)) {
93
+ const bindingInfo = element.getBindingInfo(aggregationName);
94
+ // check to be default model binding otherwise return undefined
95
+ if (typeof bindingInfo.model === 'string' && bindingInfo.model !== '') {
96
+ return false;
97
+ }
98
+ return bindingInfo.path !== undefined;
99
+ } else {
100
+ // here we explicitly request the default models binding context
101
+ const bindingContext = element.getBindingContext();
102
+ return !!bindingContext;
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../table-quick-action-base", "../dialog-enablement-validator", "../control-types"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___table_quick_action_base, ___dialog_enablement_validator, ___control_types) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const DialogFactory = ____dialog_factory["DialogFactory"];
9
+ const DialogNames = ____dialog_factory["DialogNames"];
10
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
12
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
13
+ const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
14
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
15
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
16
+ const CREATE_TABLE_ACTION = 'create-table-action';
17
+ // maintain order if action id
18
+
19
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
20
+ class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
21
+ constructor(context) {
22
+ super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
23
+ }
24
+ async initialize() {
25
+ const processChild = (child, mapKey) => {
26
+ const table = this.tableMap[mapKey]?.table;
27
+ if (table) {
28
+ const headerToolbar = this.getHeaderToolbar(table);
29
+ if (!headerToolbar) {
30
+ child.enabled = false;
31
+ child.tooltip = this.context.resourceBundle.getText('NO_TABLE_HEADER_TOOLBAR');
32
+ }
33
+ }
34
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
35
+ };
36
+ await super.initialize();
37
+
38
+ // disable nested actions based on conditions
39
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
40
+ }
41
+ async execute(path) {
42
+ const {
43
+ table,
44
+ iconTabBarFilterKey,
45
+ sectionInfo
46
+ } = this.tableMap[path];
47
+ if (!table) {
48
+ return [];
49
+ }
50
+ if (sectionInfo) {
51
+ const {
52
+ layout,
53
+ section,
54
+ subSection
55
+ } = sectionInfo;
56
+ layout?.setSelectedSection(section);
57
+ section.setSelectedSubSection(subSection);
58
+ this.selectOverlay(table);
59
+ } else {
60
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
61
+ this.selectOverlay(table);
62
+ }
63
+ if (this.iconTabBar && iconTabBarFilterKey) {
64
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
65
+ }
66
+ const headerToolbar = this.getHeaderToolbar(table);
67
+
68
+ // open dialogBox to add, and content is selected ByDefault
69
+ if (headerToolbar) {
70
+ const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
71
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
72
+ aggregation: 'content',
73
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION',
74
+ defaultAggregationArrayIndex: 1
75
+ }, {
76
+ actionName: this.type,
77
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
78
+ });
79
+ }
80
+ return [];
81
+ }
82
+ getHeaderToolbar(table) {
83
+ let headerToolbar;
84
+ if (isA(SMART_TABLE_TYPE, table)) {
85
+ for (const item of table.getAggregation('items')) {
86
+ if (item.getAggregation('headerToolbar')) {
87
+ headerToolbar = item.getAggregation('headerToolbar');
88
+ break;
89
+ }
90
+ if (isA('sap.m.OverflowToolbar', item)) {
91
+ headerToolbar = item;
92
+ break;
93
+ }
94
+ }
95
+ if (!headerToolbar) {
96
+ headerToolbar = table.getToolbar();
97
+ }
98
+ } else if (isA(M_TABLE_TYPE, table)) {
99
+ headerToolbar = table.getAggregation('headerToolbar');
100
+ }
101
+ return headerToolbar;
102
+ }
103
+ }
104
+ var __exports = {
105
+ __esModule: true
106
+ };
107
+ __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
108
+ __exports.AddTableActionQuickAction = AddTableActionQuickAction;
109
+ return __exports;
110
+ });
111
+ //# sourceMappingURL=create-table-action.js.map
@@ -0,0 +1,110 @@
1
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+ import type Table from 'sap/m/Table';
3
+ import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
4
+ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
5
+ import type ManagedObject from 'sap/ui/base/ManagedObject';
6
+ import type UI5Element from 'sap/ui/core/Element';
7
+
8
+ import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
9
+ import { getControlById, isA } from '../../../utils/core';
10
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
11
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
12
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
13
+ import type OverflowToolbar from 'sap/m/OverflowToolbar';
14
+ import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common';
15
+ import { GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
16
+
17
+ export const CREATE_TABLE_ACTION = 'create-table-action';
18
+ // maintain order if action id
19
+
20
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
21
+
22
+ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
23
+ constructor(context: QuickActionContext) {
24
+ super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
25
+ DIALOG_ENABLEMENT_VALIDATOR
26
+ ]);
27
+ }
28
+
29
+ async initialize(): Promise<void> {
30
+ const processChild = (child: NestedQuickActionChild, mapKey: string) => {
31
+ const table = this.tableMap[mapKey]?.table;
32
+ if (table) {
33
+ const headerToolbar = this.getHeaderToolbar(table);
34
+ if (!headerToolbar) {
35
+ child.enabled = false;
36
+ child.tooltip = this.context.resourceBundle.getText('NO_TABLE_HEADER_TOOLBAR');
37
+ }
38
+ }
39
+
40
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
41
+ };
42
+
43
+ await super.initialize();
44
+
45
+ // disable nested actions based on conditions
46
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
47
+ }
48
+ async execute(path: string): Promise<FlexCommand[]> {
49
+ const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path];
50
+ if (!table) {
51
+ return [];
52
+ }
53
+
54
+ if (sectionInfo) {
55
+ const { layout, section, subSection } = sectionInfo;
56
+ layout?.setSelectedSection(section);
57
+ section.setSelectedSubSection(subSection);
58
+ this.selectOverlay(table);
59
+ } else {
60
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
61
+ this.selectOverlay(table);
62
+ }
63
+
64
+ if (this.iconTabBar && iconTabBarFilterKey) {
65
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
66
+ }
67
+
68
+ const headerToolbar = this.getHeaderToolbar(table);
69
+
70
+ // open dialogBox to add, and content is selected ByDefault
71
+ if (headerToolbar) {
72
+ const overlay = OverlayRegistry.getOverlay(headerToolbar as UI5Element) || [];
73
+ await DialogFactory.createDialog(
74
+ overlay,
75
+ this.context.rta,
76
+ DialogNames.ADD_FRAGMENT,
77
+ undefined,
78
+ {
79
+ aggregation: 'content',
80
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION',
81
+ defaultAggregationArrayIndex: 1
82
+ },
83
+ { actionName: this.type, telemetryEventIdentifier: this.getTelemetryIdentifier() }
84
+ );
85
+ }
86
+ return [];
87
+ }
88
+
89
+ getHeaderToolbar(table: UI5Element): ManagedObject | ManagedObject[] | OverflowToolbar | null | undefined {
90
+ let headerToolbar;
91
+ if (isA<SmartTable>(SMART_TABLE_TYPE, table)) {
92
+ for (const item of table.getAggregation('items') as ManagedObject[]) {
93
+ if (item.getAggregation('headerToolbar')) {
94
+ headerToolbar = item.getAggregation('headerToolbar');
95
+ break;
96
+ }
97
+ if (isA<OverflowToolbar>('sap.m.OverflowToolbar', item)) {
98
+ headerToolbar = item;
99
+ break;
100
+ }
101
+ }
102
+ if (!headerToolbar) {
103
+ headerToolbar = table.getToolbar();
104
+ }
105
+ } else if (isA<Table>(M_TABLE_TYPE, table)) {
106
+ headerToolbar = table.getAggregation('headerToolbar');
107
+ }
108
+ return headerToolbar;
109
+ }
110
+ }
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../dialog-enablement-validator", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../../../utils/info-center-message"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___control_types, ___table_quick_action_base, ___dialog_enablement_validator, ___sap_ux_private_control_property_editor_common, _____utils_info_center_message) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const DialogNames = ____dialog_factory["DialogNames"];
9
+ const DialogFactory = ____dialog_factory["DialogFactory"];
10
+ const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
11
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
12
+ const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
13
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
14
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
15
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
16
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
17
+ const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
18
+ const sendInfoCenterMessage = _____utils_info_center_message["sendInfoCenterMessage"];
19
+ const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
20
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
21
+
22
+ /**
23
+ * Reusable function which performs some preparation steps before table action execution
24
+ *
25
+ * @param table - table element
26
+ * @param sectionInfo - section data
27
+ * @param iconTabBar - icon tab bar element
28
+ * @param iconTabBarFilterKey - tab bar key to select a tab
29
+ */
30
+ function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
31
+ if (sectionInfo) {
32
+ const {
33
+ layout,
34
+ section,
35
+ subSection
36
+ } = sectionInfo;
37
+ layout?.setSelectedSection(section);
38
+ section.setSelectedSubSection(subSection);
39
+ } else {
40
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
41
+ }
42
+ if (iconTabBar && iconTabBarFilterKey) {
43
+ iconTabBar.setSelectedKey(iconTabBarFilterKey);
44
+ }
45
+ }
46
+ class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
47
+ constructor(context) {
48
+ super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
49
+ areTableRowsRequired: true
50
+ }, [DIALOG_ENABLEMENT_VALIDATOR]);
51
+ }
52
+ async execute(path) {
53
+ const {
54
+ table,
55
+ iconTabBarFilterKey,
56
+ sectionInfo
57
+ } = this.tableMap[path];
58
+ if (!table) {
59
+ return [];
60
+ }
61
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
62
+ this.selectOverlay(table);
63
+ let tableInternal = table;
64
+ if (isA(SMART_TABLE_TYPE, table)) {
65
+ const itemsAggregation = table.getAggregation('items');
66
+ tableInternal = itemsAggregation.find(item => {
67
+ return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
68
+ });
69
+ if (!tableInternal) {
70
+ return [];
71
+ }
72
+ }
73
+ const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
74
+ if (!overlay) {
75
+ return [];
76
+ }
77
+ if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
78
+ await sendInfoCenterMessage({
79
+ title: {
80
+ key: 'ADP_CREATE_XML_FRAGMENT_TITLE'
81
+ },
82
+ description: {
83
+ key: 'TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'
84
+ },
85
+ type: MessageBarType.error
86
+ });
87
+ return [];
88
+ }
89
+ const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
90
+ await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
91
+ aggregation: 'columns',
92
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
93
+ }, {
94
+ actionName: this.type,
95
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
96
+ });
97
+ return [];
98
+ }
99
+ }
100
+ var __exports = {
101
+ __esModule: true
102
+ };
103
+ __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
104
+ __exports.preprocessActionExecution = preprocessActionExecution;
105
+ __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
106
+ return __exports;
107
+ });
108
+ //# sourceMappingURL=create-table-custom-column.js.map
@@ -0,0 +1,141 @@
1
+ import type ManagedObject from 'sap/ui/base/ManagedObject';
2
+ import type UI5Element from 'sap/ui/core/Element';
3
+
4
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
5
+ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
6
+
7
+ import type ObjectPageSection from 'sap/uxap/ObjectPageSection';
8
+ import type ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
9
+ import type ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
10
+
11
+ import type IconTabBar from 'sap/m/IconTabBar';
12
+
13
+ import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
14
+
15
+ import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
16
+ import { getControlById, isA } from '../../../utils/core';
17
+ import { DialogNames, DialogFactory } from '../../dialog-factory';
18
+ import {
19
+ ANALYTICAL_TABLE_TYPE,
20
+ GRID_TABLE_TYPE,
21
+ M_TABLE_TYPE,
22
+ SMART_TABLE_TYPE,
23
+ TREE_TABLE_TYPE
24
+ } from '../control-types';
25
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
26
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
27
+ import { MessageBarType } from '@sap-ux-private/control-property-editor-common';
28
+ import { sendInfoCenterMessage } from '../../../utils/info-center-message';
29
+
30
+ export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
31
+
32
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
33
+
34
+ /**
35
+ * Reusable function which performs some preparation steps before table action execution
36
+ *
37
+ * @param table - table element
38
+ * @param sectionInfo - section data
39
+ * @param iconTabBar - icon tab bar element
40
+ * @param iconTabBarFilterKey - tab bar key to select a tab
41
+ */
42
+ export function preprocessActionExecution(
43
+ table: UI5Element,
44
+ sectionInfo:
45
+ | {
46
+ section: ObjectPageSection;
47
+ subSection: ObjectPageSubSection;
48
+ layout?: ObjectPageLayout;
49
+ }
50
+ | undefined,
51
+ iconTabBar: IconTabBar | undefined,
52
+ iconTabBarFilterKey: string | undefined
53
+ ) {
54
+ if (sectionInfo) {
55
+ const { layout, section, subSection } = sectionInfo;
56
+ layout?.setSelectedSection(section);
57
+ section.setSelectedSubSection(subSection);
58
+ } else {
59
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
60
+ }
61
+
62
+ if (iconTabBar && iconTabBarFilterKey) {
63
+ iconTabBar.setSelectedKey(iconTabBarFilterKey);
64
+ }
65
+ }
66
+
67
+ export class AddTableCustomColumnQuickAction
68
+ extends TableQuickActionDefinitionBase
69
+ implements NestedQuickActionDefinition
70
+ {
71
+ constructor(context: QuickActionContext) {
72
+ super(
73
+ CREATE_TABLE_CUSTOM_COLUMN,
74
+ CONTROL_TYPES,
75
+ 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN',
76
+ context,
77
+ {
78
+ areTableRowsRequired: true
79
+ },
80
+ [DIALOG_ENABLEMENT_VALIDATOR]
81
+ );
82
+ }
83
+
84
+ async execute(path: string): Promise<FlexCommand[]> {
85
+ const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path];
86
+ if (!table) {
87
+ return [];
88
+ }
89
+
90
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
91
+ this.selectOverlay(table);
92
+
93
+ let tableInternal: ManagedObject | undefined = table;
94
+ if (isA<SmartTable>(SMART_TABLE_TYPE, table)) {
95
+ const itemsAggregation = table.getAggregation('items') as ManagedObject[];
96
+ tableInternal = itemsAggregation.find((item) => {
97
+ return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some((tType) =>
98
+ isA(tType, item)
99
+ );
100
+ });
101
+ if (!tableInternal) {
102
+ return [];
103
+ }
104
+ }
105
+
106
+ const overlay = OverlayRegistry.getOverlay(tableInternal as UI5Element) || [];
107
+ if (!overlay) {
108
+ return [];
109
+ }
110
+
111
+ if (
112
+ isA(M_TABLE_TYPE, tableInternal) &&
113
+ (tableInternal.getAggregation('items') as ManagedObject[]).length === 0
114
+ ) {
115
+ await sendInfoCenterMessage({
116
+ title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
117
+ description: { key: 'TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN' },
118
+ type: MessageBarType.error
119
+ });
120
+ return [];
121
+ }
122
+ const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some((type) =>
123
+ isA(type, tableInternal)
124
+ )
125
+ ? DialogNames.ADD_FRAGMENT
126
+ : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
127
+ await DialogFactory.createDialog(
128
+ overlay,
129
+ this.context.rta,
130
+ dialog,
131
+ undefined,
132
+ {
133
+ aggregation: 'columns',
134
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
135
+ },
136
+ { actionName: this.type, telemetryEventIdentifier: this.getTelemetryIdentifier() }
137
+ );
138
+
139
+ return [];
140
+ }
141
+ }