@sapui5/sap.fe.core 1.99.0 → 1.100.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 (246) hide show
  1. package/package.json +4 -2
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +1 -69
  4. package/src/sap/fe/core/AnnotationHelper.ts +0 -70
  5. package/src/sap/fe/core/AppComponent.js +388 -399
  6. package/src/sap/fe/core/AppComponent.ts +403 -0
  7. package/src/sap/fe/core/AppStateHandler.js +127 -158
  8. package/src/sap/fe/core/BaseController.js +82 -58
  9. package/src/sap/fe/core/BaseController.ts +68 -0
  10. package/src/sap/fe/core/CommonUtils.js +111 -20
  11. package/src/sap/fe/core/CommonUtils.ts +131 -32
  12. package/src/sap/fe/core/ExtensionAPI.js +278 -274
  13. package/src/sap/fe/core/ExtensionAPI.ts +250 -0
  14. package/src/sap/fe/core/PageController.js +157 -29
  15. package/src/sap/fe/core/PageController.ts +60 -32
  16. package/src/sap/fe/core/RouterProxy.js +694 -756
  17. package/src/sap/fe/core/RouterProxy.ts +11 -9
  18. package/src/sap/fe/core/Synchronization.js +21 -31
  19. package/src/sap/fe/core/TemplateComponent.js +1 -1
  20. package/src/sap/fe/core/TemplateComponent.ts +10 -3
  21. package/src/sap/fe/core/TemplateModel.js +20 -38
  22. package/src/sap/fe/core/TemplateModel.ts +1 -1
  23. package/src/sap/fe/core/TransactionHelper.js +1354 -1370
  24. package/src/sap/fe/core/TransactionHelper.ts +33 -22
  25. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
  26. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
  27. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
  28. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
  29. package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
  30. package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
  31. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
  32. package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
  33. package/src/sap/fe/core/actions/draft.js +30 -68
  34. package/src/sap/fe/core/actions/draft.ts +44 -71
  35. package/src/sap/fe/core/actions/messageHandling.js +55 -36
  36. package/src/sap/fe/core/actions/messageHandling.ts +66 -46
  37. package/src/sap/fe/core/actions/operations.js +34 -15
  38. package/src/sap/fe/core/actions/operations.ts +48 -18
  39. package/src/sap/fe/core/actions/sticky.js +17 -4
  40. package/src/sap/fe/core/actions/sticky.ts +21 -4
  41. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +69 -66
  42. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
  43. package/src/sap/fe/core/controllerextensions/EditFlow.js +1593 -1669
  44. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
  45. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +79 -54
  46. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
  47. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +718 -779
  48. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
  49. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +796 -816
  50. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
  51. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1004 -1005
  52. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
  53. package/src/sap/fe/core/controllerextensions/KPIManagement.js +487 -521
  54. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -2
  55. package/src/sap/fe/core/controllerextensions/MassEdit.js +141 -169
  56. package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
  57. package/src/sap/fe/core/controllerextensions/MessageHandler.js +233 -244
  58. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
  59. package/src/sap/fe/core/controllerextensions/PageReady.js +301 -336
  60. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -10
  61. package/src/sap/fe/core/controllerextensions/Paginator.js +188 -175
  62. package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
  63. package/src/sap/fe/core/controllerextensions/Placeholder.js +157 -149
  64. package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
  65. package/src/sap/fe/core/controllerextensions/Routing.js +144 -125
  66. package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
  67. package/src/sap/fe/core/controllerextensions/RoutingListener.js +7 -6
  68. package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
  69. package/src/sap/fe/core/controllerextensions/Share.js +230 -268
  70. package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
  71. package/src/sap/fe/core/controllerextensions/SideEffects.js +592 -633
  72. package/src/sap/fe/core/controllerextensions/SideEffects.ts +8 -7
  73. package/src/sap/fe/core/controllerextensions/ViewState.js +788 -806
  74. package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
  75. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
  76. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
  77. package/src/sap/fe/core/controls/CommandExecution.js +67 -66
  78. package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
  79. package/src/sap/fe/core/controls/ConditionalWrapper.js +90 -75
  80. package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
  81. package/src/sap/fe/core/controls/CustomQuickViewPage.js +130 -125
  82. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
  83. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +103 -112
  84. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
  85. package/src/sap/fe/core/controls/FieldWrapper.js +122 -135
  86. package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
  87. package/src/sap/fe/core/controls/FilterBar.js +162 -159
  88. package/src/sap/fe/core/controls/FilterBar.ts +143 -0
  89. package/src/sap/fe/core/controls/FormElementWrapper.js +45 -39
  90. package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
  91. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +37 -42
  92. package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
  93. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +126 -116
  94. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
  95. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +241 -255
  96. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
  97. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +150 -141
  98. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
  99. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +335 -322
  100. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
  101. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +74 -74
  102. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
  103. package/src/sap/fe/core/converters/ConverterContext.js +348 -379
  104. package/src/sap/fe/core/converters/ConverterContext.ts +19 -16
  105. package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
  106. package/src/sap/fe/core/converters/ManifestSettings.ts +12 -1
  107. package/src/sap/fe/core/converters/ManifestWrapper.js +354 -378
  108. package/src/sap/fe/core/converters/ManifestWrapper.ts +10 -0
  109. package/src/sap/fe/core/converters/MetaModelConverter.js +6 -4
  110. package/src/sap/fe/core/converters/MetaModelConverter.ts +5 -2
  111. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  112. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
  113. package/src/sap/fe/core/converters/annotations/DataField.js +26 -12
  114. package/src/sap/fe/core/converters/annotations/DataField.ts +37 -13
  115. package/src/sap/fe/core/converters/controls/Common/Form.js +2 -2
  116. package/src/sap/fe/core/converters/controls/Common/Form.ts +4 -2
  117. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  118. package/src/sap/fe/core/converters/controls/Common/KPI.ts +3 -2
  119. package/src/sap/fe/core/converters/controls/Common/Table.js +130 -23
  120. package/src/sap/fe/core/converters/controls/Common/Table.ts +134 -29
  121. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +118 -53
  122. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +156 -93
  123. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +161 -207
  124. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +148 -206
  125. package/src/sap/fe/core/converters/helpers/Aggregation.js +115 -133
  126. package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
  127. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
  128. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
  129. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
  130. package/src/sap/fe/core/converters/helpers/Key.js +42 -57
  131. package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
  132. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +25 -4
  133. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +20 -3
  134. package/src/sap/fe/core/converters/templates/ListReportConverter.js +10 -4
  135. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +15 -4
  136. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
  137. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
  138. package/src/sap/fe/core/designtime/AppComponent.designtime.js +92 -98
  139. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
  140. package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
  141. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
  142. package/src/sap/fe/core/formatters/TableFormatter.js +53 -2
  143. package/src/sap/fe/core/formatters/TableFormatter.ts +51 -0
  144. package/src/sap/fe/core/fpm/Component.js +50 -54
  145. package/src/sap/fe/core/fpm/Component.ts +48 -0
  146. package/src/sap/fe/core/helpers/AppStartupHelper.js +323 -309
  147. package/src/sap/fe/core/helpers/AppStartupHelper.ts +363 -337
  148. package/src/sap/fe/core/helpers/BindingExpression.js +7 -7
  149. package/src/sap/fe/core/helpers/BindingExpression.ts +7 -7
  150. package/src/sap/fe/core/helpers/ClassSupport.js +186 -62
  151. package/src/sap/fe/core/helpers/ClassSupport.ts +168 -52
  152. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +5 -4
  153. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -5
  154. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  155. package/src/sap/fe/core/helpers/FPMHelper.ts +1 -1
  156. package/src/sap/fe/core/helpers/MassEditHelper.js +601 -684
  157. package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
  158. package/src/sap/fe/core/helpers/ModelHelper.js +25 -1
  159. package/src/sap/fe/core/helpers/ModelHelper.ts +23 -0
  160. package/src/sap/fe/core/helpers/SemanticDateOperators.js +5 -1
  161. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +4 -0
  162. package/src/sap/fe/core/library.js +426 -451
  163. package/src/sap/fe/core/library.support.js +22 -33
  164. package/src/sap/fe/core/library.support.ts +23 -0
  165. package/src/sap/fe/core/library.ts +420 -0
  166. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
  167. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +4 -1
  168. package/src/sap/fe/core/messagebundle.properties +22 -5
  169. package/src/sap/fe/core/messagebundle_ar.properties +27 -7
  170. package/src/sap/fe/core/messagebundle_bg.properties +27 -7
  171. package/src/sap/fe/core/messagebundle_ca.properties +27 -7
  172. package/src/sap/fe/core/messagebundle_cs.properties +27 -7
  173. package/src/sap/fe/core/messagebundle_cy.properties +27 -7
  174. package/src/sap/fe/core/messagebundle_da.properties +27 -7
  175. package/src/sap/fe/core/messagebundle_de.properties +27 -7
  176. package/src/sap/fe/core/messagebundle_el.properties +27 -7
  177. package/src/sap/fe/core/messagebundle_en.properties +27 -7
  178. package/src/sap/fe/core/messagebundle_en_GB.properties +27 -7
  179. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +27 -7
  180. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +27 -7
  181. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +27 -7
  182. package/src/sap/fe/core/messagebundle_es.properties +27 -7
  183. package/src/sap/fe/core/messagebundle_es_MX.properties +27 -7
  184. package/src/sap/fe/core/messagebundle_et.properties +27 -7
  185. package/src/sap/fe/core/messagebundle_fi.properties +28 -8
  186. package/src/sap/fe/core/messagebundle_fr.properties +28 -8
  187. package/src/sap/fe/core/messagebundle_fr_CA.properties +29 -9
  188. package/src/sap/fe/core/messagebundle_hi.properties +27 -7
  189. package/src/sap/fe/core/messagebundle_hr.properties +27 -7
  190. package/src/sap/fe/core/messagebundle_hu.properties +27 -7
  191. package/src/sap/fe/core/messagebundle_id.properties +27 -7
  192. package/src/sap/fe/core/messagebundle_it.properties +27 -7
  193. package/src/sap/fe/core/messagebundle_iw.properties +27 -7
  194. package/src/sap/fe/core/messagebundle_ja.properties +26 -6
  195. package/src/sap/fe/core/messagebundle_kk.properties +27 -7
  196. package/src/sap/fe/core/messagebundle_ko.properties +27 -7
  197. package/src/sap/fe/core/messagebundle_lt.properties +27 -7
  198. package/src/sap/fe/core/messagebundle_lv.properties +28 -8
  199. package/src/sap/fe/core/messagebundle_ms.properties +27 -7
  200. package/src/sap/fe/core/messagebundle_nl.properties +27 -7
  201. package/src/sap/fe/core/messagebundle_no.properties +27 -7
  202. package/src/sap/fe/core/messagebundle_pl.properties +27 -7
  203. package/src/sap/fe/core/messagebundle_pt.properties +28 -8
  204. package/src/sap/fe/core/messagebundle_pt_PT.properties +27 -7
  205. package/src/sap/fe/core/messagebundle_ro.properties +27 -7
  206. package/src/sap/fe/core/messagebundle_ru.properties +27 -7
  207. package/src/sap/fe/core/messagebundle_sh.properties +27 -7
  208. package/src/sap/fe/core/messagebundle_sk.properties +27 -7
  209. package/src/sap/fe/core/messagebundle_sl.properties +27 -7
  210. package/src/sap/fe/core/messagebundle_sv.properties +27 -7
  211. package/src/sap/fe/core/messagebundle_th.properties +26 -6
  212. package/src/sap/fe/core/messagebundle_tr.properties +30 -10
  213. package/src/sap/fe/core/messagebundle_uk.properties +27 -7
  214. package/src/sap/fe/core/messagebundle_vi.properties +27 -7
  215. package/src/sap/fe/core/messagebundle_zh_CN.properties +27 -7
  216. package/src/sap/fe/core/messagebundle_zh_TW.properties +27 -7
  217. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
  218. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +154 -192
  219. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +4 -4
  220. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +66 -92
  221. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +1 -1
  222. package/src/sap/fe/core/services/NavigationServiceFactory.js +284 -339
  223. package/src/sap/fe/core/services/NavigationServiceFactory.ts +10 -13
  224. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +67 -102
  225. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +5 -2
  226. package/src/sap/fe/core/services/RoutingServiceFactory.js +754 -814
  227. package/src/sap/fe/core/services/RoutingServiceFactory.ts +13 -13
  228. package/src/sap/fe/core/services/ShellServicesFactory.js +649 -736
  229. package/src/sap/fe/core/services/ShellServicesFactory.ts +7 -4
  230. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +567 -592
  231. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +22 -3
  232. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +354 -386
  233. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +21 -14
  234. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
  235. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +1 -1
  236. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  237. package/src/sap/fe/core/support/CommonHelper.ts +1 -1
  238. package/src/sap/fe/core/support/Diagnostics.js +36 -48
  239. package/src/sap/fe/core/templating/DataModelPathHelper.js +93 -85
  240. package/src/sap/fe/core/templating/DataModelPathHelper.ts +104 -95
  241. package/src/sap/fe/core/templating/FilterHelper.js +25 -32
  242. package/src/sap/fe/core/templating/FilterHelper.ts +36 -35
  243. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  244. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  245. package/src/sap/fe/core/templating/UIFormatters.js +32 -26
  246. package/src/sap/fe/core/templating/UIFormatters.ts +37 -24
