@sapui5/sap.fe.core 1.100.0 → 1.101.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 (250) hide show
  1. package/package.json +4 -4
  2. package/src/sap/fe/core/.library +2 -3
  3. package/src/sap/fe/core/AnnotationHelper.js +43 -24
  4. package/src/sap/fe/core/AnnotationHelper.ts +43 -37
  5. package/src/sap/fe/core/AppComponent.js +20 -27
  6. package/src/sap/fe/core/AppComponent.ts +19 -25
  7. package/src/sap/fe/core/AppStateHandler.js +5 -5
  8. package/src/sap/fe/core/AppStateHandler.ts +2 -2
  9. package/src/sap/fe/core/BaseController.js +9 -9
  10. package/src/sap/fe/core/BaseController.ts +3 -4
  11. package/src/sap/fe/core/CommonUtils.js +74 -17
  12. package/src/sap/fe/core/CommonUtils.ts +181 -110
  13. package/src/sap/fe/core/ExtensionAPI.js +11 -10
  14. package/src/sap/fe/core/ExtensionAPI.ts +22 -30
  15. package/src/sap/fe/core/PageController.js +12 -11
  16. package/src/sap/fe/core/PageController.ts +34 -34
  17. package/src/sap/fe/core/RouterProxy.js +36 -24
  18. package/src/sap/fe/core/RouterProxy.ts +36 -22
  19. package/src/sap/fe/core/TemplateComponent.js +193 -118
  20. package/src/sap/fe/core/TemplateComponent.ts +105 -117
  21. package/src/sap/fe/core/TemplateModel.js +6 -8
  22. package/src/sap/fe/core/TemplateModel.ts +2 -2
  23. package/src/sap/fe/core/TransactionHelper.js +33 -18
  24. package/src/sap/fe/core/TransactionHelper.ts +172 -153
  25. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +31 -17
  26. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +52 -45
  27. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +16 -6
  28. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +13 -3
  29. package/src/sap/fe/core/actions/collaboration/Manage.js +9 -7
  30. package/src/sap/fe/core/actions/collaboration/Manage.ts +33 -31
  31. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +53 -56
  32. package/src/sap/fe/core/actions/draft.js +308 -166
  33. package/src/sap/fe/core/actions/draft.ts +177 -74
  34. package/src/sap/fe/core/actions/messageHandling.js +25 -13
  35. package/src/sap/fe/core/actions/messageHandling.ts +49 -39
  36. package/src/sap/fe/core/actions/operations.js +4 -4
  37. package/src/sap/fe/core/actions/operations.ts +3 -2
  38. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
  39. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
  40. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
  41. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
  42. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +707 -0
  43. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -0
  44. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
  45. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
  46. package/src/sap/fe/core/controllerextensions/EditFlow.js +506 -245
  47. package/src/sap/fe/core/controllerextensions/EditFlow.ts +395 -275
  48. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
  49. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
  50. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +15 -17
  51. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +98 -96
  52. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +15 -15
  53. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +60 -53
  54. package/src/sap/fe/core/controllerextensions/InternalRouting.js +94 -42
  55. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +114 -91
  56. package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
  57. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
  58. package/src/sap/fe/core/controllerextensions/MassEdit.js +12 -12
  59. package/src/sap/fe/core/controllerextensions/MassEdit.ts +8 -9
  60. package/src/sap/fe/core/controllerextensions/MessageHandler.js +13 -25
  61. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +18 -28
  62. package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
  63. package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
  64. package/src/sap/fe/core/controllerextensions/Paginator.js +13 -13
  65. package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -18
  66. package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
  67. package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
  68. package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
  69. package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
  70. package/src/sap/fe/core/controllerextensions/Share.js +16 -16
  71. package/src/sap/fe/core/controllerextensions/Share.ts +32 -32
  72. package/src/sap/fe/core/controllerextensions/SideEffects.js +14 -14
  73. package/src/sap/fe/core/controllerextensions/SideEffects.ts +62 -63
  74. package/src/sap/fe/core/controllerextensions/ViewState.js +17 -31
  75. package/src/sap/fe/core/controllerextensions/ViewState.ts +93 -102
  76. package/src/sap/fe/core/controls/Any.js +28 -0
  77. package/src/sap/fe/core/controls/Any.ts +30 -0
  78. package/src/sap/fe/core/controls/CommandExecution.js +38 -15
  79. package/src/sap/fe/core/controls/CommandExecution.ts +20 -20
  80. package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
  81. package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
  82. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
  83. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
  84. package/src/sap/fe/core/controls/CustomQuickViewPage.js +73 -36
  85. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +22 -32
  86. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
  87. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +116 -66
  88. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +121 -67
  89. package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
  90. package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
  91. package/src/sap/fe/core/controls/FileWrapper.js +313 -0
  92. package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
  93. package/src/sap/fe/core/controls/FilterBar.js +154 -119
  94. package/src/sap/fe/core/controls/FilterBar.ts +128 -123
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +92 -37
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +32 -35
  97. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
  98. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
  99. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
  100. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
  101. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
  102. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
  103. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
  104. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +2 -2
  105. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
  106. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +7 -6
  107. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +15 -14
  108. package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
  109. package/src/sap/fe/core/converters/ManifestSettings.ts +5 -1
  110. package/src/sap/fe/core/converters/annotations/DataField.js +1 -2
  111. package/src/sap/fe/core/converters/annotations/DataField.ts +3 -4
  112. package/src/sap/fe/core/converters/controls/Common/Action.js +10 -10
  113. package/src/sap/fe/core/converters/controls/Common/Action.ts +20 -19
  114. package/src/sap/fe/core/converters/controls/Common/Chart.js +8 -8
  115. package/src/sap/fe/core/converters/controls/Common/Chart.ts +12 -11
  116. package/src/sap/fe/core/converters/controls/Common/Form.js +5 -5
  117. package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -1
  118. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  119. package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
  120. package/src/sap/fe/core/converters/controls/Common/Table.js +245 -112
  121. package/src/sap/fe/core/converters/controls/Common/Table.ts +305 -193
  122. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +5 -5
  123. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +4 -7
  124. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +72 -43
  125. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +134 -100
  126. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
  127. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
  128. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +5 -2
  129. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +4 -1
  130. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
  131. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
  132. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
  133. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
  134. package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
  135. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
  136. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +5 -5
  137. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +3 -7
  138. package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
  139. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
  140. package/src/sap/fe/core/formatters/TableFormatter.js +2 -2
  141. package/src/sap/fe/core/formatters/TableFormatter.ts +1 -1
  142. package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
  143. package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
  144. package/src/sap/fe/core/fpm/Component.js +46 -17
  145. package/src/sap/fe/core/fpm/Component.ts +11 -16
  146. package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
  147. package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
  148. package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
  149. package/src/sap/fe/core/helpers/ClassSupport.ts +314 -237
  150. package/src/sap/fe/core/helpers/MassEditHelper.js +173 -39
  151. package/src/sap/fe/core/helpers/MassEditHelper.ts +236 -132
  152. package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
  153. package/src/sap/fe/core/helpers/ModelHelper.ts +23 -0
  154. package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
  155. package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
  156. package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
  157. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
  158. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
  159. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
  160. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -7
  161. package/src/sap/fe/core/helpers/StableIdHelper.ts +0 -4
  162. package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
  163. package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
  164. package/src/sap/fe/core/library.js +4 -5
  165. package/src/sap/fe/core/library.ts +17 -17
  166. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
  167. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
  168. package/src/sap/fe/core/messagebundle.properties +23 -8
  169. package/src/sap/fe/core/messagebundle_ar.properties +2 -0
  170. package/src/sap/fe/core/messagebundle_bg.properties +2 -0
  171. package/src/sap/fe/core/messagebundle_ca.properties +2 -0
  172. package/src/sap/fe/core/messagebundle_cs.properties +2 -0
  173. package/src/sap/fe/core/messagebundle_cy.properties +5 -3
  174. package/src/sap/fe/core/messagebundle_da.properties +2 -0
  175. package/src/sap/fe/core/messagebundle_de.properties +2 -0
  176. package/src/sap/fe/core/messagebundle_el.properties +2 -0
  177. package/src/sap/fe/core/messagebundle_en.properties +2 -0
  178. package/src/sap/fe/core/messagebundle_en_GB.properties +2 -0
  179. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
  180. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +2 -0
  181. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +2 -0
  182. package/src/sap/fe/core/messagebundle_es.properties +2 -0
  183. package/src/sap/fe/core/messagebundle_es_MX.properties +2 -0
  184. package/src/sap/fe/core/messagebundle_et.properties +2 -0
  185. package/src/sap/fe/core/messagebundle_fi.properties +2 -0
  186. package/src/sap/fe/core/messagebundle_fr.properties +4 -2
  187. package/src/sap/fe/core/messagebundle_fr_CA.properties +5 -3
  188. package/src/sap/fe/core/messagebundle_hi.properties +2 -0
  189. package/src/sap/fe/core/messagebundle_hr.properties +5 -3
  190. package/src/sap/fe/core/messagebundle_hu.properties +2 -0
  191. package/src/sap/fe/core/messagebundle_id.properties +2 -0
  192. package/src/sap/fe/core/messagebundle_it.properties +2 -0
  193. package/src/sap/fe/core/messagebundle_iw.properties +2 -0
  194. package/src/sap/fe/core/messagebundle_ja.properties +2 -0
  195. package/src/sap/fe/core/messagebundle_kk.properties +2 -0
  196. package/src/sap/fe/core/messagebundle_ko.properties +2 -0
  197. package/src/sap/fe/core/messagebundle_lt.properties +2 -0
  198. package/src/sap/fe/core/messagebundle_lv.properties +5 -3
  199. package/src/sap/fe/core/messagebundle_ms.properties +2 -0
  200. package/src/sap/fe/core/messagebundle_nl.properties +2 -0
  201. package/src/sap/fe/core/messagebundle_no.properties +2 -0
  202. package/src/sap/fe/core/messagebundle_pl.properties +5 -3
  203. package/src/sap/fe/core/messagebundle_pt.properties +2 -0
  204. package/src/sap/fe/core/messagebundle_pt_PT.properties +2 -0
  205. package/src/sap/fe/core/messagebundle_ro.properties +5 -3
  206. package/src/sap/fe/core/messagebundle_ru.properties +5 -3
  207. package/src/sap/fe/core/messagebundle_sh.properties +2 -0
  208. package/src/sap/fe/core/messagebundle_sk.properties +2 -0
  209. package/src/sap/fe/core/messagebundle_sl.properties +2 -0
  210. package/src/sap/fe/core/messagebundle_sv.properties +3 -1
  211. package/src/sap/fe/core/messagebundle_th.properties +2 -0
  212. package/src/sap/fe/core/messagebundle_tr.properties +2 -0
  213. package/src/sap/fe/core/messagebundle_uk.properties +2 -0
  214. package/src/sap/fe/core/messagebundle_vi.properties +2 -0
  215. package/src/sap/fe/core/messagebundle_zh_CN.properties +5 -3
  216. package/src/sap/fe/core/messagebundle_zh_TW.properties +5 -3
  217. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
  218. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
  219. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
  220. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
  221. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +7 -7
  222. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +6 -5
  223. package/src/sap/fe/core/services/NavigationServiceFactory.js +4 -4
  224. package/src/sap/fe/core/services/NavigationServiceFactory.ts +1 -1
  225. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
  226. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
  227. package/src/sap/fe/core/services/RoutingServiceFactory.js +98 -62
  228. package/src/sap/fe/core/services/RoutingServiceFactory.ts +51 -42
  229. package/src/sap/fe/core/services/ShellServicesFactory.js +69 -29
  230. package/src/sap/fe/core/services/ShellServicesFactory.ts +26 -29
  231. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
  232. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
  233. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +8 -8
  234. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +6 -17
  235. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
  236. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
  237. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  238. package/src/sap/fe/core/support/CommonHelper.ts +0 -3
  239. package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
  240. package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
  241. package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
  242. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
  243. package/src/sap/fe/core/templating/PropertyHelper.js +15 -1
  244. package/src/sap/fe/core/templating/PropertyHelper.ts +30 -23
  245. package/src/sap/fe/core/templating/UIFormatters.js +121 -21
  246. package/src/sap/fe/core/templating/UIFormatters.ts +134 -49
  247. package/src/sap/fe/core/type/Email.js +26 -8
  248. package/src/sap/fe/core/type/Email.ts +8 -7
  249. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
  250. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
