@openui5/sap.ui.mdc 1.93.3 → 1.96.1

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 (237) hide show
  1. package/.reuse/dep5 +6 -11
  2. package/THIRDPARTY.txt +10 -16
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +236 -334
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -1
  7. package/src/sap/ui/mdc/Chart.js +150 -22
  8. package/src/sap/ui/mdc/ChartDelegateNew.js +15 -0
  9. package/src/sap/ui/mdc/ChartNew.js +107 -66
  10. package/src/sap/ui/mdc/Control.js +4 -3
  11. package/src/sap/ui/mdc/Element.js +5 -4
  12. package/src/sap/ui/mdc/Field.js +2 -2
  13. package/src/sap/ui/mdc/FilterBar.js +1 -10
  14. package/src/sap/ui/mdc/FilterField.js +28 -4
  15. package/src/sap/ui/mdc/Link.js +2 -2
  16. package/src/sap/ui/mdc/MultiValueField.js +1 -1
  17. package/src/sap/ui/mdc/Table.js +160 -79
  18. package/src/sap/ui/mdc/TableDelegate.js +20 -3
  19. package/src/sap/ui/mdc/ValueHelp.js +1474 -0
  20. package/src/sap/ui/mdc/ValueHelpDelegate.js +147 -0
  21. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +49 -104
  22. package/src/sap/ui/mdc/chart/DimensionItem.js +3 -3
  23. package/src/sap/ui/mdc/chart/Item.js +2 -3
  24. package/src/sap/ui/mdc/chart/MeasureItem.js +2 -2
  25. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +21 -2
  26. package/src/sap/ui/mdc/chart/ToolbarHandler.js +237 -225
  27. package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
  28. package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +14 -10
  29. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
  30. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +12 -10
  31. package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -1
  32. package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
  33. package/src/sap/ui/mdc/condition/Condition.js +2 -2
  34. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  35. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  36. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  37. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +13 -7
  38. package/src/sap/ui/mdc/condition/Operator.js +4 -4
  39. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  40. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +43 -0
  41. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +91 -0
  42. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +20 -0
  43. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +31 -0
  44. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +5 -0
  45. package/src/sap/ui/mdc/enum/ContentMode.js +25 -4
  46. package/src/sap/ui/mdc/enum/SelectType.js +43 -0
  47. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  48. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  49. package/src/sap/ui/mdc/field/ConditionType.js +19 -4
  50. package/src/sap/ui/mdc/field/ConditionsType.js +5 -4
  51. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  52. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  53. package/src/sap/ui/mdc/field/DefineConditionPanel.js +38 -14
  54. package/src/sap/ui/mdc/field/FieldBase.js +92 -41
  55. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
  56. package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
  57. package/src/sap/ui/mdc/field/FieldInfoBase.js +9 -1
  58. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  59. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  60. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -1
  62. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  63. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  64. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  65. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -2
  66. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  67. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  68. package/src/sap/ui/mdc/field/ListFieldHelp.js +3 -3
  69. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  70. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  71. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  72. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  73. package/src/sap/ui/mdc/field/content/BooleanContent.js +15 -3
  74. package/src/sap/ui/mdc/field/content/ContentFactory.js +16 -8
  75. package/src/sap/ui/mdc/field/content/DefaultContent.js +64 -23
  76. package/src/sap/ui/mdc/field/content/LinkContent.js +6 -0
  77. package/src/sap/ui/mdc/field/content/SearchContent.js +21 -3
  78. package/src/sap/ui/mdc/field/content/UnitContent.js +2 -2
  79. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +105 -44
  80. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +52 -0
  81. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +10 -51
  82. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  83. package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +22 -0
  84. package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +19 -0
  85. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  86. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +57 -46
  87. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  88. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  89. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
  90. package/src/sap/ui/mdc/library.js +588 -8
  91. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  92. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  93. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  94. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  95. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  96. package/src/sap/ui/mdc/link/Factory.js +1 -1
  97. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  98. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  99. package/src/sap/ui/mdc/link/Panel.js +1 -1
  100. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  101. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  102. package/src/sap/ui/mdc/link/SelectionDialog.js +2 -2
  103. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  104. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  105. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  106. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  107. package/src/sap/ui/mdc/messagebundle.properties +31 -5
  108. package/src/sap/ui/mdc/messagebundle_ar.properties +11 -4
  109. package/src/sap/ui/mdc/messagebundle_bg.properties +10 -3
  110. package/src/sap/ui/mdc/messagebundle_ca.properties +10 -3
  111. package/src/sap/ui/mdc/messagebundle_cs.properties +12 -5
  112. package/src/sap/ui/mdc/messagebundle_cy.properties +10 -3
  113. package/src/sap/ui/mdc/messagebundle_da.properties +10 -3
  114. package/src/sap/ui/mdc/messagebundle_de.properties +12 -5
  115. package/src/sap/ui/mdc/messagebundle_el.properties +11 -4
  116. package/src/sap/ui/mdc/messagebundle_en.properties +9 -2
  117. package/src/sap/ui/mdc/messagebundle_en_GB.properties +10 -3
  118. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +11 -3
  119. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +19 -3
  120. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +11 -2
  121. package/src/sap/ui/mdc/messagebundle_es.properties +35 -28
  122. package/src/sap/ui/mdc/messagebundle_es_MX.properties +10 -3
  123. package/src/sap/ui/mdc/messagebundle_et.properties +10 -3
  124. package/src/sap/ui/mdc/messagebundle_fi.properties +11 -4
  125. package/src/sap/ui/mdc/messagebundle_fr.properties +22 -15
  126. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +10 -3
  127. package/src/sap/ui/mdc/messagebundle_hi.properties +10 -3
  128. package/src/sap/ui/mdc/messagebundle_hr.properties +10 -3
  129. package/src/sap/ui/mdc/messagebundle_hu.properties +11 -4
  130. package/src/sap/ui/mdc/messagebundle_id.properties +11 -4
  131. package/src/sap/ui/mdc/messagebundle_it.properties +33 -26
  132. package/src/sap/ui/mdc/messagebundle_iw.properties +10 -3
  133. package/src/sap/ui/mdc/messagebundle_ja.properties +13 -6
  134. package/src/sap/ui/mdc/messagebundle_kk.properties +10 -3
  135. package/src/sap/ui/mdc/messagebundle_ko.properties +10 -3
  136. package/src/sap/ui/mdc/messagebundle_lt.properties +10 -3
  137. package/src/sap/ui/mdc/messagebundle_lv.properties +10 -3
  138. package/src/sap/ui/mdc/messagebundle_ms.properties +10 -3
  139. package/src/sap/ui/mdc/messagebundle_nl.properties +11 -4
  140. package/src/sap/ui/mdc/messagebundle_no.properties +17 -10
  141. package/src/sap/ui/mdc/messagebundle_pl.properties +14 -7
  142. package/src/sap/ui/mdc/messagebundle_pt.properties +11 -4
  143. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +10 -3
  144. package/src/sap/ui/mdc/messagebundle_ro.properties +13 -6
  145. package/src/sap/ui/mdc/messagebundle_ru.properties +10 -3
  146. package/src/sap/ui/mdc/messagebundle_sh.properties +10 -3
  147. package/src/sap/ui/mdc/messagebundle_sk.properties +11 -4
  148. package/src/sap/ui/mdc/messagebundle_sl.properties +10 -3
  149. package/src/sap/ui/mdc/messagebundle_sv.properties +11 -4
  150. package/src/sap/ui/mdc/messagebundle_th.properties +16 -9
  151. package/src/sap/ui/mdc/messagebundle_tr.properties +10 -3
  152. package/src/sap/ui/mdc/messagebundle_uk.properties +10 -3
  153. package/src/sap/ui/mdc/messagebundle_vi.properties +10 -3
  154. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +10 -3
  155. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +10 -3
  156. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  157. package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
  158. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
  159. package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
  160. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  161. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +6 -6
  162. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +37 -10
  163. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
  164. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +492 -203
  165. package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
  166. package/src/sap/ui/mdc/p13n/Engine.js +3 -2
  167. package/src/sap/ui/mdc/p13n/P13nBuilder.js +6 -60
  168. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  169. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  170. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +22 -24
  171. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +59 -0
  172. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +1 -2
  173. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +17 -8
  174. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1 -2
  175. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +1171 -0
  176. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
  177. package/src/sap/ui/mdc/p13n/panels/GroupView.js +7 -11
  178. package/src/sap/ui/mdc/p13n/panels/ListView.js +5 -3
  179. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +16 -9
  180. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -1
  181. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -1
  182. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +1 -1
  183. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
  184. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +89 -0
  185. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +9 -6
  186. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +33 -4
  187. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +9 -15
  188. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +12 -0
  189. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +5 -12
  190. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +19 -21
  191. package/src/sap/ui/mdc/table/Column.js +35 -9
  192. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  193. package/src/sap/ui/mdc/table/GridTableType.js +0 -1
  194. package/src/sap/ui/mdc/table/PropertyHelper.js +108 -5
  195. package/src/sap/ui/mdc/table/ResponsiveTableType.js +19 -3
  196. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  197. package/src/sap/ui/mdc/table/TableTypeBase.js +0 -1
  198. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  199. package/src/sap/ui/mdc/themes/base/FilterBar.less +2 -2
  200. package/src/sap/ui/mdc/themes/base/GroupView.less +2 -2
  201. package/src/sap/ui/mdc/themes/base/ListView.less +2 -2
  202. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +56 -21
  203. package/src/sap/ui/mdc/ui/Container.js +2 -2
  204. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  205. package/src/sap/ui/mdc/util/Common.js +26 -0
  206. package/src/sap/ui/mdc/util/FilterUtil.js +12 -1
  207. package/src/sap/ui/mdc/util/IdentifierUtil.js +4 -0
  208. package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
  209. package/src/sap/ui/mdc/util/PropertyHelper.js +22 -1
  210. package/src/sap/ui/mdc/valuehelp/Dialog.js +498 -0
  211. package/src/sap/ui/mdc/valuehelp/Popover.js +362 -0
  212. package/src/sap/ui/mdc/valuehelp/base/Container.js +642 -0
  213. package/src/sap/ui/mdc/valuehelp/base/Content.js +628 -0
  214. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +139 -0
  215. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +557 -0
  216. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +133 -0
  217. package/src/sap/ui/mdc/valuehelp/content/Bool.js +318 -0
  218. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +276 -0
  219. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +532 -0
  220. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +638 -0
  221. package/src/sap/ui/mdc/valuehelp/content/MTable.js +916 -0
  222. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -2
  223. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +48 -0
  224. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsBase.js +310 -0
  225. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsViz.js +39 -0
  226. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsBase.js +118 -0
  227. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsViz.js +137 -0
  228. package/test/sap/ui/mdc/testutils/opa/chartNew/ChartNew.js +24 -0
  229. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +289 -0
  230. package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
  231. package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
  232. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
  233. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
  234. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +401 -93
  235. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +4 -1
  236. package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
  237. package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