@@ -1,12 +1,13 @@
1
1
  import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
2
2
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
3
3
  import View from "sap/ui/core/mvc/View";
4
- import { ControllerExtensionMetadata } from "sap/fe/core/controllerextensions";
4
+ import ControllerExtensionMetadata from "sap/fe/core/controllerextensions/ControllerExtensionMetadata";
5
5
  import Component from "sap/ui/core/Component";
6
- import { AppComponent } from "sap/fe/core";
6
+ import AppComponent from "sap/fe/core/AppComponent";
7
7
  import ManagedObject from "sap/ui/base/ManagedObject";
8
8
  import EventProvider from "sap/ui/base/EventProvider";
9
9
  import Log from "sap/base/Log";
10
+ import Event from "sap/ui/base/Event";
10
11
  import Context from "sap/ui/model/Context";
11
12
  import { UI5Class, Override, Public, Final, Extensible, Private } from "../helpers/ClassSupport";
12
13
  import TemplatedViewServiceFactory from "sap/fe/core/services/TemplatedViewServiceFactory";
@@ -41,7 +42,7 @@ class PageReadyControllerExtension extends ControllerExtension {
41
42
  this._oPageComponent = Component.getOwnerComponentFor(this._oView);
42
43
 
43
44
  if (this._oPageComponent && this._oPageComponent.attachContainerDefined) {
44
- this._oPageComponent.attachContainerDefined((oEvent: UI5Event) => this.registerContainer(oEvent.getParameter("container")));
45
+ this._oPageComponent.attachContainerDefined((oEvent: Event) => this.registerContainer(oEvent.getParameter("container")));
45
46
  } else {
46
47
  this.registerContainer(this._oView);
47
48
  }
@@ -104,13 +105,13 @@ class PageReadyControllerExtension extends ControllerExtension {
104
105
  const aNotBoundMDCTables: any[] = [];
105
106
  let iRequested = 0;
106
107
  let iReceived = 0;
107
- const fnRequested = (oEvent: UI5Event) => {
108
- oEvent.getSource().detachDataRequested(fnRequested);
108
+ const fnRequested = (oEvent: Event) => {
109
+ (oEvent.getSource() as any).detachDataRequested(fnRequested);
109
110
  iRequested++;
110
111
  this.bDataReceived = false;
111
112
  };
112
- const fnReceived = (oEvent: UI5Event) => {
113
- switch (oEvent.getSource().sGroupId) {
113
+ const fnReceived = (oEvent: Event) => {
114
+ switch ((oEvent.getSource() as any).sGroupId) {
114
115
  case "$auto.Workers":
115
116
  this._oEventProvider.fireEvent("workersBatchReceived");
116
117
  break;
@@ -119,7 +120,7 @@ class PageReadyControllerExtension extends ControllerExtension {
119
120
  break;
120
121
  default:
121
122
  }
122
- oEvent.getSource().detachDataReceived(fnReceived);
123
+ (oEvent.getSource() as any).detachDataReceived(fnReceived);
123
124
  iReceived++;
124
125
  if (iReceived >= iRequested && iRequested !== 0) {
125
126
  iRequested = 0;
@@ -128,9 +129,9 @@ class PageReadyControllerExtension extends ControllerExtension {
128
129
  this.checkPageReadyDebounced();
129
130
  }
130
131
  };
131
- const fnSearch = (oEvent: UI5Event) => {
132
+ const fnSearch = (oEvent: Event) => {
132
133
  const aMDCTables = aNotBoundMDCTables.filter(oElem => {
133
- if (oEvent.getSource().sId === oElem.getFilter() && oElem.getVisible()) {
134
+ if ((oEvent.getSource() as any).sId === oElem.getFilter() && oElem.getVisible()) {
134
135
  return true;
135
136
  }
136
137
  return false;
@@ -323,6 +324,7 @@ class PageReadyControllerExtension extends ControllerExtension {
323
324
  return false;
324
325
  }
325
326
 
327
+ @Public
326
328
  public checkPageReadyDebounced() {
327
329
  if (this.pageReadyTimer) {
328
330
  clearTimeout(this.pageReadyTimer);
@@ -1,178 +1,191 @@
1
1
  /*!
2
2
  * SAP UI development toolkit for HTML5 (SAPUI5)
3
- (c) Copyright 2009-2021 SAP SE. All rights reserved
4
-
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved
5
4
  */
6
- sap.ui.define(["sap/ui/core/mvc/ControllerExtension", "sap/ui/core/mvc/OverrideExecution", "sap/ui/model/json/JSONModel"], function(
7
- ControllerExtension,
8
- OverrideExecution,
9
- JSONModel
10
- ) {
11
- "use strict";
12
- /**
13
- * @class Controller extension providing hooks for the navigation using paginators
14
- *
15
- * @name sap.fe.core.controllerextensions.Paginator
16
- * @hideconstructor
17
- * @public
18
- * @since 1.94.0
19
- */
20
- return ControllerExtension.extend("sap.fe.core.controllerextensions.Paginator", {
21
- metadata: {
22
- methods: {
23
- initialize: {
24
- "final": true,
25
- "public": true
26
- },
27
- updateCurrentContext: {
28
- "final": true,
29
- "public": true
30
- },
31
- onBeforeContextUpdate: {
32
- "final": false,
33
- "public": false,
34
- overrideExecution: OverrideExecution.After
35
- },
36
- onContextUpdate: {
37
- "final": false,
38
- "public": true,
39
- overrideExecution: OverrideExecution.After
40
- }
41
- }
42
- },
43
- /**
44
- * Initiates the paginator control.
45
- * @function
46
- * @param {string} oBinding ODataListBinding object
47
- * @param {object} oContext Current context where the navigation is initiated
48
- * @alias sap.fe.core.controllerextensions.Paginator#initialize
49
- * @public
50
- * @since 1.94.0
51
- **/
52
- initialize: function(oBinding, oContext) {
53
- if (oBinding && oBinding.getCurrentContexts) {
54
- this._oListBinding = oBinding;
55
- }
56
- if (oContext) {
57
- this._oCurrentContext = oContext;
58
- }
59
- this._updateCurrentIndexAndButtonEnablement();
60
- },
61
-
62
- _updateCurrentIndexAndButtonEnablement: function() {
63
- var that = this;
64
- if (this._oCurrentContext && this._oListBinding) {
65
- var sPath = this._oCurrentContext.getPath();
66
- // Storing the currentIndex in global variable
67
- this._iCurrentIndex = this._oListBinding.getCurrentContexts().findIndex(function(oContext) {
68
- return oContext && oContext.getPath() === sPath;
69
- });
70
- var oCurrentIndexContext = this._oListBinding.getCurrentContexts()[this._iCurrentIndex];
71
- if (
72
- (!this._iCurrentIndex && this._iCurrentIndex !== 0) ||
73
- !oCurrentIndexContext ||
74
- this._oCurrentContext.getPath() !== oCurrentIndexContext.getPath()
75
- ) {
76
- that._updateCurrentIndex();
77
- }
78
- that._handleButtonEnablement();
79
- }
80
- },
81
-
82
- _handleButtonEnablement: function() {
83
- //Enabling and Disabling the Buttons on change of the control context
84
- var that = this;
85
- var mButtonEnablementModel = that.base.getView().getModel("paginator");
86
- if (this._oListBinding && this._oListBinding.getCurrentContexts().length > 1 && this._iCurrentIndex > -1) {
87
- if (this._iCurrentIndex === this._oListBinding.getCurrentContexts().length - 1) {
88
- mButtonEnablementModel.setProperty("/navDownEnabled", false);
89
- } else {
90
- mButtonEnablementModel.setProperty("/navDownEnabled", true);
91
- }
92
- if (this._iCurrentIndex === 0) {
93
- mButtonEnablementModel.setProperty("/navUpEnabled", false);
94
- } else {
95
- mButtonEnablementModel.setProperty("/navUpEnabled", true);
96
- }
97
- } else {
98
- // Don't show the paginator buttons
99
- // 1. When no listbinding is available
100
- // 2. Only '1' or '0' context exists in the listBinding
101
- // 3. The current index is -ve, i.e the currentIndex is invalid.
102
- mButtonEnablementModel.setProperty("/navUpEnabled", false);
103
- mButtonEnablementModel.setProperty("/navDownEnabled", false);
104
- }
105
- },
106
-
107
- _updateCurrentIndex: function() {
108
- if (this._oCurrentContext && this._oListBinding) {
109
- var sPath = this._oCurrentContext.getPath();
110
- // Storing the currentIndex in global variable
111
- this._iCurrentIndex = this._oListBinding.getCurrentContexts().findIndex(function(oContext) {
112
- return oContext && oContext.getPath() === sPath;
113
- });
114
- }
115
- },
116
-
117
- updateCurrentContext: function(iDeltaIndex) {
118
- var that = this;
119
-
120
- if (!that._oListBinding) {
121
- return;
122
- }
123
-
124
- var aCurrentContexts = that._oListBinding.getCurrentContexts();
125
- var iNewIndex = that._iCurrentIndex + iDeltaIndex;
126
- var oNewContext = aCurrentContexts[iNewIndex];
127
-
128
- if (oNewContext) {
129
- var bPreventIdxUpdate = that.onBeforeContextUpdate(this._oListBinding, this._iCurrentIndex, iDeltaIndex);
130
- if (!bPreventIdxUpdate) {
131
- that._iCurrentIndex = iNewIndex;
132
- that._oCurrentContext = oNewContext;
133
- }
134
- that.onContextUpdate(oNewContext);
135
- }
136
- that._handleButtonEnablement();
137
- },
138
-
139
- /**
140
- * Called before context update.
141
- * @function
142
- * @param {object} oListBinding ODataListBinding object
143
- * @param {object} iCurrentIndex Current index of context in listBinding from where the navigation is initiated
144
- * @param {integer} iIndexUpdate The delta index for update
145
- * @returns {boolean} `true` to prevent the update of current context.
146
- * @alias sap.fe.core.controllerextensions.Paginator#onBeforeContextUpdate
147
- * @private
148
- **/
149
- onBeforeContextUpdate: function(oListBinding, iCurrentIndex, iIndexUpdate) {
150
- return false;
151
- },
152
-
153
- /**
154
- * Returns the updated context after the paginator operation.
155
- * @function
156
- * @param {string} oContext Final context returned after the paginator action
157
- * @alias sap.fe.core.controllerextensions.Paginator#onContextUpdate
158
- * @public
159
- * @since 1.94.0
160
- **/
161
- onContextUpdate: function(oContext) {
162
- //To be overridden by the application
163
- },
164
-
165
- override: {
166
- onInit: function() {
167
- this._oView = this.base.getView();
168
- this._oView.setModel(
169
- new JSONModel({
170
- navUpEnabled: false,
171
- navDownEnabled: false
172
- }),
173
- "paginator"
174
- );
175
- }
176
- }
177
- });
178
- });
5
+ sap.ui.define(["sap/ui/core/mvc/ControllerExtension", "sap/ui/core/mvc/OverrideExecution", "sap/ui/model/json/JSONModel", "sap/fe/core/helpers/ClassSupport", "sap/fe/core/controllerextensions/ControllerExtensionMetadata"], function (ControllerExtension, OverrideExecution, JSONModel, ClassSupport, ControllerExtensionMetadata) {
6
+ "use strict";
7
+
8
+ var _dec, _dec2, _dec3, _dec4, _class, _class2;
9
+
10
+ var UI5Class = ClassSupport.UI5Class;
11
+ var Public = ClassSupport.Public;
12
+ var Private = ClassSupport.Private;
13
+ var Override = ClassSupport.Override;
14
+ var Final = ClassSupport.Final;
15
+ var Extensible = ClassSupport.Extensible;
16
+
17
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
+
19
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
+
21
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
22
+
23
+ /**
24
+ * Controller extension providing hooks for the navigation using paginators
25
+ *
26
+ * @hideconstructor
27
+ * @public
28
+ * @since 1.94.0
29
+ */
30
+ var Paginator = (_dec = UI5Class("sap.fe.core.controllerextensions.Paginator", ControllerExtensionMetadata), _dec2 = Override(), _dec3 = Extensible(OverrideExecution.After), _dec4 = Extensible(OverrideExecution.After), _dec(_class = (_class2 = /*#__PURE__*/function (_ControllerExtension) {
31
+ _inherits(Paginator, _ControllerExtension);
32
+
33
+ function Paginator() {
34
+ var _this;
35
+
36
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
37
+ args[_key] = arguments[_key];
38
+ }
39
+
40
+ _this = _ControllerExtension.call.apply(_ControllerExtension, [this].concat(args)) || this;
41
+ _this._iCurrentIndex = -1;
42
+ return _this;
43
+ }
44
+
45
+ var _proto = Paginator.prototype;
46
+
47
+ _proto.onInit = function onInit() {
48
+ this._oView = this.base.getView();
49
+
50
+ this._oView.setModel(new JSONModel({
51
+ navUpEnabled: false,
52
+ navDownEnabled: false
53
+ }), "paginator");
54
+ }
55
+ /**
56
+ * Initiates the paginator control.
57
+ * @function
58
+ * @param {sap.ui.model.odata.v4.ODataListBinding} oBinding ODataListBinding object
59
+ * @param {sap.ui.model.odata.v4.Context} oContext Current context where the navigation is initiated
60
+ * @alias sap.fe.core.controllerextensions.Paginator#initialize
61
+ * @public
62
+ * @since 1.94.0
63
+ **/
64
+ ;
65
+
66
+ _proto.initialize = function initialize(oBinding, oContext) {
67
+ if (oBinding && oBinding.getCurrentContexts) {
68
+ this._oListBinding = oBinding;
69
+ }
70
+
71
+ if (oContext) {
72
+ this._oCurrentContext = oContext;
73
+ }
74
+
75
+ this._updateCurrentIndexAndButtonEnablement();
76
+ };
77
+
78
+ _proto._updateCurrentIndexAndButtonEnablement = function _updateCurrentIndexAndButtonEnablement() {
79
+ if (this._oCurrentContext && this._oListBinding) {
80
+ var sPath = this._oCurrentContext.getPath(); // Storing the currentIndex in global variable
81
+
82
+
83
+ this._iCurrentIndex = this._oListBinding.getCurrentContexts().findIndex(function (oContext) {
84
+ return oContext && oContext.getPath() === sPath;
85
+ });
86
+
87
+ var oCurrentIndexContext = this._oListBinding.getCurrentContexts()[this._iCurrentIndex];
88
+
89
+ if (!this._iCurrentIndex && this._iCurrentIndex !== 0 || !oCurrentIndexContext || this._oCurrentContext.getPath() !== oCurrentIndexContext.getPath()) {
90
+ this._updateCurrentIndex();
91
+ }
92
+
93
+ this._handleButtonEnablement();
94
+ }
95
+ };
96
+
97
+ _proto._handleButtonEnablement = function _handleButtonEnablement() {
98
+ //Enabling and Disabling the Buttons on change of the control context
99
+ var mButtonEnablementModel = this.base.getView().getModel("paginator");
100
+
101
+ if (this._oListBinding && this._oListBinding.getCurrentContexts().length > 1 && this._iCurrentIndex > -1) {
102
+ if (this._iCurrentIndex === this._oListBinding.getCurrentContexts().length - 1) {
103
+ mButtonEnablementModel.setProperty("/navDownEnabled", false);
104
+ } else {
105
+ mButtonEnablementModel.setProperty("/navDownEnabled", true);
106
+ }
107
+
108
+ if (this._iCurrentIndex === 0) {
109
+ mButtonEnablementModel.setProperty("/navUpEnabled", false);
110
+ } else {
111
+ mButtonEnablementModel.setProperty("/navUpEnabled", true);
112
+ }
113
+ } else {
114
+ // Don't show the paginator buttons
115
+ // 1. When no listbinding is available
116
+ // 2. Only '1' or '0' context exists in the listBinding
117
+ // 3. The current index is -ve, i.e the currentIndex is invalid.
118
+ mButtonEnablementModel.setProperty("/navUpEnabled", false);
119
+ mButtonEnablementModel.setProperty("/navDownEnabled", false);
120
+ }
121
+ };
122
+
123
+ _proto._updateCurrentIndex = function _updateCurrentIndex() {
124
+ if (this._oCurrentContext && this._oListBinding) {
125
+ var sPath = this._oCurrentContext.getPath(); // Storing the currentIndex in global variable
126
+
127
+
128
+ this._iCurrentIndex = this._oListBinding.getCurrentContexts().findIndex(function (oContext) {
129
+ return oContext && oContext.getPath() === sPath;
130
+ });
131
+ }
132
+ };
133
+
134
+ _proto.updateCurrentContext = function updateCurrentContext(iDeltaIndex) {
135
+ if (!this._oListBinding) {
136
+ return;
137
+ }
138
+
139
+ var aCurrentContexts = this._oListBinding.getCurrentContexts();
140
+
141
+ var iNewIndex = this._iCurrentIndex + iDeltaIndex;
142
+ var oNewContext = aCurrentContexts[iNewIndex];
143
+
144
+ if (oNewContext) {
145
+ var bPreventIdxUpdate = this.onBeforeContextUpdate(this._oListBinding, this._iCurrentIndex, iDeltaIndex);
146
+
147
+ if (!bPreventIdxUpdate) {
148
+ this._iCurrentIndex = iNewIndex;
149
+ this._oCurrentContext = oNewContext;
150
+ }
151
+
152
+ this.onContextUpdate(oNewContext);
153
+ }
154
+
155
+ this._handleButtonEnablement();
156
+ }
157
+ /**
158
+ * Called before context update.
159
+ * @function
160
+ * @param {sap.ui.model.odata.v4.ODataListBinding} oListBinding ODataListBinding object
161
+ * @param {number} iCurrentIndex Current index of context in listBinding from where the navigation is initiated
162
+ * @param {number} iIndexUpdate The delta index for update
163
+ * @returns {boolean} `true` to prevent the update of current context.
164
+ * @alias sap.fe.core.controllerextensions.Paginator#onBeforeContextUpdate
165
+ * @private
166
+ **/
167
+ ;
168
+
169
+ _proto. // eslint-disable-next-line @typescript-eslint/no-unused-vars
170
+ onBeforeContextUpdate = function onBeforeContextUpdate(oListBinding, iCurrentIndex, iIndexUpdate) {
171
+ return false;
172
+ }
173
+ /**
174
+ * Returns the updated context after the paginator operation.
175
+ * @function
176
+ * @param {sap.ui.model.odata.v4.Context} oContext Final context returned after the paginator action
177
+ * @alias sap.fe.core.controllerextensions.Paginator#onContextUpdate
178
+ * @public
179
+ * @since 1.94.0
180
+ **/
181
+ ;
182
+
183
+ _proto. // eslint-disable-next-line @typescript-eslint/no-unused-vars
184
+ onContextUpdate = function onContextUpdate(oContext) {//To be overridden by the application
185
+ };
186
+
187
+ return Paginator;
188
+ }(ControllerExtension), (_applyDecoratedDescriptor(_class2.prototype, "onInit", [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, "onInit"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "initialize", [Public, Final], Object.getOwnPropertyDescriptor(_class2.prototype, "initialize"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "updateCurrentContext", [Public, Final], Object.getOwnPropertyDescriptor(_class2.prototype, "updateCurrentContext"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "onBeforeContextUpdate", [Private, _dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "onBeforeContextUpdate"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "onContextUpdate", [Private, _dec4], Object.getOwnPropertyDescriptor(_class2.prototype, "onContextUpdate"), _class2.prototype)), _class2)) || _class);
189
+ return Paginator;
190
+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VzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcblx0b25CZWZvcmVDb250ZXh0VXBkYXRlKG9MaXN0QmluZGluZzogT0RhdGFMaXN0QmluZGluZywgaUN1cnJlbnRJbmRleDogbnVtYmVyLCBpSW5kZXhVcGRhdGU6IG51bWJlcikge1xuXHRcdHJldHVybiBmYWxzZTtcblx0fVxuXG5cdC8qKlxuXHQgKiBSZXR1cm5zIHRoZSB1cGRhdGVkIGNvbnRleHQgYWZ0ZXIgdGhlIHBhZ2luYXRvciBvcGVyYXRpb24uXG5cdCAqIEBmdW5jdGlvblxuXHQgKiBAcGFyYW0ge3NhcC51aS5tb2RlbC5vZGF0YS52NC5Db250ZXh0fSBvQ29udGV4dCBGaW5hbCBjb250ZXh0IHJldHVybmVkIGFmdGVyIHRoZSBwYWdpbmF0b3IgYWN0aW9uXG5cdCAqIEBhbGlhcyBzYXAuZmUuY29yZS5jb250cm9sbGVyZXh0ZW5zaW9ucy5QYWdpbmF0b3Ijb25Db250ZXh0VXBkYXRlXG5cdCAqIEBwdWJsaWNcblx0ICogQHNpbmNlIDEuOTQuMFxuXHQgKiovXG5cdEBQcml2YXRlXG5cdEBFeHRlbnNpYmxlKE92ZXJyaWRlRXhlY3V0aW9uLkFmdGVyKVxuXHQvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVudXNlZC12YXJzXG5cdG9uQ29udGV4dFVwZGF0ZShvQ29udGV4dDogQ29udGV4dCkge1xuXHRcdC8vVG8gYmUgb3ZlcnJpZGRlbiBieSB0aGUgYXBwbGljYXRpb25cblx0fVxufVxuZXhwb3J0IGRlZmF1bHQgUGFnaW5hdG9yO1xuIl19
@@ -0,0 +1,163 @@
1
+ import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
2
+ import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
3
+ import JSONModel from "sap/ui/model/json/JSONModel";
4
+ import { Extensible, Final, Override, Private, Public, UI5Class } from "sap/fe/core/helpers/ClassSupport";
5
+ import ControllerExtensionMetadata from "sap/fe/core/controllerextensions/ControllerExtensionMetadata";
6
+ import View from "sap/ui/core/mvc/View";
7
+ import PageController from "sap/fe/core/PageController";
8
+ import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
9
+ import Context from "sap/ui/model/odata/v4/Context";
10
+
11
+ /**
12
+ * Controller extension providing hooks for the navigation using paginators
13
+ *
14
+ * @hideconstructor
15
+ * @public
16
+ * @since 1.94.0
17
+ */
18
+ @UI5Class("sap.fe.core.controllerextensions.Paginator", ControllerExtensionMetadata)
19
+ class Paginator extends ControllerExtension {
20
+ private _oView!: View;
21
+ private base!: PageController;
22
+ private _oListBinding: any;
23
+ private _oCurrentContext?: Context;
24
+ private _iCurrentIndex: number = -1;
25
+ @Override()
26
+ onInit() {
27
+ this._oView = this.base.getView();
28
+ this._oView.setModel(
29
+ new JSONModel({
30
+ navUpEnabled: false,
31
+ navDownEnabled: false
32
+ }),
33
+ "paginator"
34
+ );
35
+ }
36
+ /**
37
+ * Initiates the paginator control.
38
+ * @function
39
+ * @param {sap.ui.model.odata.v4.ODataListBinding} oBinding ODataListBinding object
40
+ * @param {sap.ui.model.odata.v4.Context} oContext Current context where the navigation is initiated
41
+ * @alias sap.fe.core.controllerextensions.Paginator#initialize
42
+ * @public
43
+ * @since 1.94.0
44
+ **/
45
+ @Public
46
+ @Final
47
+ initialize(oBinding: ODataListBinding | any, oContext: Context) {
48
+ if (oBinding && oBinding.getCurrentContexts) {
49
+ this._oListBinding = oBinding;
50
+ }
51
+ if (oContext) {
52
+ this._oCurrentContext = oContext;
53
+ }
54
+ this._updateCurrentIndexAndButtonEnablement();
55
+ }
56
+
57
+ _updateCurrentIndexAndButtonEnablement() {
58
+ if (this._oCurrentContext && this._oListBinding) {
59
+ const sPath = this._oCurrentContext.getPath();
60
+ // Storing the currentIndex in global variable
61
+ this._iCurrentIndex = this._oListBinding.getCurrentContexts().findIndex(function(oContext: any) {
62
+ return oContext && oContext.getPath() === sPath;
63
+ });
64
+ const oCurrentIndexContext = this._oListBinding.getCurrentContexts()[this._iCurrentIndex];
65
+ if (
66
+ (!this._iCurrentIndex && this._iCurrentIndex !== 0) ||
67
+ !oCurrentIndexContext ||
68
+ this._oCurrentContext.getPath() !== oCurrentIndexContext.getPath()
69
+ ) {
70
+ this._updateCurrentIndex();
71
+ }
72
+ this._handleButtonEnablement();
73
+ }
74
+ }
75
+
76
+ _handleButtonEnablement() {
77
+ //Enabling and Disabling the Buttons on change of the control context
78
+ const mButtonEnablementModel = this.base.getView().getModel("paginator") as JSONModel;
79
+ if (this._oListBinding && this._oListBinding.getCurrentContexts().length > 1 && this._iCurrentIndex > -1) {
80
+ if (this._iCurrentIndex === this._oListBinding.getCurrentContexts().length - 1) {
81
+ mButtonEnablementModel.setProperty("/navDownEnabled", false);
82
+ } else {
83
+ mButtonEnablementModel.setProperty("/navDownEnabled", true);
84
+ }
85
+ if (this._iCurrentIndex === 0) {
86
+ mButtonEnablementModel.setProperty("/navUpEnabled", false);
87
+ } else {
88
+ mButtonEnablementModel.setProperty("/navUpEnabled", true);
89
+ }
90
+ } else {
91
+ // Don't show the paginator buttons
92
+ // 1. When no listbinding is available
93
+ // 2. Only '1' or '0' context exists in the listBinding
94
+ // 3. The current index is -ve, i.e the currentIndex is invalid.
95
+ mButtonEnablementModel.setProperty("/navUpEnabled", false);
96
+ mButtonEnablementModel.setProperty("/navDownEnabled", false);
97
+ }
98
+ }
99
+
100
+ _updateCurrentIndex() {
101
+ if (this._oCurrentContext && this._oListBinding) {
102
+ const sPath = this._oCurrentContext.getPath();
103
+ // Storing the currentIndex in global variable
104
+ this._iCurrentIndex = this._oListBinding.getCurrentContexts().findIndex(function(oContext: any) {
105
+ return oContext && oContext.getPath() === sPath;
106
+ });
107
+ }
108
+ }
109
+ @Public
110
+ @Final
111
+ updateCurrentContext(iDeltaIndex: any) {
112
+ if (!this._oListBinding) {
113
+ return;
114
+ }
115
+
116
+ const aCurrentContexts = this._oListBinding.getCurrentContexts();
117
+ const iNewIndex = this._iCurrentIndex + iDeltaIndex;
118
+ const oNewContext = aCurrentContexts[iNewIndex];
119
+
120
+ if (oNewContext) {
121
+ const bPreventIdxUpdate = this.onBeforeContextUpdate(this._oListBinding, this._iCurrentIndex, iDeltaIndex);
122
+ if (!bPreventIdxUpdate) {
123
+ this._iCurrentIndex = iNewIndex;
124
+ this._oCurrentContext = oNewContext;
125
+ }
126
+ this.onContextUpdate(oNewContext);
127
+ }
128
+ this._handleButtonEnablement();
129
+ }
130
+
131
+ /**
132
+ * Called before context update.
133
+ * @function
134
+ * @param {sap.ui.model.odata.v4.ODataListBinding} oListBinding ODataListBinding object
135
+ * @param {number} iCurrentIndex Current index of context in listBinding from where the navigation is initiated
136
+ * @param {number} iIndexUpdate The delta index for update
137
+ * @returns {boolean} `true` to prevent the update of current context.
138
+ * @alias sap.fe.core.controllerextensions.Paginator#onBeforeContextUpdate
139
+ * @private
140
+ **/
141
+ @Private
142
+ @Extensible(OverrideExecution.After)
143
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
144
+ onBeforeContextUpdate(oListBinding: ODataListBinding, iCurrentIndex: number, iIndexUpdate: number) {
145
+ return false;
146
+ }
147
+
148
+ /**
149
+ * Returns the updated context after the paginator operation.
150
+ * @function
151
+ * @param {sap.ui.model.odata.v4.Context} oContext Final context returned after the paginator action
152
+ * @alias sap.fe.core.controllerextensions.Paginator#onContextUpdate
153
+ * @public
154
+ * @since 1.94.0
155
+ **/
156
+ @Private
157
+ @Extensible(OverrideExecution.After)
158
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
159
+ onContextUpdate(oContext: Context) {
160
+ //To be overridden by the application
161
+ }
162
+ }
163
+ export default Paginator;