@@ -2,142 +2,147 @@ import MdcFilterBar from "sap/ui/mdc/FilterBar";
2
2
  import FilterItemLayout from "sap/ui/mdc/filterbar/aligned/FilterItemLayout";
3
3
  import VisualFilterContainer from "sap/fe/core/controls/filterbar/VisualFilterContainer";
4
4
  import FilterContainer from "sap/fe/core/controls/filterbar/FilterContainer";
5
- const FilterBar = MdcFilterBar.extend("sap.fe.core.controls.FilterBar", {
6
- metadata: {
7
- properties: {
8
- initialLayout: {
9
- type: "string",
10
- defaultValue: "compact"
11
- }
12
- },
13
- associations: {
14
- /**
15
- * Control which allows for switching between visual and normal filter layouts
16
- */
17
- toggleControl: {
18
- type: "sap.m.SegmentedButton",
19
- multiple: false
20
- }
5
+ import Core from "sap/ui/core/Core";
6
+ import { association, defineUI5Class, property } from "sap/fe/core/helpers/ClassSupport";
7
+ import SegmentedButton from "sap/m/SegmentedButton";
8
+ @defineUI5Class("sap.fe.core.controls.FilterBar")
9
+ class FilterBar extends MdcFilterBar {
10
+ @property({ type: "string", defaultValue: "compact" })
11
+ initialLayout!: string;
12
+ /**
13
+ * Control which allows for switching between visual and normal filter layouts
14
+ */
15
+ @association({
16
+ type: "sap.m.SegmentedButton",
17
+ multiple: false
18
+ })
19
+ toggleControl!: SegmentedButton;
20
+ private _oSegmentedButton?: SegmentedButton;
21
+ private _oSecondaryFilterBarLayout: any;
22
+ private _oFilterBarLayout: any;
23
+ private _cLayoutItem: any;
24
+
25
+ setToggleControl(vToggle: string | SegmentedButton) {
26
+ if (typeof vToggle === "string") {
27
+ this._oSegmentedButton = Core.byId(vToggle) as SegmentedButton;
28
+ } else {
29
+ this._oSegmentedButton = vToggle;
21
30
  }
22
- },
23
- renderer: {
24
- apiVersion: 2
25
- }
26
- });
27
- FilterBar.prototype.setToggleControl = function(vToggle: any) {
28
- if (typeof vToggle === "string") {
29
- this._oSegmentedButton = sap.ui.getCore().byId(vToggle);
30
- } else {
31
- this._oSegmentedButton = vToggle;
32
- }
33
31
 
34
- if (this.getToggleControl() && this._oSegmentedButton) {
35
- this._oSegmentedButton.detachEvent("select", this._toggleLayout.bind(this));
36
- }
37
- if (this._oSegmentedButton) {
38
- this._oSegmentedButton.attachEvent("select", this._toggleLayout.bind(this));
39
- }
40
- this.setAssociation("toggleControl", vToggle, true);
41
- };
42
- FilterBar.prototype._toggleLayout = function() {
43
- // Since primary layout is always compact
44
- // hence set the secondary layout as visual filter only for the first time only
45
- if (!this._oSecondaryFilterBarLayout) {
46
- this._oSecondaryFilterBarLayout = new VisualFilterContainer();
32
+ if (this.toggleControl && this._oSegmentedButton) {
33
+ this._oSegmentedButton.detachEvent("select", this._toggleLayout.bind(this));
34
+ }
35
+ if (this._oSegmentedButton) {
36
+ this._oSegmentedButton.attachEvent("select", this._toggleLayout.bind(this));
37
+ }
38
+ this.setAssociation("toggleControl", vToggle, true);
47
39
  }
48
40
 
49
- // do not show Adapt Filters Button for visual layout
50
- if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
51
- this.setShowAdaptFiltersButton(false);
52
- } else {
53
- this.setShowAdaptFiltersButton(true);
54
- }
41
+ _toggleLayout() {
42
+ // Since primary layout is always compact
43
+ // hence set the secondary layout as visual filter only for the first time only
44
+ if (!this._oSecondaryFilterBarLayout) {
45
+ this._oSecondaryFilterBarLayout = new VisualFilterContainer();
46
+ }
55
47
 
56
- // get all filter fields and button of the current layout
57
- const oCurrentFilterBarLayout = this._oFilterBarLayout;
58
- const oFilterItems = this.getFilterItems();
59
- const aFilterFields = oCurrentFilterBarLayout.getAllFilterFields();
60
- const aSortedFilterFields = this.getSortedFilterFields(oFilterItems, aFilterFields);
61
- const aButtons = oCurrentFilterBarLayout.getAllButtons();
62
- const aVisualFilterFields = oCurrentFilterBarLayout.getAllVisualFilterFields && oCurrentFilterBarLayout.getAllVisualFilterFields();
63
- if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
64
- this._oSecondaryFilterBarLayout.setAllFilterFields(aSortedFilterFields, aVisualFilterFields);
65
- }
66
- // use secondary filter bar layout as new layout
67
- this._oFilterBarLayout = this._oSecondaryFilterBarLayout;
48
+ // do not show Adapt Filters Button for visual layout
49
+ if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
50
+ this.setShowAdaptFiltersButton(false);
51
+ } else {
52
+ this.setShowAdaptFiltersButton(true);
53
+ }
68
54
 
69
- // insert all filter fields from current layout to new layout
70
- aFilterFields.forEach((oFilterField: any, iIndex: any) => {
71
- oCurrentFilterBarLayout.removeFilterField(oFilterField);
72
- this._oFilterBarLayout.insertFilterField(oFilterField, iIndex);
73
- });
74
- // insert all buttons from the current layout to the new layout
75
- aButtons.forEach((oButton: any) => {
76
- oCurrentFilterBarLayout.removeButton(oButton);
77
- this._oFilterBarLayout.addButton(oButton);
78
- });
55
+ // get all filter fields and button of the current layout
56
+ const oCurrentFilterBarLayout = this._oFilterBarLayout;
57
+ const oFilterItems = this.getFilterItems();
58
+ const aFilterFields = oCurrentFilterBarLayout.getAllFilterFields();
59
+ const aSortedFilterFields = this.getSortedFilterFields(oFilterItems, aFilterFields);
60
+ const aButtons = oCurrentFilterBarLayout.getAllButtons();
61
+ const aVisualFilterFields = oCurrentFilterBarLayout.getAllVisualFilterFields && oCurrentFilterBarLayout.getAllVisualFilterFields();
62
+ if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
63
+ this._oSecondaryFilterBarLayout.setAllFilterFields(aSortedFilterFields, aVisualFilterFields);
64
+ }
65
+ // use secondary filter bar layout as new layout
66
+ this._oFilterBarLayout = this._oSecondaryFilterBarLayout;
79
67
 
80
- // set the current filter bar layout to the secondary one
81
- this._oSecondaryFilterBarLayout = oCurrentFilterBarLayout;
68
+ // insert all filter fields from current layout to new layout
69
+ aFilterFields.forEach((oFilterField: any, iIndex: any) => {
70
+ oCurrentFilterBarLayout.removeFilterField(oFilterField);
71
+ this._oFilterBarLayout.insertFilterField(oFilterField, iIndex);
72
+ });
73
+ // insert all buttons from the current layout to the new layout
74
+ aButtons.forEach((oButton: any) => {
75
+ oCurrentFilterBarLayout.removeButton(oButton);
76
+ this._oFilterBarLayout.addButton(oButton);
77
+ });
82
78
 
83
- // update the layout aggregation of the filter bar and rerender the same.
84
- this.setAggregation("layout", this._oFilterBarLayout, true);
85
- this._oFilterBarLayout.rerender();
86
- };
87
- FilterBar.prototype.getSortedFilterFields = function(aFilterItems: any, aFilterFields: any) {
88
- const aFilterIds: any[] = [];
89
- aFilterItems.forEach(function(oFilterItem: any) {
90
- aFilterIds.push(oFilterItem.getId());
91
- });
92
- aFilterFields.sort(function(aFirstItem: any, aSecondItem: any) {
93
- let sFirstItemVFId, sSecondItemVFId;
94
- aFirstItem.getContent().forEach(function(oInnerControl: any) {
95
- if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
96
- sFirstItemVFId = oInnerControl.getId();
97
- }
79
+ // set the current filter bar layout to the secondary one
80
+ this._oSecondaryFilterBarLayout = oCurrentFilterBarLayout;
81
+
82
+ // update the layout aggregation of the filter bar and rerender the same.
83
+ this.setAggregation("layout", this._oFilterBarLayout, true);
84
+ this._oFilterBarLayout.rerender();
85
+ }
86
+
87
+ getSortedFilterFields(aFilterItems: any, aFilterFields: any) {
88
+ const aFilterIds: any[] = [];
89
+ aFilterItems.forEach(function(oFilterItem: any) {
90
+ aFilterIds.push(oFilterItem.getId());
98
91
  });
99
- aSecondItem.getContent().forEach(function(oInnerControl: any) {
100
- if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
101
- sSecondItemVFId = oInnerControl.getId();
102
- }
92
+ aFilterFields.sort(function(aFirstItem: any, aSecondItem: any) {
93
+ let sFirstItemVFId, sSecondItemVFId;
94
+ aFirstItem.getContent().forEach(function(oInnerControl: any) {
95
+ if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
96
+ sFirstItemVFId = oInnerControl.getId();
97
+ }
98
+ });
99
+ aSecondItem.getContent().forEach(function(oInnerControl: any) {
100
+ if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
101
+ sSecondItemVFId = oInnerControl.getId();
102
+ }
103
+ });
104
+ return aFilterIds.indexOf(sFirstItemVFId) - aFilterIds.indexOf(sSecondItemVFId);
103
105
  });
104
- return aFilterIds.indexOf(sFirstItemVFId) - aFilterIds.indexOf(sSecondItemVFId);
105
- });
106
- return aFilterFields;
107
- };
108
- FilterBar.prototype._createInnerLayout = function() {
109
- this._oFilterBarLayout = new FilterContainer();
110
- this._cLayoutItem = FilterItemLayout;
111
- this._oFilterBarLayout.getInner().addStyleClass("sapUiMdcFilterBarBaseAFLayout");
112
- this._addButtons();
106
+ return aFilterFields;
107
+ }
108
+
109
+ _createInnerLayout() {
110
+ this._oFilterBarLayout = new FilterContainer();
111
+ this._cLayoutItem = FilterItemLayout;
112
+ this._oFilterBarLayout.getInner().addStyleClass("sapUiMdcFilterBarBaseAFLayout");
113
+ this._addButtons();
113
114
 
114
- // TODO: Check with MDC if there is a better way to load visual filter on the basis of control property
115
- // _createInnerLayout is called on Init by the filter bar base.
116
- // This mean that we do not have access to the control properties yet
117
- // and hence we cannot decide on the basis of control properties whether initial layout should be compact or visual
118
- // As a result we have to do this workaround to always load the compact layout by default
119
- // And toogle the same in case the initialLayout was supposed to be visual filters.
120
- const oInnerLayout = this._oFilterBarLayout.getInner();
121
- const oFilterContainerInnerLayoutEventDelegate = {
122
- onBeforeRendering: () => {
123
- if (this.getInitialLayout() === "visual") {
124
- this._toggleLayout();
115
+ // TODO: Check with MDC if there is a better way to load visual filter on the basis of control property
116
+ // _createInnerLayout is called on Init by the filter bar base.
117
+ // This mean that we do not have access to the control properties yet
118
+ // and hence we cannot decide on the basis of control properties whether initial layout should be compact or visual
119
+ // As a result we have to do this workaround to always load the compact layout by default
120
+ // And toogle the same in case the initialLayout was supposed to be visual filters.
121
+ const oInnerLayout = this._oFilterBarLayout.getInner();
122
+ const oFilterContainerInnerLayoutEventDelegate = {
123
+ onBeforeRendering: () => {
124
+ if (this.initialLayout === "visual") {
125
+ this._toggleLayout();
126
+ }
127
+ oInnerLayout.removeEventDelegate(oFilterContainerInnerLayoutEventDelegate);
125
128
  }
126
- oInnerLayout.removeEventDelegate(oFilterContainerInnerLayoutEventDelegate);
127
- }
128
- };
129
- oInnerLayout.addEventDelegate(oFilterContainerInnerLayoutEventDelegate);
129
+ };
130
+ oInnerLayout.addEventDelegate(oFilterContainerInnerLayoutEventDelegate);
130
131
 
131
- this.setAggregation("layout", this._oFilterBarLayout, true);
132
- };
133
- FilterBar.prototype.exit = function() {
134
- (MdcFilterBar.prototype as any).exit.apply(this, []);
135
- // Sometimes upon external navigation this._SegmentedButton is already destroyed
136
- // so check if it exists and then only remove stuff
137
- if (this._oSegmentedButton) {
138
- this._oSegmentedButton.detachEvent("select", this._toggleLayout);
139
- delete this._oSegmentedButton;
132
+ this.setAggregation("layout", this._oFilterBarLayout, true);
140
133
  }
141
- };
142
134
 
135
+ exit() {
136
+ super.exit();
137
+ // Sometimes upon external navigation this._SegmentedButton is already destroyed
138
+ // so check if it exists and then only remove stuff
139
+ if (this._oSegmentedButton) {
140
+ this._oSegmentedButton.detachEvent("select", this._toggleLayout);
141
+ delete this._oSegmentedButton;
142
+ }
143
+ }
144
+ }
145
+ interface FilterBar {
146
+ _addButtons(): any;
147
+ }
143
148
  export default FilterBar;