@@ -5,8 +5,15 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/m/OverflowToolbar", "sap/m/OverflowToolbarRenderer", "sap/m/ToolbarSpacer", "sap/m/ToolbarSeparator", "sap/ui/mdc/enum/ActionToolbarActionAlignment", "sap/ui/mdc/actiontoolbar/ActionToolbarAction"
9
- ], function(OverflowToolbar, OverflowToolbarRenderer, ToolbarSpacer, ToolbarSeparator, ActionToolbarActionAlignment, ActionToolbarAction) {
8
+ "sap/m/OverflowToolbar",
9
+ "sap/m/OverflowToolbarRenderer",
10
+ "sap/m/OverflowToolbarPriority",
11
+ "sap/m/ToolbarSpacer",
12
+ "sap/m/ToolbarSeparator",
13
+ "sap/ui/mdc/enum/ActionToolbarActionAlignment",
14
+ "sap/ui/mdc/p13n/subcontroller/ActionToolbarController",
15
+ "sap/ui/mdc/p13n/Engine"
16
+ ], function(OverflowToolbar, OverflowToolbarRenderer, OverflowToolbarPriority, ToolbarSpacer, ToolbarSeparator, ActionToolbarActionAlignment, ActionToolbarController, Engine) {
10
17
  "use strict";
11
18
 
12
19
  /**
@@ -21,11 +28,12 @@ sap.ui.define([
21
28
  * @class The column for the metadata driven table, that hold the template to be shown when the rows has data.
22
29
  * @extends sap.m.OverflowToolbar
23
30
  * @author SAP SE
24
- * @version 1.93.3
31
+ * @version 1.96.1
25
32
  * @constructor
26
33
  * @private
27
- * @experimental
28
34
  * @since 1.58
35
+ * @experimental As of version 1.58
36
+ * @ui5-restricted sap.ui.mdc
29
37
  * @alias sap.ui.mdc.ActionToolbar
30
38
  * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
31
39
  */
@@ -33,6 +41,7 @@ sap.ui.define([
33
41
  var ActionToolbar = OverflowToolbar.extend("sap.ui.mdc.ActionToolbar", {
34
42
  metadata: {
35
43
  library: "sap.ui.mdc",
44
+ designtime: "sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime",
36
45
  defaultAggregation: "actions",
37
46
  properties: {
38
47
  /**
@@ -65,7 +74,7 @@ sap.ui.define([
65
74
  * Further actions in the toolbar.
66
75
  */
67
76
  actions: {
68
- type: "sap.ui.core.Control",
77
+ type: "sap.ui.mdc.actiontoolbar.ActionToolbarAction",
69
78
  multiple: true
70
79
  },
71
80
 
@@ -81,411 +90,304 @@ sap.ui.define([
81
90
  renderer: OverflowToolbarRenderer
82
91
  });
83
92
 
84
- var _aAggregations = [
85
- "begin", "between", "end"
93
+ var aAggregations = [
94
+ "begin",
95
+ "between",
96
+ "actions",
97
+ "end"
86
98
  ];
87
99
 
88
- function _getAggregationIndex(oToolbar, sAggregationName) {
89
- var iAggregationIndex = _aAggregations.indexOf(sAggregationName);
90
- if (iAggregationIndex >= 0 && oToolbar._oSpacer /* Only return an index if the toolbar is not yet destroyed */) {
91
- return iAggregationIndex;
92
- }
93
- return -1;
94
- }
95
-
96
- function _add(oToolbar, oObj) {
97
- oToolbar._editctx = true;
98
- var res = oToolbar.addContent(oObj);
99
- oToolbar._editctx = false;
100
- return res;
101
- }
102
-
103
- function _insert(oToolbar, oObj, iIndex) {
104
- oToolbar._editctx = true;
105
- var res = oToolbar.insertContent(oObj, iIndex);
106
- oToolbar._editctx = false;
107
- return res;
108
- }
109
-
110
- function _remove(oToolbar, oObj) {
111
- oToolbar._editctx = true;
112
- var res = oToolbar.removeContent(oObj);
113
- oToolbar._editctx = false;
114
- return res;
115
- }
116
-
117
- function _destroy(oToolbar) {
118
- oToolbar._editctx = true;
119
- var res = oToolbar.destroyContent();
120
- oToolbar._editctx = false;
121
- return res;
122
- }
123
-
124
- function _checkModifyContent(oToolbar, sAggregationName) {
125
- if (sAggregationName === "content" && !oToolbar._editctx) {
126
- throw new Error("Mutator functions of the content aggregation of the ActionToolbar '" + oToolbar.getId() + "' must not be used.");
127
- }
128
- }
100
+ var fnGetOverflowToolbarConfig = function() {
101
+ var oConfig = {
102
+ canOverflow: true,
103
+ getCustomImportance: function() {
104
+ return OverflowToolbarPriority.NeverOverflow;
105
+ }
106
+ };
107
+
108
+ return oConfig;
109
+ };
129
110
 
130
111
  ActionToolbar.prototype.init = function() {
112
+ OverflowToolbar.prototype.init.apply(this, arguments);
131
113
  // Separator between begin (title) and between (variant) content of the toolbar.
132
- this._oTitleSeparator = new ToolbarSeparator({
114
+ this._oBeginSeparator = new ToolbarSeparator({
115
+ visible: false
116
+ });
117
+ this._oBeginSeparator.getOverflowToolbarConfig = fnGetOverflowToolbarConfig;
118
+ // Separator between actions and end content of the toolbar.
119
+ this._oEndActionsBeginSeparator = new ToolbarSeparator({
133
120
  visible: false
134
121
  });
122
+ this._oEndActionsBeginSeparator.getOverflowToolbarConfig = fnGetOverflowToolbarConfig;
123
+ // Separator between end and actions content of the toolbar.
124
+ this._oEndActionsEndSeparator = new ToolbarSeparator({
125
+ visible: false
126
+ });
127
+ this._oEndActionsEndSeparator.getOverflowToolbarConfig = fnGetOverflowToolbarConfig;
135
128
  // Spacer added to right align actions and end aggregation of the toolbar.
136
129
  this._oSpacer = new ToolbarSpacer();
137
130
 
138
- if (OverflowToolbar.prototype.init) {
139
- OverflowToolbar.prototype.init.apply(this, arguments);
140
- }
141
- // Add TitleSeparator, Spacer and ActionSeparator(not yet used) to the content of the toolbar (ordered)
142
- _add(this, this._oTitleSeparator);
143
- _add(this, this._oSpacer);
144
-
145
131
  this.setUseAsHeader(true);
146
- this._aActions = [];
132
+
133
+ Engine.getInstance().registerAdaptation(this, {
134
+ controller: {
135
+ actionsKey: ActionToolbarController
136
+ }
137
+ });
147
138
  };
148
139
 
149
140
  ActionToolbar.prototype.exit = function() {
150
- this._oSpacer = null;
151
- this._oTitleSeparator = null;
152
- this._aActions = undefined;
153
- _destroy(this);
154
-
155
- if (OverflowToolbar.prototype.exit) {
156
- OverflowToolbar.prototype.exit.apply(this, arguments);
141
+ OverflowToolbar.prototype.exit.apply(this, arguments);
142
+ if (this._oBeginSeparator) {
143
+ this._oBeginSeparator.destroy();
157
144
  }
158
- };
159
-
160
- ActionToolbar.prototype._getState = function(sAggregationName) {
161
- var iAggregationIndex = _getAggregationIndex(this, sAggregationName);
162
- if (iAggregationIndex >= 0) {
163
- return {
164
- aggregationIndex: iAggregationIndex,
165
- separatorIndex: [
166
- this.indexOfContent(this._oTitleSeparator), this.indexOfContent(this._oSpacer)
167
- ]
168
- };
145
+ if (this._oEndActionsBeginSeparator) {
146
+ this._oEndActionsBeginSeparator.destroy();
169
147
  }
170
- return null;
171
- };
172
-
173
- // According to visual designs currently no separator between actions and end content, only title separator is handled below
174
- /* Begin Title Separator handling */
175
- ActionToolbar.prototype.onAfterRendering = function() {
176
- OverflowToolbar.prototype.onAfterRendering.apply(this, arguments);
177
- this._updateSeparator();
178
- };
179
-
180
- ActionToolbar.prototype._onContentPropertyChangedOverflowToolbar = function(oEvent) {
181
- if (this._bIsBeingDestroyed) {
182
- return;
148
+ if (this._oEndActionsEndSeparator) {
149
+ this._oEndActionsEndSeparator.destroy();
183
150
  }
184
- OverflowToolbar.prototype._onContentPropertyChangedOverflowToolbar.apply(this, arguments);
185
- if (oEvent.getParameter("name") === "visible" || oEvent.getParameter("name") === "width" && oEvent.getSource() != this._oTitleSeparator) {
186
- this._updateSeparator();
151
+ if (this._oSpacer) {
152
+ this._oSpacer.destroy();
187
153
  }
188
154
  };
189
155
 
190
- ActionToolbar.prototype._updateSeparator = function() {
191
- if (this._oTitleSeparator && !this._editctx) {
192
- var fHasVisible = function(aArray) {
193
- return aArray ? aArray.some(function(oCtr) {
194
- // visible="true" and does not have "0px" width
195
- var bHasWidth = oCtr.getWidth ? oCtr.getWidth() !== "0px" : true;
196
- return oCtr.getVisible() && bHasWidth;
197
- }) : false;
198
- };
199
- var bHasBegin = fHasVisible(this.getBegin());
200
- var bHasBetween = fHasVisible(this.getBetween());
201
- this._oTitleSeparator.setVisible(bHasBegin && bHasBetween);
156
+ ActionToolbar.prototype.addAggregation = function(sAggregationName, oControl) {
157
+ if (sAggregationName === "content") {
158
+ throw new Error("Mutator functions of the content aggregation of the ActionToolbar '" + this.getId() + "' must not be used.");
202
159
  }
203
- };
204
- /* End Separator handling */
205
160
 
206
- ActionToolbar.prototype.setUseAsHeader = function(bHeader) {
207
- this.setProperty("useAsHeader", bHeader, true);
208
- this.toggleStyleClass("sapMTBHeader-CTX", !!bHeader);
209
- return this;
210
- };
161
+ var aArguments = arguments;
162
+ if (aAggregations.includes(sAggregationName)) {
163
+ this._registerControlListener(oControl);
164
+ this._resetAndInvalidateToolbar(false);
211
165
 
212
- ActionToolbar.prototype.indexOfAggregation = function(sAggregationName, oObject) {
213
- if (sAggregationName === "action" && oObject) {
214
- return this._aActions.indexOf(oObject);
215
- }
216
- var oInfo = this._getState(sAggregationName);
217
- if (oInfo) {
218
- var iIdx = this.indexOfContent(oObject);
219
- if (iIdx < 0) {
220
- return -1;
221
- }
222
- var iPrevSepIdx = oInfo.aggregationIndex == 0 ? -1 : oInfo.separatorIndex[oInfo.aggregationIndex - 1];
223
- var iNextSepIdx = oInfo.aggregationIndex == 2 ? this.getContent().length : oInfo.separatorIndex[oInfo.aggregationIndex];
224
- if (iIdx < iPrevSepIdx || iIdx > iNextSepIdx) {
225
- return -1;
166
+ if (oControl) {
167
+ this._moveControlInSuitableCollection(oControl, this._getControlPriority(oControl));
226
168
  }
227
- return iIdx - iPrevSepIdx - 1;
228
- }
229
- return OverflowToolbar.prototype.indexOfAggregation.apply(this, arguments);
230
- };
231
169
 
232
- ActionToolbar.prototype.indexOfAction = function(oObject) {
233
- return this._aActions.indexOf(oObject);
234
- };
170
+ this._informNewFlexibleContentAdded(oControl);
171
+
172
+ var vContent = this._callToolbarMethod("addAggregation", aArguments);
173
+ this._updateSeparators();
235
174
 
236
- ActionToolbar.prototype.getAggregation = function(sAggregationName) {
237
- var oInfo = this._getState(sAggregationName);
238
- if (oInfo) {
239
- var aContent = this.getContent();
240
- return aContent.slice(oInfo.aggregationIndex === 0 ? 0 : (oInfo.separatorIndex[oInfo.aggregationIndex - 1] + 1), oInfo.aggregationIndex >= oInfo.separatorIndex.length ? aContent.length : oInfo.separatorIndex[oInfo.aggregationIndex]);
175
+ return vContent;
241
176
  }
242
- return OverflowToolbar.prototype.getAggregation.apply(this, arguments);
243
- };
244
177
 
245
- ActionToolbar.prototype.getActions = function() {
246
- return this._aActions;
178
+ return OverflowToolbar.prototype.addAggregation.apply(this, arguments);
247
179
  };
248
180
 
249
- ActionToolbar.prototype.addAggregation = function(sAggregationName, oObject) {
250
- if (sAggregationName === "actions" && oObject) {
251
- if (oObject.getMetadata().getName() === "sap.ui.mdc.actiontoolbar.ActionToolbarAction") {
252
- return this._addAction(oObject);
253
- }
254
- return this._addAction(new ActionToolbarAction({
255
- action: oObject
256
- }));
181
+ ActionToolbar.prototype.destroyAggregation = function(sAggregationName) {
182
+ if (sAggregationName === "content") {
183
+ throw new Error("Mutator functions of the content aggregation of the ActionToolbar '" + this.getId() + "' must not be used.");
257
184
  }
258
- var oInfo = this._getState(sAggregationName);
259
- if (oInfo) {
260
- if (!oObject) {
261
- return this;
262
- }
263
- var iIdx = this.indexOfContent(oObject);
264
- if (iIdx >= 0) {
265
- _remove(this, oObject);
266
- this.addAggregation(sAggregationName, oObject);
267
- } else {
268
- _insert(this, oObject, oInfo.aggregationIndex >= oInfo.separatorIndex.length ? this.getContent().length : oInfo.separatorIndex[oInfo.aggregationIndex]);
185
+
186
+ if (aAggregations.includes(sAggregationName)) {
187
+ var aContentToDelete = this.removeAllAggregation(sAggregationName);
188
+ for (var i = 0; i < aContentToDelete.length; i++) {
189
+ aContentToDelete[i].destroy();
269
190
  }
270
- this._updateSeparator();
191
+ this._updateSeparators();
192
+
271
193
  return this;
272
194
  }
273
- _checkModifyContent(this, sAggregationName);
274
- return OverflowToolbar.prototype.addAggregation.apply(this, arguments);
195
+
196
+ return OverflowToolbar.prototype.destroyAggregation.apply(this, arguments);
275
197
  };
276
198
 
277
- ActionToolbar.prototype.insertAggregation = function(sAggregationName, oObject, iIndex) {
278
- if (sAggregationName === "actions" && oObject) {
279
- if (oObject.getMetadata().getName() === "sap.ui.mdc.actiontoolbar.ActionToolbarAction") {
280
- return this._addAction(oObject);
281
- }
282
- return this._addAction(new ActionToolbarAction({
283
- action: oObject
284
- }));
199
+ ActionToolbar.prototype.insertAggregation = function(sAggregationName, oControl, iIndex) {
200
+ if (sAggregationName === "content") {
201
+ throw new Error("Mutator functions of the content aggregation of the ActionToolbar '" + this.getId() + "' must not be used.");
285
202
  }
286
- var oInfo = this._getState(sAggregationName);
287
- if (oInfo) {
288
- if (!oObject) {
289
- return this;
290
- }
291
- var iIdx = this.indexOfContent(oObject);
292
- if (iIdx >= 0) {
293
- iIdx = this.indexOfAggregation(sAggregationName, oObject);
294
- if (iIdx >= 0 && iIndex > iIdx) {
295
- iIndex--;
296
- }
297
- _remove(this, oObject);
298
- this.insertAggregation(sAggregationName, oObject, iIndex);
299
- } else {
300
- var iLen = this.getAggregation(sAggregationName).length;
301
- if (iIndex < 0) {
302
- iIdx = 0;
303
- } else if (iIndex > iLen) {
304
- iIdx = iLen;
305
- } else {
306
- iIdx = iIndex;
307
- }
308
- var iPrevSepIdx = oInfo.aggregationIndex == 0 ? -1 : oInfo.separatorIndex[oInfo.aggregationIndex - 1];
309
- _insert(this, oObject, iIdx + iPrevSepIdx + 1);
203
+
204
+ if (aAggregations.includes(sAggregationName)) {
205
+ this._registerControlListener(oControl);
206
+ this._resetAndInvalidateToolbar(false);
207
+
208
+ if (oControl) {
209
+ this._moveControlInSuitableCollection(oControl, this._getControlPriority(oControl));
310
210
  }
311
- this._updateSeparator();
312
- return this;
211
+
212
+ this._informNewFlexibleContentAdded(oControl);
213
+
214
+ var vContent = this._callToolbarMethod("insertAggregation", arguments);
215
+ this._updateSeparators();
216
+
217
+ return vContent;
313
218
  }
314
- _checkModifyContent(this, sAggregationName);
219
+
315
220
  return OverflowToolbar.prototype.insertAggregation.apply(this, arguments);
316
221
  };
317
222
 
318
- ActionToolbar.prototype._addAction = function(oActionToolbarAction) {
319
- var sAggregationName = oActionToolbarAction.getLayoutInformation().aggregationName;
320
- var sAlignment = oActionToolbarAction.getLayoutInformation().alignment;
321
- var aAggregation = this.getAggregation(sAggregationName);
322
- var aActionsInAggregation;
323
- var oLastAddedAction;
324
- var iActionIndex = 0;
325
-
326
- if (sAlignment === ActionToolbarActionAlignment.End) {
327
- if (oActionToolbarAction.getVisible() && !this._aggregationContainsActionSeparatorBefore(sAggregationName)) {
328
- this.addAggregation(sAggregationName, oActionToolbarAction.getSeparatorBefore());
329
- }
330
- this.addAggregation(sAggregationName, oActionToolbarAction);
331
- if (!this._aActions.includes(oActionToolbarAction)) {
332
- this._aActions.push(oActionToolbarAction);
333
- }
334
- } else if (sAlignment === ActionToolbarActionAlignment.Begin && aAggregation[0] !== oActionToolbarAction) {
335
- aActionsInAggregation = this._getActionsInAggregationWithAlignment(sAggregationName, sAlignment);
336
- if (aActionsInAggregation.length) {
337
- oLastAddedAction = aActionsInAggregation[aActionsInAggregation.length - 1];
338
- iActionIndex = this.indexOfAggregation(sAggregationName, oLastAddedAction) + 1;
339
- }
340
- this.insertAggregation(sAggregationName, oActionToolbarAction, iActionIndex);
341
-
342
- if (oActionToolbarAction.getVisible() && !this._aggregationContainsActionSeparatorAfter(sAggregationName)) {
343
- this.insertAggregation(sAggregationName, oActionToolbarAction.getSeparatorAfter(), iActionIndex + 1);
344
- }
345
- if (!this._aActions.includes(oActionToolbarAction)) {
346
- this._aActions.push(oActionToolbarAction);
347
- }
223
+ ActionToolbar.prototype.removeAllAggregation = function(sAggregationName) {
224
+ if (sAggregationName === "content") {
225
+ throw new Error("Mutator functions of the content aggregation of the ActionToolbar '" + this.getId() + "' must not be used.");
348
226
  }
349
- oActionToolbarAction.updateSeparators();
350
- return this;
227
+
228
+ return OverflowToolbar.prototype.removeAllAggregation.apply(this, arguments);
351
229
  };
352
230
 
353
- ActionToolbar.prototype._aggregationContainsActionSeparator = function (sAggregationName, sAlignment) {
354
- var aActionsInAggregation = this._getActionsInAggregation(sAggregationName);
231
+ ActionToolbar.prototype.removeAggregation = function(sAggregationName, vObject) {
232
+ if (sAggregationName === "content") {
233
+ throw new Error("Mutator functions of the content aggregation of the ActionToolbar '" + this.getId() + "' must not be used.");
234
+ }
355
235
 
356
- return aActionsInAggregation.some(function(oActionInAggregation) {
357
- return oActionInAggregation['getSeparator' + sAlignment]().getVisible() && !oActionInAggregation.bIsDestroyed;
358
- });
359
- };
236
+ if (aAggregations.includes(sAggregationName)) {
237
+ var vContent = this._callToolbarMethod("removeAggregation", arguments);
238
+ if (vContent) {
239
+ this._getPopover().removeAssociatedContent(vContent.getId());
240
+ }
241
+ this._resetAndInvalidateToolbar(false);
360
242
 
361
- ActionToolbar.prototype._aggregationContainsActionSeparatorBefore = function (sAggregationName) {
362
- return this._aggregationContainsActionSeparator(sAggregationName, "Before");
243
+ this._deregisterControlListener(vContent);
244
+ this._removeContentFromControlsCollections(vContent);
245
+ this._updateSeparators();
246
+
247
+ return vContent;
248
+ }
249
+
250
+ return OverflowToolbar.prototype.removeAggregation.apply(this, arguments);
363
251
  };
364
252
 
365
- ActionToolbar.prototype._aggregationContainsActionSeparatorAfter = function (sAggregationName) {
366
- return this._aggregationContainsActionSeparator(sAggregationName, "After");
253
+ ActionToolbar.prototype.setUseAsHeader = function(bHeader) {
254
+ this.setProperty("useAsHeader", bHeader, true);
255
+ this.toggleStyleClass("sapMTBHeader-CTX", !!bHeader);
256
+ return this;
367
257
  };
368
258
 
369
- ActionToolbar.prototype._getActionsInAggregation = function (sAggregationName) {
370
- return this._aActions.filter(function(oAction) {
371
- return oAction.getLayoutInformation().aggregationName === sAggregationName && !oAction.bIsDestroyed;
259
+ ActionToolbar.prototype.getEndActionsBegin = function() {
260
+ return this.getActionsWithLayoutInformation({
261
+ aggregationName: "end",
262
+ alignment: ActionToolbarActionAlignment.Begin
372
263
  });
373
264
  };
374
265
 
375
- ActionToolbar.prototype._getActionsInAggregationWithAlignment = function(sAggregationName, sAlignment) {
376
- return this._getActionsInAggregation(sAggregationName).filter(function(oAction) {
377
- return oAction.getLayoutInformation().alignment === sAlignment;
266
+ ActionToolbar.prototype.getEndActionsEnd = function() {
267
+ return this.getActionsWithLayoutInformation({
268
+ aggregationName: "end",
269
+ alignment: ActionToolbarActionAlignment.End
378
270
  });
379
271
  };
380
272
 
381
- ActionToolbar.prototype.removeAggregation = function(sAggregationName, vObject) {
382
- if (sAggregationName !== "content" && vObject && vObject.getMetadata().getName() === "sap.ui.mdc.actiontoolbar.ActionToolbarAction" ) {
383
- return this._removeAction(vObject);
384
- }
385
- return this._removeAggregation(sAggregationName, vObject);
273
+ ActionToolbar.prototype.getActionsWithLayoutInformation = function(oLayoutInformation) {
274
+ return this.getActions().filter(function(oActionToolbarAction) {
275
+ var oActionLayoutInformation = oActionToolbarAction.getLayoutInformation();
276
+ return oActionLayoutInformation.aggregationName === oLayoutInformation.aggregationName && oActionLayoutInformation.alignment === oLayoutInformation.alignment;
277
+ });
386
278
  };
387
279
 
388
- ActionToolbar.prototype._removeAggregation = function(sAggregationName, vObject) {
389
- if (_getAggregationIndex(this, sAggregationName) >= 0) {
390
- var oRemoved = _remove(this, vObject);
391
- this._updateSeparator();
392
- return oRemoved;
393
- }
394
- _checkModifyContent(this, sAggregationName);
395
- return OverflowToolbar.prototype.removeAggregation.apply(this, arguments);
280
+ // According to visual designs currently no separator between actions and end content, only title separator is handled below
281
+ /* Begin Title Separator handling */
282
+ ActionToolbar.prototype.onAfterRendering = function() {
283
+ OverflowToolbar.prototype.onAfterRendering.apply(this, arguments);
284
+ this._updateSeparators();
396
285
  };
397
286
 
398
- ActionToolbar.prototype._removeAction = function(oActionToolbarAction) {
399
- var sAggregationName = oActionToolbarAction.getLayoutInformation().aggregationName;
400
- var sAlignment = oActionToolbarAction.getLayoutInformation().alignment;
401
- var aActionsInAggregation;
402
- var oActionInAggregation;
403
- var oRemoved;
404
- var iSeparatorIndex;
405
-
406
- var iIndex = this._aActions.indexOf(oActionToolbarAction);
407
- if (iIndex > -1) {
408
- this._aActions.splice(iIndex, 1);
287
+ ActionToolbar.prototype._onContentPropertyChangedOverflowToolbar = function(oEvent) {
288
+ if (this._bIsBeingDestroyed) {
289
+ return;
409
290
  }
291
+ OverflowToolbar.prototype._onContentPropertyChangedOverflowToolbar.apply(this, arguments);
292
+ if (oEvent.getParameter("name") === "visible" || oEvent.getParameter("name") === "width" && oEvent.getSource() != this._oBeginSeparator) {
293
+ this._updateSeparators();
294
+ }
295
+ };
410
296
 
411
- oRemoved = this._removeAggregation(sAggregationName, oActionToolbarAction);
297
+ ActionToolbar.prototype._hasVisible = function(aArray) {
298
+ var aPopoverContent = this.getAggregation("_popover") ? this.getAggregation("_popover")._getAllContent() : [];
412
299
 
413
- aActionsInAggregation = this._getActionsInAggregation(sAggregationName).filter(function(oActionInAggregation) {
414
- return oActionInAggregation.getLayoutInformation().alignment === sAlignment;
300
+ var aVisibleContent = aArray.filter(function (oControl) {
301
+ return aPopoverContent.indexOf(oControl) === -1;
302
+ });
303
+ return aVisibleContent.some(function(oControl) {
304
+ // visible="true" and does not have "0px" width
305
+ var bHasWidth = oControl.getWidth ? oControl.getWidth() !== "0px" : true;
306
+ return oControl.getVisible() && bHasWidth;
415
307
  });
416
- if (aActionsInAggregation.length > 0) {
417
- oActionInAggregation = aActionsInAggregation[0];
418
- iSeparatorIndex = this.indexOfAggregation(sAggregationName, oActionInAggregation);
419
- if (sAlignment === ActionToolbarActionAlignment.Begin && oActionToolbarAction.getVisible() && !this._aggregationContainsActionSeparatorAfter(sAggregationName)) {
420
- iSeparatorIndex = iSeparatorIndex + 1;
421
- this.insertAggregation(sAggregationName, oActionInAggregation.getSeparatorAfter(), iSeparatorIndex);
422
- } else if (sAlignment === ActionToolbarActionAlignment.End && oActionToolbarAction.getVisible() && !this._aggregationContainsActionSeparatorBefore(sAggregationName)) {
423
- this.insertAggregation(sAggregationName, oActionInAggregation.getSeparatorBefore(), iSeparatorIndex);
424
- }
425
- oActionInAggregation.updateSeparators();
426
- }
427
-
428
- return oRemoved;
429
308
  };
430
309
 
431
- ActionToolbar.prototype.removeAllAggregation = function(sAggregationName) {
432
- if (sAggregationName === "actions") {
433
- return this._removeAllActions();
310
+ ActionToolbar.prototype._updateSeparators = function() {
311
+ var bHasEnd = this._hasVisible(this.getEnd());
312
+
313
+ if (this._oBeginSeparator) {
314
+ var bHasBegin = this._hasVisible(this.getBegin());
315
+ var bHasBetween = this._hasVisible(this.getBetween());
316
+ this._oBeginSeparator.setVisible(bHasBegin && bHasBetween);
434
317
  }
435
- if (_getAggregationIndex(this, sAggregationName) >= 0) {
436
- var aContentToRemove = this.getAggregation(sAggregationName);
437
- for (var i = 0; i < aContentToRemove.length; i++) {
438
- this.removeAggregation(sAggregationName, aContentToRemove[i]);
439
- }
440
- this._updateSeparator();
441
- return aContentToRemove;
318
+ if (this._oEndActionsBeginSeparator) {
319
+ var bHasEndActionsBegin = this._hasVisible(this.getEndActionsBegin());
320
+ this._oEndActionsBeginSeparator.setVisible(bHasEnd && bHasEndActionsBegin);
321
+ }
322
+ if (this._oEndActionsEndSeparator) {
323
+ var bHasEndActionsEnd = this._hasVisible(this.getEndActionsEnd());
324
+ this._oEndActionsEndSeparator.setVisible(bHasEnd && bHasEndActionsEnd);
442
325
  }
443
- _checkModifyContent(this, sAggregationName);
444
- return OverflowToolbar.prototype.removeAllAggregation.apply(this, arguments);
445
326
  };
446
327
 
447
- ActionToolbar.prototype._removeAllActions = function() {
448
- var aRemovedContent = [];
449
- while (this._aActions && this._aActions.length > 0) {
450
- aRemovedContent.push(this._removeAction(this._aActions[0]));
451
- }
452
- return aRemovedContent;
328
+ /*
329
+ * Overwrite generated functions to use internal array to look for aggregation
330
+ */
331
+ ActionToolbar.prototype.indexOfContent = function(oObject) {
332
+ return this.getContent().indexOf(oObject);
453
333
  };
454
334
 
455
- ActionToolbar.prototype.destroyAggregation = function(sAggregationName) {
456
- if (_getAggregationIndex(this, sAggregationName) >= 0 || sAggregationName === "actions") {
457
- var aContentToDelete = this.removeAllAggregation(sAggregationName);
458
- for (var i = 0; i < aContentToDelete.length; i++) {
459
- aContentToDelete[i].destroy();
460
- }
461
- this._updateSeparator();
462
- return this;
463
- }
464
- _checkModifyContent(this, sAggregationName);
465
- return OverflowToolbar.prototype.destroyAggregation.apply(this, arguments);
335
+ // Overwrite content aggregation functions
336
+ ActionToolbar.prototype.getContent = function() {
337
+ var aContent = this.getBegin();
338
+ aContent.push(this._oBeginSeparator);
339
+ aContent = aContent.concat(this.getBetween());
340
+ aContent.push(this._oSpacer);
341
+ aContent = aContent.concat(this.getEndActionsBegin());
342
+ aContent.push(this._oEndActionsBeginSeparator);
343
+ aContent = aContent.concat(this.getEnd());
344
+ aContent.push(this._oEndActionsEndSeparator);
345
+ aContent = aContent.concat(this.getEndActionsEnd());
346
+
347
+ return aContent;
466
348
  };
467
349
 
468
- ActionToolbar.prototype.propagateProperties = function() {
469
- // TODO: When the toolbar is used with aggregation forwarding (see aggregation actions of MDCTable) the propagation does not happen
470
- // because the actions are finally stored in the content aggregation and access to mAggregations["actions"] does not have any effect.
471
- var aContent = this.getContent();
472
- var iIndex;
473
- for (iIndex = 0; iIndex < aContent.length; iIndex++) {
474
- if (aContent[iIndex].aAPIParentInfos) {
475
- aContent[iIndex].__aAPIParentInfos = aContent[iIndex].aAPIParentInfos;
476
- aContent[iIndex].aAPIParentInfos = null;
477
- }
478
- }
479
- var res = OverflowToolbar.prototype.propagateProperties.apply(this, arguments);
480
- for (iIndex = 0; iIndex < aContent.length; iIndex++) {
481
- if (aContent[iIndex].__aAPIParentInfos) {
482
- aContent[iIndex].aAPIParentInfos = aContent[iIndex].__aAPIParentInfos;
483
- aContent[iIndex].__aAPIParentInfos = null;
350
+ ActionToolbar.prototype.getCurrentState = function() {
351
+ var aActions = [], sId;
352
+
353
+ this.getActions().forEach(function(oAction, iIndex) {
354
+ sId = oAction && oAction.getId();
355
+ if (oAction.getVisible()){
356
+ aActions.push({
357
+ name: sId,
358
+ alignment: oAction.getLayoutInformation().alignment
359
+ });
484
360
  }
485
- }
486
- return res;
361
+ });
362
+
363
+ return {
364
+ items: aActions
365
+ };
487
366
  };
488
367
 
489
- return ActionToolbar;
368
+ ActionToolbar.prototype.initPropertyHelper = function() {
369
+ return Promise.resolve({
370
+ getProperties: function() {
371
+
372
+ var aItems = [];
373
+ this.getActions().forEach(function(oAction){
374
+ aItems.push({
375
+ name: oAction.getId(),
376
+ alignment: oAction.getLayoutInformation().alignment,
377
+ getName: function() {
378
+ return oAction.getId();
379
+ },
380
+ getLabel: function() {
381
+ return oAction.getLabel();
382
+ },
383
+ visible: true
384
+ });
385
+ });
386
+
387
+ return aItems;
388
+ }.bind(this)
389
+ });
390
+ };
490
391
 
491
- }, true);
392
+ return ActionToolbar;
393
+ });