@@ -2,47 +2,102 @@
2
2
  * SAP UI development toolkit for HTML5 (SAPUI5)
3
3
  * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
  */
5
- sap.ui.define(["sap/ui/core/Control"], function (Control) {
5
+ sap.ui.define(["sap/ui/core/Control", "sap/fe/core/helpers/ClassSupport"], function (Control, ClassSupport) {
6
6
  "use strict";
7
7
 
8
- var FormElementWrapper = Control.extend("sap.fe.core.controls.FormElementWrapper", {
9
- metadata: {
10
- interfaces: ["sap.ui.core.IFormContent"],
11
- properties: {
12
- width: {
13
- type: "sap.ui.core.CSSSize",
14
- defaultValue: null
15
- },
16
- formDoNotAdjustWidth: {
17
- type: "boolean",
18
- defaultValue: false
19
- }
20
- },
21
- defaultAggregation: "content",
22
- aggregations: {
23
- content: {
24
- type: "sap.ui.core.Control",
25
- multiple: false
26
- }
8
+ var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
9
+
10
+ var property = ClassSupport.property;
11
+ var implementInterface = ClassSupport.implementInterface;
12
+ var defineUI5Class = ClassSupport.defineUI5Class;
13
+ var aggregation = ClassSupport.aggregation;
14
+
15
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
16
+
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+
19
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
20
+
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+
23
+ 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; }
24
+
25
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
26
+
27
+ var FormElementWrapper = (_dec = defineUI5Class("sap.fe.core.controls.FormElementWrapper"), _dec2 = implementInterface("sap.ui.core.IFormContent"), _dec3 = property({
28
+ type: "sap.ui.core.CSSSize",
29
+ defaultValue: null
30
+ }), _dec4 = property({
31
+ type: "boolean",
32
+ defaultValue: false
33
+ }), _dec5 = aggregation({
34
+ type: "sap.ui.core.Control",
35
+ multiple: false,
36
+ isDefault: true
37
+ }), _dec(_class = (_class2 = /*#__PURE__*/function (_Control) {
38
+ _inheritsLoose(FormElementWrapper, _Control);
39
+
40
+ function FormElementWrapper() {
41
+ var _this;
42
+
43
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
44
+ args[_key] = arguments[_key];
27
45
  }
28
- },
29
- getAccessibilityInfo: function () {
30
- var oContent = this.getContent();
46
+
47
+ _this = _Control.call.apply(_Control, [this].concat(args)) || this;
48
+
49
+ _initializerDefineProperty(_this, "__implements__sap_ui_core_IFormContent", _descriptor, _assertThisInitialized(_this));
50
+
51
+ _initializerDefineProperty(_this, "width", _descriptor2, _assertThisInitialized(_this));
52
+
53
+ _initializerDefineProperty(_this, "formDoNotAdjustWidth", _descriptor3, _assertThisInitialized(_this));
54
+
55
+ _initializerDefineProperty(_this, "content", _descriptor4, _assertThisInitialized(_this));
56
+
57
+ return _this;
58
+ }
59
+
60
+ var _proto = FormElementWrapper.prototype;
61
+
62
+ _proto.getAccessibilityInfo = function getAccessibilityInfo() {
63
+ var oContent = this.content;
31
64
  return oContent && oContent.getAccessibilityInfo ? oContent.getAccessibilityInfo() : {};
32
- },
33
- renderer: {
34
- apiVersion: 2,
35
- render: function (oRm, oControl) {
36
- oRm.openStart("div", oControl);
37
- oRm.style("min-height", "1rem");
38
- oRm.style("width", oControl.getWidth());
39
- oRm.openEnd();
40
- oRm.renderControl(oControl.getContent()); // render the child Control
41
-
42
- oRm.close("div"); // end of the complete Control
43
- }
65
+ };
66
+
67
+ FormElementWrapper.render = function render(oRm, oControl) {
68
+ oRm.openStart("div", oControl);
69
+ oRm.style("min-height", "1rem");
70
+ oRm.style("width", oControl.width);
71
+ oRm.openEnd();
72
+ oRm.renderControl(oControl.content); // render the child Control
73
+
74
+ oRm.close("div"); // end of the complete Control
75
+ };
76
+
77
+ return FormElementWrapper;
78
+ }(Control), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "__implements__sap_ui_core_IFormContent", [_dec2], {
79
+ configurable: true,
80
+ enumerable: true,
81
+ writable: true,
82
+ initializer: function () {
83
+ return true;
44
84
  }
45
- });
85
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "width", [_dec3], {
86
+ configurable: true,
87
+ enumerable: true,
88
+ writable: true,
89
+ initializer: null
90
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "formDoNotAdjustWidth", [_dec4], {
91
+ configurable: true,
92
+ enumerable: true,
93
+ writable: true,
94
+ initializer: null
95
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "content", [_dec5], {
96
+ configurable: true,
97
+ enumerable: true,
98
+ writable: true,
99
+ initializer: null
100
+ })), _class2)) || _class);
46
101
  return FormElementWrapper;
47
102
  }, false);
48
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZvcm1FbGVtZW50V3JhcHBlci50cyJdLCJuYW1lcyI6WyJGb3JtRWxlbWVudFdyYXBwZXIiLCJDb250cm9sIiwiZXh0ZW5kIiwibWV0YWRhdGEiLCJpbnRlcmZhY2VzIiwicHJvcGVydGllcyIsIndpZHRoIiwidHlwZSIsImRlZmF1bHRWYWx1ZSIsImZvcm1Eb05vdEFkanVzdFdpZHRoIiwiZGVmYXVsdEFnZ3JlZ2F0aW9uIiwiYWdncmVnYXRpb25zIiwiY29udGVudCIsIm11bHRpcGxlIiwiZ2V0QWNjZXNzaWJpbGl0eUluZm8iLCJvQ29udGVudCIsImdldENvbnRlbnQiLCJyZW5kZXJlciIsImFwaVZlcnNpb24iLCJyZW5kZXIiLCJvUm0iLCJvQ29udHJvbCIsIm9wZW5TdGFydCIsInN0eWxlIiwiZ2V0V2lkdGgiLCJvcGVuRW5kIiwicmVuZGVyQ29udHJvbCIsImNsb3NlIl0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7O0FBR0EsTUFBTUEsa0JBQWtCLEdBQUdDLE9BQU8sQ0FBQ0MsTUFBUixDQUFlLHlDQUFmLEVBQTBEO0FBQ3BGQyxJQUFBQSxRQUFRLEVBQUU7QUFDVEMsTUFBQUEsVUFBVSxFQUFFLENBQUMsMEJBQUQsQ0FESDtBQUVUQyxNQUFBQSxVQUFVLEVBQUU7QUFDWEMsUUFBQUEsS0FBSyxFQUFFO0FBQ05DLFVBQUFBLElBQUksRUFBRSxx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udHJvbC5jb250ZW50KTsgLy8gcmVuZGVyIHRoZSBjaGlsZCBDb250cm9sXG5cdFx0b1JtLmNsb3NlKFwiZGl2XCIpOyAvLyBlbmQgb2YgdGhlIGNvbXBsZXRlIENvbnRyb2xcblx0fVxufVxuZXhwb3J0IGRlZmF1bHQgRm9ybUVsZW1lbnRXcmFwcGVyO1xuIl19
@@ -1,40 +1,37 @@
1
1
  import Control from "sap/ui/core/Control";
2
+ import { aggregation, defineUI5Class, implementInterface, property } from "sap/fe/core/helpers/ClassSupport";
3
+ import { CSSSize, IFormContent } from "sap/ui/core/library";
4
+ import RenderManager from "sap/ui/core/RenderManager";
2
5
 
3
- type FormElementWrapperType = {
4
- getContent(): Control;
5
- };
6
- const FormElementWrapper = Control.extend("sap.fe.core.controls.FormElementWrapper", {
7
- metadata: {
8
- interfaces: ["sap.ui.core.IFormContent"],
9
- properties: {
10
- width: {
11
- type: "sap.ui.core.CSSSize",
12
- defaultValue: null
13
- },
14
- formDoNotAdjustWidth: {
15
- type: "boolean",
16
- defaultValue: false
17
- }
18
- },
19
- defaultAggregation: "content",
20
- aggregations: {
21
- content: { type: "sap.ui.core.Control", multiple: false }
22
- }
23
- },
24
- getAccessibilityInfo: function(this: FormElementWrapperType) {
25
- const oContent = this.getContent();
6
+ @defineUI5Class("sap.fe.core.controls.FormElementWrapper")
7
+ class FormElementWrapper extends Control implements IFormContent {
8
+ @implementInterface("sap.ui.core.IFormContent")
9
+ __implements__sap_ui_core_IFormContent: boolean = true;
10
+
11
+ @property({
12
+ type: "sap.ui.core.CSSSize",
13
+ defaultValue: null
14
+ })
15
+ width!: CSSSize;
16
+ @property({
17
+ type: "boolean",
18
+ defaultValue: false
19
+ })
20
+ formDoNotAdjustWidth!: boolean;
21
+ @aggregation({ type: "sap.ui.core.Control", multiple: false, isDefault: true })
22
+ content!: Control;
23
+
24
+ getAccessibilityInfo() {
25
+ const oContent = this.content;
26
26
  return oContent && oContent.getAccessibilityInfo ? oContent.getAccessibilityInfo() : {};
27
- },
28
- renderer: {
29
- apiVersion: 2,
30
- render: function(oRm: any, oControl: any) {
31
- oRm.openStart("div", oControl);
32
- oRm.style("min-height", "1rem");
33
- oRm.style("width", oControl.getWidth());
34
- oRm.openEnd();
35
- oRm.renderControl(oControl.getContent()); // render the child Control
36
- oRm.close("div"); // end of the complete Control
37
- }
38
27
  }
39
- });
28
+ static render(oRm: RenderManager, oControl: FormElementWrapper) {
29
+ oRm.openStart("div", oControl);
30
+ oRm.style("min-height", "1rem");
31
+ oRm.style("width", oControl.width);
32
+ oRm.openEnd();
33
+ oRm.renderControl(oControl.content); // render the child Control
34
+ oRm.close("div"); // end of the complete Control
35
+ }
36
+ }
40
37
  export default FormElementWrapper;