@openui5/sap.ui.mdc 1.96.2 → 1.98.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 (329) hide show
  1. package/.reuse/dep5 +26 -31
  2. package/THIRDPARTY.txt +15 -21
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +2 -2
  5. package/src/sap/ui/mdc/ActionToolbar.js +3 -8
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -2
  7. package/src/sap/ui/mdc/BaseDelegate.js +2 -2
  8. package/src/sap/ui/mdc/Chart.js +1017 -1797
  9. package/src/sap/ui/mdc/ChartDelegate.js +430 -271
  10. package/src/sap/ui/mdc/ChartRenderer.js +74 -78
  11. package/src/sap/ui/mdc/Control.js +2 -2
  12. package/src/sap/ui/mdc/Delegate.js +1 -1
  13. package/src/sap/ui/mdc/Element.js +2 -2
  14. package/src/sap/ui/mdc/Field.js +4 -3
  15. package/src/sap/ui/mdc/FilterBar.js +4 -3
  16. package/src/sap/ui/mdc/FilterBarDelegate.js +1 -1
  17. package/src/sap/ui/mdc/FilterField.js +26 -9
  18. package/src/sap/ui/mdc/Link.js +5 -4
  19. package/src/sap/ui/mdc/LinkDelegate.js +2 -2
  20. package/src/sap/ui/mdc/MultiValueField.js +3 -2
  21. package/src/sap/ui/mdc/Table.js +174 -142
  22. package/src/sap/ui/mdc/TableDelegate.js +31 -16
  23. package/src/sap/ui/mdc/ValueHelp.js +52 -16
  24. package/src/sap/ui/mdc/ValueHelpDelegate.js +21 -1
  25. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +2 -2
  26. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
  27. package/src/sap/ui/mdc/{chartNew/ChartSelectionDetailsNew.js → chart/ChartSelectionDetails.js} +9 -9
  28. package/src/sap/ui/mdc/chart/ChartSettings.js +1 -1
  29. package/src/sap/ui/mdc/{chartNew/ChartToolbarNew.js → chart/ChartToolbar.js} +11 -11
  30. package/src/sap/ui/mdc/chart/ChartTypeButton.js +49 -53
  31. package/src/sap/ui/mdc/{chartNew/DrillBreadcrumbsNew.js → chart/DrillBreadcrumbs.js} +4 -4
  32. package/src/sap/ui/mdc/chart/DrillStackHandler.js +39 -250
  33. package/src/sap/ui/mdc/chart/Item.js +63 -93
  34. package/src/sap/ui/mdc/{chartNew/PropertyHelperNew.js → chart/PropertyHelper.js} +4 -4
  35. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +18 -22
  36. package/src/sap/ui/mdc/condition/Condition.js +2 -2
  37. package/src/sap/ui/mdc/condition/ConditionConverter.js +2 -2
  38. package/src/sap/ui/mdc/condition/ConditionModel.js +2 -2
  39. package/src/sap/ui/mdc/condition/ConditionModelPropertyBinding.js +1 -1
  40. package/src/sap/ui/mdc/condition/FilterConverter.js +2 -2
  41. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +7 -3
  42. package/src/sap/ui/mdc/condition/Operator.js +10 -10
  43. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +437 -0
  44. package/src/sap/ui/mdc/condition/RangeOperator.js +2 -2
  45. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +1 -1
  46. package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +78 -6
  47. package/src/sap/ui/mdc/designtime/field/Field.designtime.js +97 -0
  48. package/src/sap/ui/mdc/designtime/field/FieldBase.designtime.js +104 -0
  49. package/src/sap/ui/mdc/designtime/field/FilterField.designtime.js +22 -0
  50. package/src/sap/ui/mdc/designtime/field/MultiValueField.designtime.js +23 -0
  51. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +1 -1
  52. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +4 -1
  53. package/src/sap/ui/mdc/designtime/library.designtime.js +1 -1
  54. package/src/sap/ui/mdc/designtime/link/Panel.designtime.js +1 -1
  55. package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +1 -1
  56. package/src/sap/ui/mdc/designtime/p13n/PersistenceProvider.designtime.js +1 -1
  57. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +1 -1
  58. package/src/sap/ui/mdc/enum/ActionToolbarActionAlignment.js +1 -1
  59. package/src/sap/ui/mdc/enum/BaseType.js +1 -1
  60. package/src/sap/ui/mdc/enum/ConditionValidated.js +1 -1
  61. package/src/sap/ui/mdc/enum/ContentMode.js +1 -1
  62. package/src/sap/ui/mdc/enum/EditMode.js +1 -1
  63. package/src/sap/ui/mdc/enum/FieldDisplay.js +1 -1
  64. package/src/sap/ui/mdc/enum/OutParameterMode.js +1 -1
  65. package/src/sap/ui/mdc/enum/PersistenceMode.js +1 -1
  66. package/src/sap/ui/mdc/enum/SelectType.js +1 -1
  67. package/src/sap/ui/mdc/field/BoolFieldHelp.js +2 -2
  68. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +2 -2
  69. package/src/sap/ui/mdc/field/ConditionType.js +8 -8
  70. package/src/sap/ui/mdc/field/ConditionsType.js +8 -8
  71. package/src/sap/ui/mdc/field/CustomFieldHelp.js +2 -2
  72. package/src/sap/ui/mdc/field/CustomFieldInfo.js +2 -2
  73. package/src/sap/ui/mdc/field/DefineConditionPanel.js +59 -22
  74. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +311 -0
  75. package/src/sap/ui/mdc/field/FieldBase.js +84 -53
  76. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +1 -1
  77. package/src/sap/ui/mdc/field/FieldBaseRenderer.js +1 -4
  78. package/src/sap/ui/mdc/field/FieldHelpBase.js +2 -2
  79. package/src/sap/ui/mdc/field/FieldHelpBaseDelegate.js +1 -1
  80. package/src/sap/ui/mdc/field/FieldInfoBase.js +2 -2
  81. package/src/sap/ui/mdc/field/FieldInput.js +2 -2
  82. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +2 -2
  83. package/src/sap/ui/mdc/field/FieldInputRenderer.js +1 -1
  84. package/src/sap/ui/mdc/field/FieldMultiInput.js +2 -2
  85. package/src/sap/ui/mdc/field/FieldMultiInputRenderer.js +1 -1
  86. package/src/sap/ui/mdc/field/FieldValueHelp.js +8 -8
  87. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +2 -2
  88. package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +21 -1
  89. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +2 -2
  90. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +2 -2
  91. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +3 -2
  92. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +2 -2
  93. package/src/sap/ui/mdc/field/InParameter.js +2 -2
  94. package/src/sap/ui/mdc/field/ListFieldHelp.js +11 -3
  95. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +2 -2
  96. package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +1 -1
  97. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +2 -2
  98. package/src/sap/ui/mdc/field/OutParameter.js +2 -2
  99. package/src/sap/ui/mdc/field/ValueHelpPanel.js +3 -2
  100. package/src/sap/ui/mdc/field/content/BooleanContent.js +2 -2
  101. package/src/sap/ui/mdc/field/content/ContentFactory.js +24 -22
  102. package/src/sap/ui/mdc/field/content/DateContent.js +129 -3
  103. package/src/sap/ui/mdc/field/content/DateTimeContent.js +10 -2
  104. package/src/sap/ui/mdc/field/content/DefaultContent.js +2 -2
  105. package/src/sap/ui/mdc/field/content/LinkContent.js +1 -1
  106. package/src/sap/ui/mdc/field/content/SearchContent.js +1 -1
  107. package/src/sap/ui/mdc/field/content/TimeContent.js +9 -2
  108. package/src/sap/ui/mdc/field/content/UnitContent.js +24 -5
  109. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +326 -141
  110. package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +1 -1
  111. package/src/sap/ui/mdc/filterbar/IFilterContainer.js +1 -1
  112. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +2 -2
  113. package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +1 -1
  114. package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +1 -1
  115. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +9 -3
  116. package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +1 -1
  117. package/src/sap/ui/mdc/filterbar/p13n/FilterGroupLayout.js +1 -1
  118. package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +1 -1
  119. package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +1 -1
  120. package/src/sap/ui/mdc/filterbar/vh/CollectiveSearchSelect.js +4 -2
  121. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +8 -2
  122. package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
  123. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +7 -7
  124. package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +1 -1
  125. package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +1 -1
  126. package/src/sap/ui/mdc/flexibility/AggregateFlex.js +3 -3
  127. package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +1 -1
  128. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +2 -2
  129. package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +1 -1
  130. package/src/sap/ui/mdc/flexibility/ColumnFlex.js +2 -2
  131. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +1 -1
  132. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +5 -4
  133. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +2 -2
  134. package/src/sap/ui/mdc/flexibility/GroupFlex.js +2 -2
  135. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +1 -1
  136. package/src/sap/ui/mdc/flexibility/Panel.flexibility.js +10 -4
  137. package/src/sap/ui/mdc/flexibility/PanelItem.flexibility.js +1 -1
  138. package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +110 -0
  139. package/src/sap/ui/mdc/flexibility/SortFlex.js +3 -3
  140. package/src/sap/ui/mdc/flexibility/Table.flexibility.js +1 -1
  141. package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +2 -2
  142. package/src/sap/ui/mdc/library.js +50 -39
  143. package/src/sap/ui/mdc/link/ContactDetails.js +2 -2
  144. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +2 -2
  145. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +2 -2
  146. package/src/sap/ui/mdc/link/ContactDetailsItem.js +2 -2
  147. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +2 -2
  148. package/src/sap/ui/mdc/link/Factory.js +3 -3
  149. package/src/sap/ui/mdc/link/FakeFlpConnector.js +2 -2
  150. package/src/sap/ui/mdc/link/LinkItem.js +2 -2
  151. package/src/sap/ui/mdc/link/Log.js +1 -1
  152. package/src/sap/ui/mdc/link/Panel.js +141 -179
  153. package/src/sap/ui/mdc/link/PanelItem.js +2 -2
  154. package/src/sap/ui/mdc/link/PanelListItem.js +2 -2
  155. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +2 -2
  156. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +2 -2
  157. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +2 -2
  158. package/src/sap/ui/mdc/messagebundle.properties +19 -4
  159. package/src/sap/ui/mdc/messagebundle_ar.properties +13 -4
  160. package/src/sap/ui/mdc/messagebundle_bg.properties +11 -2
  161. package/src/sap/ui/mdc/messagebundle_ca.properties +11 -2
  162. package/src/sap/ui/mdc/messagebundle_cs.properties +26 -17
  163. package/src/sap/ui/mdc/messagebundle_cy.properties +11 -2
  164. package/src/sap/ui/mdc/messagebundle_da.properties +18 -9
  165. package/src/sap/ui/mdc/messagebundle_de.properties +11 -2
  166. package/src/sap/ui/mdc/messagebundle_el.properties +12 -3
  167. package/src/sap/ui/mdc/messagebundle_en.properties +11 -2
  168. package/src/sap/ui/mdc/messagebundle_en_GB.properties +11 -2
  169. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +17 -0
  170. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -19
  171. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +17 -0
  172. package/src/sap/ui/mdc/messagebundle_es.properties +12 -3
  173. package/src/sap/ui/mdc/messagebundle_es_MX.properties +24 -15
  174. package/src/sap/ui/mdc/messagebundle_et.properties +11 -2
  175. package/src/sap/ui/mdc/messagebundle_fi.properties +17 -8
  176. package/src/sap/ui/mdc/messagebundle_fr.properties +15 -6
  177. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +11 -2
  178. package/src/sap/ui/mdc/messagebundle_hi.properties +12 -3
  179. package/src/sap/ui/mdc/messagebundle_hr.properties +11 -2
  180. package/src/sap/ui/mdc/messagebundle_hu.properties +11 -2
  181. package/src/sap/ui/mdc/messagebundle_id.properties +11 -2
  182. package/src/sap/ui/mdc/messagebundle_it.properties +26 -17
  183. package/src/sap/ui/mdc/messagebundle_iw.properties +12 -3
  184. package/src/sap/ui/mdc/messagebundle_ja.properties +11 -2
  185. package/src/sap/ui/mdc/messagebundle_kk.properties +11 -2
  186. package/src/sap/ui/mdc/messagebundle_ko.properties +15 -6
  187. package/src/sap/ui/mdc/messagebundle_lt.properties +11 -2
  188. package/src/sap/ui/mdc/messagebundle_lv.properties +11 -2
  189. package/src/sap/ui/mdc/messagebundle_ms.properties +11 -2
  190. package/src/sap/ui/mdc/messagebundle_nl.properties +16 -7
  191. package/src/sap/ui/mdc/messagebundle_no.properties +19 -10
  192. package/src/sap/ui/mdc/messagebundle_pl.properties +12 -3
  193. package/src/sap/ui/mdc/messagebundle_pt.properties +18 -9
  194. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +11 -2
  195. package/src/sap/ui/mdc/messagebundle_ro.properties +11 -2
  196. package/src/sap/ui/mdc/messagebundle_ru.properties +11 -2
  197. package/src/sap/ui/mdc/messagebundle_sh.properties +11 -2
  198. package/src/sap/ui/mdc/messagebundle_sk.properties +11 -2
  199. package/src/sap/ui/mdc/messagebundle_sl.properties +11 -2
  200. package/src/sap/ui/mdc/messagebundle_sv.properties +13 -4
  201. package/src/sap/ui/mdc/messagebundle_th.properties +11 -2
  202. package/src/sap/ui/mdc/messagebundle_tr.properties +11 -2
  203. package/src/sap/ui/mdc/messagebundle_uk.properties +12 -3
  204. package/src/sap/ui/mdc/messagebundle_vi.properties +11 -2
  205. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +11 -2
  206. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +11 -2
  207. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +3 -4
  208. package/src/sap/ui/mdc/mixin/DelegateMixin.js +3 -3
  209. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +17 -12
  210. package/src/sap/ui/mdc/mixin/PromiseMixin.js +3 -4
  211. package/src/sap/ui/mdc/odata/TypeUtil.js +2 -2
  212. package/src/sap/ui/mdc/odata/json/FilterBarDelegate.js +1 -1
  213. package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +30 -484
  214. package/src/sap/ui/mdc/odata/v4/{ChartPropertyHelperNew.js → ChartPropertyHelper.js} +6 -6
  215. package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +1 -1
  216. package/src/sap/ui/mdc/odata/v4/FieldValueHelpDelegate.js +1 -1
  217. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +1 -1
  218. package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +1 -1
  219. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +158 -114
  220. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -2
  221. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +2 -2
  222. package/src/sap/ui/mdc/odata/v4/util/DelegateUtil.js +2 -2
  223. package/src/sap/ui/mdc/odata/v4/vizChart/{ChartDelegateNew.js → ChartDelegate.js} +137 -49
  224. package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
  225. package/src/sap/ui/mdc/p13n/Engine.js +56 -19
  226. package/src/sap/ui/mdc/p13n/FlexUtil.js +12 -119
  227. package/src/sap/ui/mdc/p13n/P13nBuilder.js +3 -3
  228. package/src/sap/ui/mdc/p13n/PersistenceProvider.js +22 -11
  229. package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
  230. package/src/sap/ui/mdc/p13n/StateUtil.js +41 -7
  231. package/src/sap/ui/mdc/p13n/UIManager.js +16 -13
  232. package/src/sap/ui/mdc/p13n/modification/FlexModificationHandler.js +5 -2
  233. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +10 -7
  234. package/src/sap/ui/mdc/p13n/{DefaultProviderRegistry.js → modules/DefaultProviderRegistry.js} +3 -3
  235. package/src/sap/ui/mdc/p13n/modules/StateHandlerRegistry.js +86 -0
  236. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +1 -1
  237. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +20 -4
  238. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +1 -1
  239. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1093 -49
  240. package/src/sap/ui/mdc/p13n/panels/GroupView.js +1 -1
  241. package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +72 -0
  242. package/src/sap/ui/mdc/p13n/panels/ListView.js +7 -3
  243. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +1 -1
  244. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +1 -1
  245. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +1 -1
  246. package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +7 -6
  247. package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +2 -2
  248. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +157 -12
  249. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +16 -27
  250. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +7 -6
  251. package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +1 -1
  252. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +7 -6
  253. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +1 -1
  254. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +173 -0
  255. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +11 -18
  256. package/src/sap/ui/mdc/table/Column.js +36 -11
  257. package/src/sap/ui/mdc/table/CreationRow.js +15 -14
  258. package/src/sap/ui/mdc/table/GridTableType.js +14 -14
  259. package/src/sap/ui/mdc/table/PropertyHelper.js +65 -28
  260. package/src/sap/ui/mdc/table/ResponsiveTableType.js +27 -30
  261. package/src/sap/ui/mdc/table/RowSettings.js +8 -6
  262. package/src/sap/ui/mdc/table/TableSettings.js +1 -1
  263. package/src/sap/ui/mdc/table/TableTypeBase.js +7 -7
  264. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +16 -72
  265. package/src/sap/ui/mdc/themes/base/Chart.less +3 -0
  266. package/src/sap/ui/mdc/themes/base/FieldBase.less +0 -5
  267. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +12 -1
  268. package/src/sap/ui/mdc/themes/base/library.source.less +2 -1
  269. package/src/sap/ui/mdc/ui/Container.js +3 -3
  270. package/src/sap/ui/mdc/ui/ContainerItem.js +3 -3
  271. package/src/sap/ui/mdc/util/Common.js +2 -2
  272. package/src/sap/ui/mdc/util/DateUtil.js +2 -2
  273. package/src/sap/ui/mdc/util/FilterUtil.js +2 -2
  274. package/src/sap/ui/mdc/util/FormatUtil.js +2 -2
  275. package/src/sap/ui/mdc/util/IdentifierUtil.js +2 -2
  276. package/src/sap/ui/mdc/util/PromiseCache.js +2 -2
  277. package/src/sap/ui/mdc/util/PropertyHelper.js +149 -326
  278. package/src/sap/ui/mdc/util/TypeUtil.js +6 -5
  279. package/src/sap/ui/mdc/util/loadModules.js +1 -1
  280. package/src/sap/ui/mdc/valuehelp/Dialog.js +13 -9
  281. package/src/sap/ui/mdc/valuehelp/Popover.js +15 -3
  282. package/src/sap/ui/mdc/valuehelp/base/Container.js +34 -2
  283. package/src/sap/ui/mdc/valuehelp/base/Content.js +37 -6
  284. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +3 -2
  285. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +44 -16
  286. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +3 -2
  287. package/src/sap/ui/mdc/valuehelp/content/Bool.js +3 -2
  288. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +29 -33
  289. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +12 -6
  290. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +44 -9
  291. package/src/sap/ui/mdc/valuehelp/content/MTable.js +58 -27
  292. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -1
  293. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +3 -3
  294. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ActionsBase.js +3 -3
  295. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ActionsViz.js +0 -0
  296. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/AssertionsBase.js +1 -1
  297. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/AssertionsViz.js +0 -0
  298. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ChartNew.js +0 -0
  299. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +289 -0
  300. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +5 -5
  301. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +12 -11
  302. package/test/sap/ui/mdc/testutils/opa/link/Actions.js +85 -0
  303. package/test/sap/ui/mdc/testutils/opa/link/Assertions.js +79 -0
  304. package/test/sap/ui/mdc/testutils/opa/link/TestObjects.js +112 -0
  305. package/test/sap/ui/mdc/testutils/opa/link/waitForLink.js +50 -0
  306. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +365 -236
  307. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +27 -26
  308. package/src/sap/ui/mdc/ChartDelegateNew.js +0 -395
  309. package/src/sap/ui/mdc/ChartNew.js +0 -1114
  310. package/src/sap/ui/mdc/ChartNewRenderer.js +0 -91
  311. package/src/sap/ui/mdc/chart/DimensionItem.js +0 -281
  312. package/src/sap/ui/mdc/chart/MeasureItem.js +0 -318
  313. package/src/sap/ui/mdc/chart/MetadataDelegate.js +0 -31
  314. package/src/sap/ui/mdc/chart/SelectionHandler.js +0 -127
  315. package/src/sap/ui/mdc/chart/ToolbarHandler.js +0 -328
  316. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +0 -295
  317. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +0 -212
  318. package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -72
  319. package/src/sap/ui/mdc/chartNew/SelectionDetailsActionsNew.js +0 -34
  320. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +0 -91
  321. package/src/sap/ui/mdc/link/SelectionDialog.control.xml +0 -66
  322. package/src/sap/ui/mdc/link/SelectionDialog.js +0 -213
  323. package/src/sap/ui/mdc/link/SelectionDialogItem.js +0 -86
  324. package/src/sap/ui/mdc/odata/v4/ChartDelegateNew.js +0 -35
  325. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +0 -1171
  326. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +0 -111
  327. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +0 -322
  328. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +0 -133
  329. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +0 -203
@@ -1,13 +1,37 @@
1
1
  /*
2
2
  * ! OpenUI5
3
- * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- "./BasePanel", "sap/m/Label", "sap/m/ColumnListItem", "sap/m/Select", "sap/m/Text", "sap/ui/core/Item", "sap/ui/mdc/library"
8
- ], function (BasePanel, Label, ColumnListItem, Select, Text, Item, MDCLib) {
7
+ "sap/m/p13n/BasePanel",
8
+ "sap/m/Label",
9
+ "sap/m/ColumnListItem",
10
+ "sap/m/Select",
11
+ "sap/m/Text",
12
+ "sap/ui/core/Item",
13
+ "sap/ui/mdc/library",
14
+ "sap/m/Button",
15
+ 'sap/m/Column',
16
+ "sap/m/Table",
17
+ "sap/ui/model/Filter",
18
+ "sap/ui/model/FilterOperator",
19
+ "sap/m/VBox",
20
+ "sap/m/HBox",
21
+ "sap/m/ComboBox",
22
+ "sap/ui/model/Sorter",
23
+ "sap/base/Log",
24
+ "sap/m/library",
25
+ "sap/ui/Device",
26
+ "sap/ui/core/ResizeHandler",
27
+ "sap/ui/core/CustomData"
28
+ ], function (BasePanel, Label, ColumnListItem, Select, Text, Item, MDCLib, Button, Column, Table, Filter, FilterOperator, VBox, HBox, ComboBox, Sorter, Log, mLibrary, Device, ResizeHandler, CustomData) {
9
29
  "use strict";
10
30
 
31
+ // shortcut for sap.m.FlexJustifyContent
32
+ var FlexJustifyContent = mLibrary.FlexJustifyContent;
33
+ var core = sap.ui.getCore();
34
+
11
35
  /**
12
36
  * Constructor for ChartItemPanel
13
37
  *
@@ -18,75 +42,788 @@ sap.ui.define([
18
42
  * The control is experimental and the API/behaviour is not finalised and hence this should not be used for productive usage.
19
43
  * @extends sap.ui.mdc.p13n.panels.BasePanel
20
44
  * @author SAP SE
45
+ * @constructor The API/behaviour is not finalised and hence this control should not be used for productive usage.
21
46
  * @private
22
47
  * @experimental
23
- * @since 1.66
48
+ * @since 1.97
24
49
  * @alias sap.ui.mdc.p13n.panels.ChartItemPanel
25
50
  * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
26
51
  */
27
52
  var ChartItemPanel = BasePanel.extend("sap.ui.mdc.p13n.panels.ChartItemPanel", {
28
53
  metadata: {
29
- library: "sap.ui.mdc"
54
+ library: "sap.ui.mdc",
55
+ properties: {
56
+ /*This provides the panel the necessary information to build the UI for MDC/Comp.
57
+ * The object contains the following information:
58
+ * {
59
+ * allowedLayoutOptions : [] -> an array of strings with the allowed layout options for the current chart type, e.g. "axis1", "axis2", "category", "series", ...
60
+ templateConfig : [ -> array containing information how the templating rows should look like
61
+ {kind: "Groupable"}, -> object containing information for which tyoe should be a termplate row created (may contain additional config in the future e.g. only one measure allwoed)
62
+ {kind: "Aggregatable"}
63
+ ]
64
+ * }
65
+ */
66
+ panelConfig: {
67
+ type: "object"
68
+ }
69
+ },
70
+ events: {
71
+ // TODO
72
+ /**
73
+ * Event raised when one or more <code>DimMeasureItems</code> has been updated.
74
+ * Aggregation <code>DimMeasureItems</code> should be updated outside...
75
+ * @since 1.50.0
76
+ */
77
+ changeItems: {}
78
+ }
30
79
  },
31
80
  init: function () {
81
+
82
+ this._bMobileMode = Device.system.phone;
83
+
32
84
  // Initialize the BasePanel
33
85
  BasePanel.prototype.init.apply(this, arguments);
34
- var oChartItemPanelTemplate = new ColumnListItem({
35
- selected: "{" + this.P13N_MODEL + ">visible}",
36
- cells: [
37
- new Label({
38
- wrapping: true,
39
- text: "{" + this.P13N_MODEL + ">label}",
40
- tooltip: "{" + this.P13N_MODEL + ">tooltip}"
41
- }),
42
- new Text({
43
- wrapping: true,
44
- text: "{" + this.P13N_MODEL + ">kind}"
45
- }),
46
- new Select({
47
- width: "100%",
48
- selectedKey: "{" + this.P13N_MODEL + ">role}",
49
- change: [this.onChangeOfRole, this],
50
- forceSelection: false,
51
- enabled: {
52
- path: this.P13N_MODEL + ">visible",
53
- formatter: function(bEnabled) {
54
- return !!bEnabled;
55
- }
56
- },
57
- items: {
58
- path: this.P13N_MODEL + ">availableRoles",
59
- templateShareable: false,
60
- template: new Item({
61
- key: "{" + this.P13N_MODEL + ">key}",
62
- text: "{" + this.P13N_MODEL + ">text}"
63
- })
64
- }
65
- })
66
- ]
67
- });
68
86
 
69
- this.setTemplate(oChartItemPanelTemplate);
70
- this.setPanelColumns([
71
- this.getResourceText("chart.PERSONALIZATION_DIALOG_COLUMN_DESCRIPTION"), this.getResourceText("chart.PERSONALIZATION_DIALOG_COLUMN_TYPE"), this.getResourceText("chart.PERSONALIZATION_DIALOG_COLUMN_ROLE")
72
- ]);
87
+ this._bindListItems();
88
+
73
89
  },
74
90
  renderer: {}
75
91
  });
76
92
 
77
- ChartItemPanel.prototype.setP13nModel = function(oP13nModel){
78
- BasePanel.prototype.setP13nModel.apply(this, arguments);
93
+ ChartItemPanel.prototype._setInnerLayout = function() {
94
+
95
+ this._oInnerControl = new VBox({
96
+ items: [
97
+ this._oListControl
98
+ ]
99
+ });
100
+
101
+ this.setAggregation("_content", this._oInnerControl);
102
+
103
+ this._fnHandleResize = function() {
104
+ //var bChangeResult = false, iScrollContainerHeightOld, iScrollContainerHeightNew;
105
+ if (this.getParent) {
106
+ var $dialogCont = null;
107
+ var oParent = this.getParent();
108
+ if (oParent && oParent.$) {
109
+ $dialogCont = oParent.$("cont");
110
+ if ($dialogCont.children().length > 0) {
111
+ var iScrollContainerWidth = this._oInnerControl.$()[0].clientWidth;
112
+ var iMinWidth = 570;
113
+
114
+ if (!this._bMobileMode && iScrollContainerWidth <= iMinWidth) {
115
+ this._switchMobileMode(true);
116
+ } else if (this._bMobileMode && iScrollContainerWidth > iMinWidth) {
117
+ this._switchMobileMode(false);
118
+ }
119
+
120
+ }
121
+ }
122
+ }
123
+ //return bChangeResult;
124
+ };
125
+
126
+
127
+ if (Device.system.desktop) {
128
+ this._sContainerResizeListener = ResizeHandler.register(this._oInnerControl , this._fnHandleResize.bind(this));
129
+ }
130
+
131
+ };
132
+
133
+ ChartItemPanel.prototype._switchMobileMode = function(bMobile) {
134
+
135
+ if (this._bMobileMode == bMobile) {
136
+ return;
137
+ }
138
+
139
+ this._bMobileMode = bMobile;
140
+
141
+ if (this._sContainerResizeListener) {
142
+ ResizeHandler.deregister(this._sContainerResizeListener);
143
+ this._sContainerResizeListener = null;
144
+ }
145
+
146
+ this._oListControl.destroy();
147
+ this._oDragDropInfo = null;
148
+
149
+ // list is necessary to set the template + model on
150
+ this._oListControl = this._createInnerListControl();
151
+
152
+ // disable 'select all'
153
+ this._oListControl.setMultiSelectMode("ClearAll");
154
+
155
+ this._setInnerLayout();
156
+ this._bindListItems();
157
+
158
+ };
159
+
160
+ ChartItemPanel.prototype._createInnerListControl = function() {
161
+
162
+ var sId = this._bMobileMode ? this.getId() + "-innerP13nListMobile" : this.getId() + "-innerP13nList";
163
+
164
+ var oTable = new Table(sId, Object.assign(this._getListControlConfig(), {}));
165
+ this.setEnableReorder(true); //We always want reordering to be active in this panel
166
+
167
+ oTable.addEventDelegate({
168
+ onAfterRendering: this._checkFocusAfterTableRerender.bind(this)
169
+ });
170
+
171
+ return oTable;
172
+ };
173
+
174
+ ChartItemPanel.prototype._checkFocusAfterTableRerender = function(){
175
+
176
+ if (this._oFocusInfo && this._oFocusInfo.tableItem){
177
+ //Focus table item directly
178
+ this._oFocusInfo.tableItem.focus();
179
+ }
180
+
181
+ //Reset focus info
182
+ this._oFocusInfo = null;
183
+ };
184
+
185
+ ChartItemPanel.prototype._bindListItems = function(mBindingInfo) {
186
+ var oSorter;
187
+ var MDCRb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
188
+
189
+ if ( this.getPanelConfig() && this.getPanelConfig().sorter) {
190
+ oSorter = this.getPanelConfig().sorter;
191
+ } else {
192
+
193
+ var oMeasuresGroup = { text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_MEASURE_GROUP_HEADER')};
194
+ var oDimensionsGroup = { text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_DIMENSION_GROUP_HEADER')};
195
+
196
+ var mGroupInfo = {
197
+ "Aggregatable": oMeasuresGroup,
198
+ "Groupable" : oDimensionsGroup,
199
+ "Measure": oMeasuresGroup,
200
+ "Dimension" : oDimensionsGroup
201
+ };
202
+
203
+ var fGrouper = function(oContext) {
204
+ var group = oContext.getProperty("kind");
205
+ return { key: group, text: mGroupInfo[group].text };
206
+ };
207
+
208
+ var fSorter = function(a,b) {
209
+ if (a === b) {
210
+ return 0;
211
+ }
212
+
213
+ if (a === "MEASURE" || a === "AGGREGATABLE"){
214
+ return 1;
215
+ }
216
+
217
+ return -1;
218
+ };
219
+
220
+ oSorter = new Sorter("kind", false, fGrouper, fSorter);
221
+ }
222
+
223
+
224
+ var oFactoryFunction;
225
+ this._mTemplatesMap = new Map();
226
+ if (this._bMobileMode) {
227
+ oFactoryFunction = this._createListItemMobile;
228
+ } else {
229
+ oFactoryFunction = this._createListItem;
230
+ }
231
+
232
+ this._oListControl.bindItems(Object.assign({
233
+ path: this.P13N_MODEL + ">/items",
234
+ key: "name", //TODO: Bind with combined key (name + kind)?
235
+ filters: [new Filter({
236
+ filters: [
237
+ new Filter("visible", FilterOperator.EQ, true),
238
+ new Filter("template", FilterOperator.EQ, true)
239
+ ],
240
+ and: false
241
+ })],
242
+ factory: oFactoryFunction.bind(this),
243
+ sorter : oSorter
244
+ }, mBindingInfo));
245
+ };
246
+
247
+ ChartItemPanel.prototype._getTemplateComboBox = function(sKind){
248
+ var oVisibleFilter = new Filter("visible", FilterOperator.EQ, false);
249
+
250
+ var oComboBox = new ComboBox({
251
+ id: "p13nPanel-templateComboBox-" + sKind,
252
+ width: "100%",
253
+ placeholder: this._getPlaceholderTextForTemplate(sKind),
254
+ items: {
255
+ path: this.P13N_MODEL + ">/items",
256
+ template: new Item({
257
+ key: "{" + this.P13N_MODEL + ">name}",
258
+ text: "{" + this.P13N_MODEL + ">label}"
259
+ }),
260
+ templateShareable : false,
261
+ filters: [oVisibleFilter, new Filter("kind", FilterOperator.EQ, sKind)]
262
+ },
263
+ change: [this.onChangeOfTemplateName, this]
264
+ });
265
+
266
+ this._mTemplatesMap.set(sKind, oComboBox);
267
+
268
+ return oComboBox;
269
+ };
270
+
271
+ ChartItemPanel.prototype._getPlaceholderTextForTemplate = function(sKind) {
272
+ var MDCRb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
273
+ return MDCRb.getText('chart.PERSONALIZATION_DIALOG_TEMPLATE_PLACEHOLDER');
274
+ };
275
+
276
+ ChartItemPanel.prototype._getRoleSelect = function() {
277
+ return new Select({
278
+ width: "100%",
279
+ selectedKey: "{" + this.P13N_MODEL + ">role}",
280
+ change: [this.onChangeOfRole, this],
281
+ forceSelection: false,
282
+ items: {
283
+ path: this.P13N_MODEL + ">availableRoles",
284
+ templateShareable: false,
285
+ template: new Item({
286
+ key: "{" + this.P13N_MODEL + ">key}",
287
+ text: "{" + this.P13N_MODEL + ">text}"
288
+ })
289
+ },
290
+ visible: {
291
+ path: this.P13N_MODEL + ">availableRoles",
292
+ formatter: function(aRoles) {
293
+
294
+ if (!aRoles) {
295
+ return false;
296
+ }
297
+
298
+ return aRoles.length > 1;
299
+ }
300
+ }
301
+ });
302
+ };
303
+
304
+ ChartItemPanel.prototype._getNameComboBox = function(sKind, sName) {
305
+ var oNameFilterPersistent = new Filter({
306
+ filters: [
307
+ new Filter("visible", FilterOperator.EQ, false),
308
+ new Filter("name", FilterOperator.EQ, sName)
309
+ ],
310
+ and: false
311
+ });
312
+
313
+ return new ComboBox({
314
+ width: "100%",
315
+ items: {
316
+ path: this.P13N_MODEL + ">/items",
317
+ template: new Item({
318
+ key: "{" + this.P13N_MODEL + ">name}",
319
+ text: "{" + this.P13N_MODEL + ">label}"
320
+ }),
321
+ templateShareable : false,
322
+ filters: [oNameFilterPersistent, new Filter("kind", FilterOperator.EQ, sKind)]
323
+ },
324
+ change: [this.onChangeOfItemName, this],
325
+ selectedKey: "{" + this.P13N_MODEL + ">tempName}",
326
+ customData: [new CustomData({key: "prevName", value: sName}),
327
+ new CustomData({key: "prevKind", value: sKind})]
328
+ });
329
+ };
330
+
331
+ ChartItemPanel.prototype._createListItem = function(sId, oObject){
332
+
333
+ var sRemoveBtnId, aCells = [];
334
+
335
+
336
+ if (oObject.getObject() && oObject.getObject().template){
337
+ aCells.push(this._getTemplateComboBox(oObject.getObject().kind));
338
+ } else {
339
+ aCells.push(this._getNameComboBox(oObject.getObject().kind, oObject.getObject().name));
340
+ aCells.push(this._getRoleSelect());
341
+ sRemoveBtnId = oObject.getObject().kind + "-RemoveBtn-" + oObject.getObject().name;
342
+
343
+ aCells.push(new HBox({
344
+ justifyContent: FlexJustifyContent.End,
345
+ items: [
346
+ new Button({
347
+ id: sRemoveBtnId,
348
+ press: [this._onPressHide, this],
349
+ type: "Transparent",
350
+ icon: "sap-icon://decline",
351
+ tooltip: this._getResourceTextMDC("chart.PERSONALIZATION_DIALOG_REMOVE_ENTRY"),
352
+ customData: [new CustomData({key: "propertyName", value: "{" + this.P13N_MODEL + ">name}"}),
353
+ new CustomData({key: "propertyKind", value: "{" + this.P13N_MODEL + ">kind}"})]
354
+ })
355
+ ]}));
356
+ }
357
+
358
+ var oListItem;
359
+ if (oObject.getObject() && oObject.getObject().template) {
360
+ var sKind = oObject.getObject().kind;
361
+ oListItem = new ColumnListItem({
362
+ cells: aCells,
363
+ visible: {
364
+ path: this.P13N_MODEL + ">/items",
365
+ formatter: function(aItems){
366
+ aItems = aItems.filter(function(oItem){return oItem.visible === false && oItem.template === false && oItem.kind === sKind;});
367
+ return aItems.length != 0;
368
+ }
369
+ }
370
+ });
371
+ } else {
372
+ oListItem = new ColumnListItem({
373
+ cells: aCells
374
+ });
375
+ }
376
+
377
+ oListItem.addEventDelegate({
378
+ onmouseover: this._hoverHandler.bind(this),
379
+ onfocusin: this._focusHandler.bind(this),
380
+ onkeydown: this._handleOnKeyDown.bind(this)
381
+ });
382
+
383
+ return oListItem;
384
+ };
385
+
386
+ ChartItemPanel.prototype._createListItemMobile = function(sId, oObject){
387
+
388
+ var sRemoveBtnId, aCells = [];
389
+
390
+ if (oObject.getObject() && oObject.getObject().template){
391
+ aCells.push(this._getTemplateComboBox(oObject.getObject().kind));
392
+ } else {
393
+
394
+ var oVBox = new VBox({
395
+ items: [
396
+ this._getNameComboBox(oObject.getObject().kind, oObject.getObject().name),
397
+ this._getRoleSelect()
398
+ ]
399
+ });
400
+
401
+ sRemoveBtnId = oObject.getObject().kind + "-RemoveBtn-" + oObject.getObject().name;
402
+ aCells.push(oVBox);
403
+
404
+ }
405
+
406
+ var oRemoveColumn = new HBox({
407
+ justifyContent: FlexJustifyContent.End,
408
+ items: [new Button({
409
+ id: sRemoveBtnId,
410
+ press: [this._onPressHide, this],
411
+ type: "Transparent", icon: "sap-icon://decline",
412
+ visible: {
413
+ path: this.P13N_MODEL + ">template",
414
+ formatter: function(bEnabled) {
415
+ return !bEnabled;
416
+ }
417
+ },
418
+ customData: [new CustomData({key: "propertyName", value: "{" + this.P13N_MODEL + ">name}"}),
419
+ new CustomData({key: "propertyKind", value: "{" + this.P13N_MODEL + ">kind}"})]
420
+ })]});
421
+
422
+ aCells.push(oRemoveColumn);
423
+
424
+
425
+ var oListItem;
426
+ if (oObject.getObject() && oObject.getObject().template) {
427
+ var sKind = oObject.getObject().kind;
428
+ oListItem = new ColumnListItem({
429
+ cells: aCells,
430
+ visible: {
431
+ path: this.P13N_MODEL + ">/items",
432
+ formatter: function(aItems){
433
+ aItems = aItems.filter(function(oItem){return oItem.visible === false && oItem.template === false && oItem.kind === sKind;});
434
+ return aItems.length != 0;
435
+ }
436
+ }
437
+ });
438
+ } else {
439
+ oListItem = new ColumnListItem({
440
+ cells: aCells
441
+ });
442
+ }
443
+
444
+ oListItem.addEventDelegate({
445
+ onmouseover: this._hoverHandler.bind(this),
446
+ onfocusin: this._focusHandler.bind(this),
447
+ onkeydown: this._handleOnKeyDown.bind(this)
448
+ });
449
+
450
+ return oListItem;
451
+ };
452
+
453
+ //ACC realted stuff
454
+ ChartItemPanel.prototype._handleOnKeyDown = function(oEvent){
455
+ if (oEvent.keyCode === 38 && oEvent.ctrlKey){
456
+ //Ctrl+Arrow Up
457
+ //Move Up
458
+ //Disabled for now until further clarification
459
+ /*
460
+ if (this._oMoveUpButton && this._oMoveUpButton.getEnabled() && this._getMoveButtonContainer()){
461
+ this._onPressButtonMoveUp(oEvent, core.byId(oEvent.currentTarget.id));
462
+ }*/
463
+ } else if (oEvent.keyCode === 40 && oEvent.ctrlKey){
464
+ //Ctrl+Arrow Down
465
+ //Move Down
466
+ //Disabled for now until further clarification
467
+ /*
468
+ if (this._oMoveUpButton && this._oMoveDownButton.getEnabled() && this._getMoveButtonContainer()){
469
+ this._onPressButtonMoveDown(oEvent, core.byId(oEvent.currentTarget.id));
470
+ }*/
471
+ } else if (oEvent.keyCode === 68 && oEvent.ctrlKey){
472
+ //Ctrl+D
473
+ //Remove
474
+ var oRemoveBtn, oListItem = core.byId(oEvent.currentTarget.id);
475
+
476
+ if (this._bMobileMode) {
477
+ oRemoveBtn = oListItem.getCells()[1].getItems()[oListItem.getCells()[1].getItems().length - 1];
478
+ } else {
479
+ oRemoveBtn = oListItem.getCells()[2].getItems()[oListItem.getCells()[2].getItems().length - 1];
480
+ }
481
+
482
+ if (oRemoveBtn){
483
+ this._onPressHide(oEvent, oRemoveBtn);
484
+ oEvent.preventDefault();
485
+ }
486
+
487
+ }
488
+
489
+ };
490
+
491
+ ChartItemPanel.prototype._focusHandler = function(oEvt) {
492
+
493
+ var oTarget = core.byId(oEvt.target.id);
494
+
495
+ //Don't handle focus on button presses as this messes up event propagation
496
+ if (oTarget instanceof Button){
497
+ return;
498
+ }
499
+
500
+ BasePanel.prototype._focusHandler.apply(this, arguments);
501
+ };
502
+
503
+ ChartItemPanel.prototype._handleActivated = function(oHoveredItem) {
504
+ var oItem = this._getModelItemByTableItem(oHoveredItem);
505
+ if (oItem && oItem.template) {
506
+ this.removeMoveButtons();
507
+ }
508
+
509
+ this._oHoveredItem = oHoveredItem;
510
+ this._updateEnableOfMoveButtons(oHoveredItem, false);
511
+ this._addMoveButtons(oHoveredItem);
512
+ this._setMoveButtonVisibility(true);
513
+
514
+ };
515
+
516
+ ChartItemPanel.prototype.onChangeOfItemName = function(oEvent) {
517
+ var sPrevName = oEvent.getSource().data().prevName;
518
+ var sKind = oEvent.getSource().data().prevKind; //Can only select fields within same kind
519
+ var sNewName = oEvent.getSource().getSelectedKey();
520
+
521
+ var oPrevItem = this._getP13nModel().getProperty("/items").find(function(it){ return it.name === sPrevName && it.kind === sKind;});
522
+ var oNewItem = this._getP13nModel().getProperty("/items").find(function(it){ return it.name === sNewName && it.kind === sKind;});
523
+
524
+ this.removeMoveButtons();
525
+
526
+ if (oPrevItem && oNewItem) {
527
+
528
+ oPrevItem.visible = false;
529
+ oNewItem.visible = true;
530
+
531
+ oPrevItem.tempName = oPrevItem.name;
532
+
533
+ oNewItem.role = oPrevItem.role;
534
+ this._moveItemsByIndex(this._getItemIndex(oNewItem), this._getItemIndex(oPrevItem));
535
+
536
+ this._getP13nModel().refresh(true);
537
+
538
+ this._fireChangeItems();
539
+ }
540
+
541
+ };
542
+
543
+ ChartItemPanel.prototype._getItemIndexByNameAndKind = function(sName, sKind) {
544
+ var aFields = this._getP13nModel().getProperty("/items");
545
+ var oField = aFields.find(function(it){return (it.name === sName && it.kind === sKind && !it.template);});
546
+
547
+ return this._getItemIndex(oField);
548
+ };
549
+
550
+ ChartItemPanel.prototype._getItemIndex = function(oItem) {
551
+ return this._getP13nModel().getProperty("/items").indexOf(oItem);
552
+ };
553
+
554
+ ChartItemPanel.prototype.removeMoveButtons = function() {
555
+ var oMoveButtonBox = this._getMoveButtonContainer();
556
+
557
+ if (oMoveButtonBox){
558
+ oMoveButtonBox.removeItem(this._getMoveBottomButton());
559
+ oMoveButtonBox.removeItem(this._getMoveDownButton());
560
+ oMoveButtonBox.removeItem(this._getMoveUpButton());
561
+ oMoveButtonBox.removeItem(this._getMoveTopButton());
562
+ }
563
+
564
+ };
565
+
566
+ //Called on exit of panel; resets templates
567
+ ChartItemPanel.prototype.getP13nData = function() {
568
+
569
+ var aItems = this._getCleanP13nItems();
570
+
571
+ this._getP13nModel().setProperty("/items", aItems);
572
+
573
+ return aItems;
574
+ };
575
+
576
+ ChartItemPanel.prototype._getMoveButtonContainer = function() {
577
+ if (this._oMoveUpButton &&
578
+ this._oMoveUpButton.getParent() &&
579
+ this._oMoveUpButton.getParent().isA("sap.m.FlexBox")
580
+ ){
581
+ return this._oMoveUpButton.getParent();
582
+ }
583
+
584
+ return undefined;
585
+ };
586
+
587
+ ChartItemPanel.prototype._addMoveButtons = function(oItem) {
588
+ var oTableItem = oItem;
589
+ if (!oTableItem){
590
+ return;
591
+ }
592
+
593
+ var bIgnore = this._getP13nModel().getProperty(oTableItem.getBindingContextPath()) ? this._getP13nModel().getProperty(oTableItem.getBindingContextPath()).template : true;
594
+
595
+ if (!bIgnore){
596
+ if (this._bMobileMode){
597
+ oTableItem.getCells()[1].insertItem(this._getMoveDownButton(), 0);
598
+ oTableItem.getCells()[1].insertItem(this._getMoveUpButton(), 0);
599
+ } else {
600
+ oTableItem.getCells()[2].insertItem(this._getMoveBottomButton(), 0);
601
+ oTableItem.getCells()[2].insertItem(this._getMoveDownButton(), 0);
602
+ oTableItem.getCells()[2].insertItem(this._getMoveUpButton(), 0);
603
+ oTableItem.getCells()[2].insertItem(this._getMoveTopButton(), 0);
604
+ }
605
+
606
+ }
607
+ };
608
+
609
+ ChartItemPanel.prototype._moveSelectedItem = function(){
610
+ this._oSelectedItem = this._getMoveButtonContainer().getParent();
611
+
612
+ BasePanel.prototype._moveSelectedItem.apply(this, arguments);
613
+ };
614
+
615
+
616
+ ChartItemPanel.prototype._updateAvailableRolesForItems = function() {
617
+ var aItems = this._getP13nModel().getProperty("/items");
618
+ var aAllowedRoles = [];
619
+ if (this.getPanelConfig() && this.getPanelConfig().allowedLayoutOptions) {
620
+ aAllowedRoles = this.getPanelConfig().allowedLayoutOptions;
621
+ } else {
622
+ Log.warning("No allowedLayoutOptions configured for chart type. This will not show any p13n options!");
623
+ }
624
+
625
+
626
+ aItems.forEach(function(oItem){
627
+
628
+ if (!oItem.availableRoles) {
629
+ return;
630
+ }
631
+
632
+ oItem.availableRoles = oItem.availableRoles.filter(function(it){return aAllowedRoles.indexOf(it.key) != -1;});
633
+ });
634
+
635
+ this._getP13nModel().setProperty("/items", aItems);
636
+ this._getP13nModel().refresh(true);
637
+ };
638
+
639
+ ChartItemPanel.prototype._onPressHide = function(oEvent, oRemoveBtn) {
640
+
641
+ var sPropertyName;
642
+ if (oRemoveBtn) {
643
+ sPropertyName = oRemoveBtn.data().propertyName;
644
+ } else {
645
+ sPropertyName = oEvent.getSource().data().propertyName;
646
+ }
647
+
648
+ var aItems = jQuery.extend([], this._getP13nModel().getProperty("/items"), true);
649
+
650
+ aItems.filter(function(it){return it.name === sPropertyName;}).forEach(function(oItem){
651
+ oItem.visible = false;
652
+ //Used to set focus on template row after re-render of table
653
+ if (this._mTemplatesMap.has(oItem.kind) && this._mTemplatesMap.get(oItem.kind).getVisible()){
654
+ this._mTemplatesMap.get(oItem.kind).focus();
655
+ }
656
+ }.bind(this));
657
+
658
+ this._getP13nModel().setProperty("/items", aItems);
659
+ this._getP13nModel().refresh(true);
660
+ this._fireChangeItems();
661
+ this._updateVisibleIndexes();
662
+ };
663
+
664
+ ChartItemPanel.prototype.setP13nData = function(aP13nData){
665
+
666
+ //Clear previous templates (if any)
667
+ aP13nData = aP13nData.filter(function(it){return !it.template;});
668
+
669
+ BasePanel.prototype.setP13nData.apply(this, arguments);
79
670
 
80
671
  var aItems = [];
672
+ var aAddableItems = [];
81
673
 
82
- this.getP13nModel().getProperty("/items").forEach(function(oItem){
674
+ this.getP13nData().forEach(function(oItem, iIndex){
83
675
  if (!oItem.availableRoles) {
84
676
  oItem.availableRoles = this._getChartItemTextByKey(oItem.kind);
85
677
  }
678
+
679
+ if (this.getPanelConfig() && this.getPanelConfig().allowedLayoutOptions) {
680
+ var aAllowedRoles = this.getPanelConfig().allowedLayoutOptions;
681
+
682
+ if (aAllowedRoles && aAllowedRoles.length >= 1) {
683
+ oItem.availableRoles = oItem.availableRoles.filter(function(it){return aAllowedRoles.indexOf(it.key) != -1;});
684
+
685
+ //Reset if an invalid role is selected
686
+ if (aAllowedRoles.indexOf(oItem.role) === -1) {
687
+ oItem.role = aAllowedRoles[0];
688
+ }
689
+ }
690
+ }
691
+
692
+ oItem.template = false;
693
+ //Used for comboboxes renaming
694
+ oItem.tempName = oItem.name;
695
+
696
+ if (!oItem.visible){
697
+ aAddableItems.push(oItem);
698
+ }
699
+
700
+ if (!oItem.index) {
701
+ oItem.index = iIndex;
702
+ }
703
+
86
704
  aItems.push(oItem);
87
705
  }.bind(this));
88
706
 
89
- this.getP13nModel().setProperty("/items", aItems);
707
+ aItems = aItems.concat(this._getTemplateItems());
708
+
709
+ this._getP13nModel().setProperty("/items", aItems);
710
+ this._updateVisibleIndexes();
711
+ };
712
+
713
+ ChartItemPanel.prototype._updateVisibleIndexes = function() {
714
+ this._mVisibleIndexes = new Map();
715
+
716
+ this._getP13nModel().getProperty("/items").forEach(function(oItem, _iIndex){
717
+
718
+ if (oItem.template || !oItem.visible) {
719
+ return;
720
+ }
721
+
722
+ if (this._mVisibleIndexes.has(oItem.kind)){
723
+ this._mVisibleIndexes.get(oItem.kind).push(_iIndex);
724
+ } else {
725
+ var aIndexes = [_iIndex];
726
+ this._mVisibleIndexes.set(oItem.kind, aIndexes);
727
+ }
728
+ }.bind(this));
729
+
730
+ };
731
+
732
+ ChartItemPanel.prototype.onChangeOfTemplateName = function(oEvent){
733
+
734
+ var sSelectedName = oEvent.getSource().getSelectedKey();
735
+
736
+ var oSelectedItem = this._getCleanP13nItems().find(function(it){ return it.name === sSelectedName;});
737
+
738
+ if (oSelectedItem){
739
+ oSelectedItem.visible = true;
740
+
741
+ oEvent.getSource().setSelectedKey(undefined);
742
+ this._getP13nModel().refresh(true);
743
+
744
+ var aIndexes = this._mVisibleIndexes.has(oSelectedItem.kind) ? this._mVisibleIndexes.get(oSelectedItem.kind) : [];
745
+ var iOldIndex = this._getItemIndexByNameAndKind(oSelectedItem.name, oSelectedItem.kind);
746
+ var iNewIndex = aIndexes[aIndexes.length - 1];
747
+
748
+ if (iOldIndex > iNewIndex) {
749
+ iNewIndex += 1;
750
+ }
751
+
752
+ if (iNewIndex && iOldIndex != iNewIndex) {
753
+ this._moveItemsByIndex(iOldIndex, iNewIndex, true);
754
+ } else {
755
+ this._fireChangeItems(); //Otherwise already fired by _moveItemsByIndex
756
+ }
757
+
758
+
759
+ this._updateVisibleIndexes();
760
+ } else {
761
+ oEvent.getSource().setSelectedKey(undefined);
762
+ }
763
+
764
+ };
765
+
766
+ ChartItemPanel.prototype._getTemplateItems = function() {
767
+ var aItems = [];
768
+
769
+ if (!this.getPanelConfig() || !this.getPanelConfig().templateConfig){
770
+ return [];
771
+ }
772
+
773
+ this.getPanelConfig().templateConfig.forEach(function(oTemplateConfig){
774
+ var oItem = {template: true, kind: oTemplateConfig.kind};
775
+
776
+ aItems.push(oItem);
777
+ });
778
+
779
+ return aItems;
780
+ };
781
+
782
+ ChartItemPanel.prototype._getListControlConfig = function(){
783
+ var oConfig = BasePanel.prototype._getListControlConfig.apply(this, arguments);
784
+
785
+ if (this._bMobileMode){
786
+ oConfig.columns = [new Column({
787
+ header: new Text({
788
+ text: this._getResourceTextMDC("chart.PERSONALIZATION_DIALOG_COLUMN_DESCRIPTION") + " / " + this._getResourceTextMDC("chart.PERSONALIZATION_DIALOG_COLUMN_ROLE")
789
+ })
790
+ }), new Column()];
791
+ } else {
792
+
793
+ var oDescColumn = new Column({
794
+ header: new Text({
795
+ text: this._getResourceTextMDC("chart.PERSONALIZATION_DIALOG_COLUMN_DESCRIPTION")
796
+ })
797
+ });
798
+
799
+ var oRoleColumn = new Column({
800
+ header: new Text({
801
+ text: this._getResourceTextMDC("chart.PERSONALIZATION_DIALOG_COLUMN_ROLE")
802
+ })
803
+ });
804
+ oConfig.columns = [oDescColumn, oRoleColumn, new Column()];
805
+ }
806
+
807
+ oConfig.mode = "None";
808
+ return oConfig;
809
+ };
810
+
811
+ ChartItemPanel.prototype._getCleanP13nItems = function() {
812
+ return this._getP13nModel().getProperty("/items").filter(function(it){return !it.template;});
813
+ };
814
+
815
+ ChartItemPanel.prototype._fireChangeItems = function() {
816
+
817
+ this.fireChangeItems({
818
+ items: this._getCleanP13nItems().map(function(oMItem) {
819
+ return {
820
+ columnKey: oMItem.name,
821
+ visible: oMItem.visible,
822
+ index: oMItem.index,
823
+ role: oMItem.role
824
+ };
825
+ })
826
+ });
90
827
 
91
828
  };
92
829
 
@@ -94,11 +831,313 @@ sap.ui.define([
94
831
  var oSelectedItem = oEvent.getParameter("selectedItem");
95
832
  // Fire event only for valid selection
96
833
  if (oSelectedItem) {
97
- var oTableItem = oEvent.getSource().getParent();
834
+
835
+ var oTableItem;
836
+
837
+ if (this._bMobileMode){
838
+ oTableItem = oEvent.getSource().getParent().getParent();
839
+ } else {
840
+ oTableItem = oEvent.getSource().getParent();
841
+ }
98
842
 
99
843
  this.fireChange();
100
844
  this._updateEnableOfMoveButtons(oTableItem);
101
845
  }
846
+
847
+ this._fireChangeItems();
848
+ };
849
+
850
+ ChartItemPanel.prototype._updateEnableOfMoveButtons = function(oTableItem, bFocus) {
851
+
852
+ if (!oTableItem) {
853
+ return;
854
+ }
855
+
856
+ var aIndexes, oMItem = this._getModelItemByTableItem(oTableItem);
857
+ var iTableItemPos = this._getP13nModel().getProperty("/items").indexOf(oMItem);
858
+ var bUpEnabled = true, bDownEnabled = true;
859
+
860
+ if (!oMItem || oMItem.template) {
861
+ return;
862
+ }
863
+
864
+ aIndexes = this._mVisibleIndexes.has(oMItem.kind) ? this._mVisibleIndexes.get(oMItem.kind) : [];
865
+
866
+ if (iTableItemPos == 0 || aIndexes.indexOf(iTableItemPos) === 0 ) {
867
+ // disable move buttons upwards, if the item is at the top
868
+ bUpEnabled = false;
869
+ }
870
+
871
+ if (aIndexes.indexOf(iTableItemPos) === aIndexes.length - 1 ) {
872
+ bDownEnabled = false;
873
+ }
874
+
875
+ this._getMoveTopButton().setEnabled(bUpEnabled);
876
+ this._getMoveUpButton().setEnabled(bUpEnabled);
877
+ this._getMoveDownButton().setEnabled(bDownEnabled);
878
+ this._getMoveBottomButton().setEnabled(bDownEnabled);
879
+
880
+ if (bFocus) {
881
+ //Table re-renders after reorder; this is used in onAfterRendering
882
+ this._oFocusInfo = {tableItem : oTableItem};
883
+ }
884
+ };
885
+
886
+ ChartItemPanel.prototype._getListItemFromMoveButton = function (oBtn) {
887
+ if (oBtn && oBtn.getParent() && oBtn.getParent().getParent()) {
888
+ return oBtn.getParent().getParent();
889
+ }
890
+
891
+ return undefined;
892
+ };
893
+
894
+ ChartItemPanel.prototype._onPressButtonMoveToTop = function(oEvent) {
895
+ var oListItem = this._getListItemFromMoveButton(oEvent.getSource());
896
+ if (!oListItem){
897
+ return;
898
+ }
899
+ var oMItem = this._getP13nModel().getProperty(oListItem.getBindingContextPath());
900
+ var oTopIndex = this._mVisibleIndexes.get(oMItem.kind)[0];
901
+
902
+ this._oSelectedItem = oListItem;
903
+
904
+ this._moveSelectedItem(oTopIndex);
905
+ };
906
+
907
+ ChartItemPanel.prototype._onPressButtonMoveUp = function(oEvent, oListItem) {
908
+ if (!oListItem){
909
+ oListItem = this._getListItemFromMoveButton(oEvent.getSource());
910
+ }
911
+
912
+ if (!oListItem){
913
+ return;
914
+ }
915
+ var oMItem = this._getP13nModel().getProperty(oListItem.getBindingContextPath());
916
+ var aIndexes = this._mVisibleIndexes.get(oMItem.kind);
917
+ var iTableItemPos = this._getP13nModel().getProperty("/items").indexOf(oMItem);
918
+
919
+ this._oSelectedItem = oListItem;
920
+
921
+ //TODO: Get current index
922
+ var oNewIndex = aIndexes[aIndexes.indexOf(iTableItemPos) - 1];
923
+
924
+ this._moveSelectedItem(oNewIndex);
925
+ };
926
+
927
+ ChartItemPanel.prototype._onPressButtonMoveDown = function(oEvent, oListItem) {
928
+ if (!oListItem){
929
+ oListItem = this._getListItemFromMoveButton(oEvent.getSource());
930
+ }
931
+
932
+ if (!oListItem){
933
+ return;
934
+ }
935
+ var oMItem = this._getP13nModel().getProperty(oListItem.getBindingContextPath());
936
+ var aIndexes = this._mVisibleIndexes.get(oMItem.kind);
937
+ var iTableItemPos = this._getP13nModel().getProperty("/items").indexOf(oMItem);
938
+
939
+ this._oSelectedItem = oListItem;
940
+
941
+ //TODO: Get current index
942
+ var oNewIndex = aIndexes[aIndexes.indexOf(iTableItemPos) + 1];
943
+
944
+ this._moveSelectedItem(oNewIndex);
945
+ };
946
+
947
+ ChartItemPanel.prototype._onPressButtonMoveToBottom = function(oEvent) {
948
+
949
+ var oListItem = this._getListItemFromMoveButton(oEvent.getSource());
950
+ if (!oListItem){
951
+ return;
952
+ }
953
+ var oMItem = this._getP13nModel().getProperty(oListItem.getBindingContextPath());
954
+ var oBottomIndex = this._mVisibleIndexes.get(oMItem.kind)[this._mVisibleIndexes.get(oMItem.kind).length - 1];
955
+
956
+ this._oSelectedItem = oListItem;
957
+ this._moveSelectedItem(oBottomIndex);
958
+ };
959
+
960
+ ChartItemPanel.prototype._moveTableItem = function(oItem, iNewIndex) {
961
+ var aFields = this._getP13nModel().getProperty("/items");
962
+
963
+ // index of the item in the model not the index in the aggregation
964
+ var iOldIndex = aFields.indexOf(oItem.getBindingContext(this.P13N_MODEL).getObject());
965
+
966
+ this._moveItemsByIndex(iOldIndex, iNewIndex);
967
+ };
968
+
969
+ ChartItemPanel.prototype._moveItemsByIndex = function(iOldIndex, iNewIndex, bPreventFocusHandling) {
970
+ var aFields = this._getP13nModel().getProperty("/items");
971
+
972
+ // limit the minumum and maximum index
973
+ iNewIndex = (iNewIndex <= 0) ? 0 : Math.min(iNewIndex, aFields.length - 1);
974
+
975
+ if (iNewIndex == iOldIndex) {
976
+ return;
977
+ }
978
+
979
+ // remove data from old position and insert it into new position
980
+ aFields.splice(iNewIndex, 0, aFields.splice(iOldIndex, 1)[0]);
981
+ aFields.forEach(function(oField, iIndex){
982
+ if (!oField.template) {
983
+ oField.index = iIndex;
984
+ }
985
+ });
986
+ this._getP13nModel().setProperty("/items", aFields);
987
+
988
+ if (!bPreventFocusHandling){
989
+ // store the moved item again due to binding
990
+ this._oSelectedItem = this._oListControl.getItems().find(function(it){
991
+ var oItem = this._getModelItemByTableItem(it);
992
+
993
+ return oItem && oItem === aFields[iNewIndex];
994
+
995
+ }.bind(this));
996
+
997
+ this._updateEnableOfMoveButtons(this._oSelectedItem, !bPreventFocusHandling);
998
+
999
+ this._handleActivated(this._oSelectedItem);
1000
+ }
1001
+
1002
+ this._fireChangeItems();
1003
+ };
1004
+
1005
+ ChartItemPanel.prototype._getModelItemByTableItem = function (oTableItem) {
1006
+ return this._getP13nModel().getProperty(oTableItem.getBindingContextPath());
1007
+ };
1008
+ //TODO: Check from here on for kind
1009
+
1010
+ ChartItemPanel.prototype._getMoveConfigForTableItem = function(oTableItem) {
1011
+
1012
+ var oModelItem = this._getModelItemByTableItem(oTableItem);
1013
+
1014
+ if (!oModelItem) {
1015
+ return undefined;
1016
+ }
1017
+
1018
+ return {
1019
+ currentIndex: this._getP13nModel().getProperty("/items").indexOf(oModelItem),
1020
+ aggregationRole: oModelItem.kind,
1021
+ template: oModelItem.template
1022
+ };
1023
+ };
1024
+
1025
+ ChartItemPanel.prototype._getDragDropConfig = function () {
1026
+ if (!this._oDragDropInfo) {
1027
+ var oDndConfig = BasePanel.prototype._getDragDropConfig.apply(this, arguments);
1028
+
1029
+ oDndConfig.attachDragStart(this._checkDragStart.bind(this));
1030
+ oDndConfig.attachDragEnter(this._checkDrag.bind(this));
1031
+ oDndConfig.attachDragEnd(function() {
1032
+ this._oDraggedItem = null;
1033
+ }.bind(this));
1034
+
1035
+ return oDndConfig;
1036
+ }
1037
+
1038
+ return this._oDragDropInfo;
1039
+ };
1040
+
1041
+ ChartItemPanel.prototype._checkDrag = function(oEvent) {
1042
+ var oEventItem = oEvent.getParameter("target");
1043
+ var oMoveConfigEvent = this._getMoveConfigForTableItem(oEventItem);
1044
+ var oMoveConfigDragged = this._getMoveConfigForTableItem(this._oDraggedItem);
1045
+
1046
+ //Prevents template from being draggable
1047
+ if (!oMoveConfigEvent || oMoveConfigEvent.template || oMoveConfigDragged.aggregationRole != oMoveConfigEvent.aggregationRole) {
1048
+ oEvent.preventDefault();
1049
+ return;
1050
+ }
1051
+ };
1052
+
1053
+ ChartItemPanel.prototype._checkDragStart = function(oEvent) {
1054
+ this._oDraggedItem = oEvent.getParameter("target");
1055
+
1056
+ this._checkDrag(oEvent);
1057
+ };
1058
+
1059
+ ChartItemPanel.prototype._onRearrange = function(oEvent) {
1060
+ var oDraggedItem = oEvent.getParameter("draggedControl");
1061
+ var oDroppedItem = oEvent.getParameter("droppedControl");
1062
+ var sDropPosition = oEvent.getParameter("dropPosition");
1063
+
1064
+ var oMoveConfigDragged = this._getMoveConfigForTableItem(oDraggedItem);
1065
+ var oMoveConfigDropped = this._getMoveConfigForTableItem(oDroppedItem);
1066
+
1067
+ if (!oMoveConfigDragged || oMoveConfigDragged.template || !oMoveConfigDropped) {
1068
+ oEvent.preventDefault();
1069
+ return;
1070
+ }
1071
+
1072
+ var iDraggedIndex = oMoveConfigDragged.currentIndex;
1073
+ var iDroppedIndex = oMoveConfigDropped.currentIndex;
1074
+
1075
+ if (oMoveConfigDropped.template && sDropPosition == "After") {
1076
+ oEvent.preventDefault();
1077
+ return;
1078
+ }
1079
+
1080
+ if (!oMoveConfigDropped.template &&
1081
+ (
1082
+ oMoveConfigDragged.aggregationRole != undefined &&
1083
+ oMoveConfigDragged.aggregationRole != oMoveConfigDropped.aggregationRole)) {
1084
+ oEvent.preventDefault();
1085
+ return;
1086
+ }
1087
+
1088
+ //When an item gets dragged into the same "direction" it come from inside the array, an offset is needed
1089
+ if (iDraggedIndex < iDroppedIndex) {
1090
+ if (sDropPosition == "Before" && iDroppedIndex != 0) {
1091
+ iDroppedIndex -= 1;
1092
+ }
1093
+
1094
+ //Max index not needed here since draggedIndex must be greater than dropped index -> can't be dropped at max
1095
+ } else if (sDropPosition == "After") {
1096
+
1097
+ iDroppedIndex += 1;
1098
+ }
1099
+
1100
+ this._moveItemsByIndex(iDraggedIndex, iDroppedIndex);
1101
+
1102
+ this._getP13nModel().refresh(true);
1103
+ this._updateVisibleIndexes();
1104
+
1105
+ };
1106
+
1107
+ ChartItemPanel.prototype._getMoveTopButton = function() {
1108
+
1109
+ if (this._oMoveTopBtn && this._oMoveTopBtn.isDestroyed()) {
1110
+ this._oMoveTopBtn = null;
1111
+ }
1112
+
1113
+ return BasePanel.prototype._getMoveTopButton.apply(this, arguments);
1114
+ };
1115
+
1116
+ ChartItemPanel.prototype._getMoveUpButton = function() {
1117
+
1118
+ if (this._oMoveUpButton && this._oMoveUpButton.isDestroyed()) {
1119
+ this._oMoveUpButton = null;
1120
+ }
1121
+
1122
+ return BasePanel.prototype._getMoveUpButton.apply(this, arguments);
1123
+ };
1124
+
1125
+ ChartItemPanel.prototype._getMoveDownButton = function() {
1126
+
1127
+ if (this._oMoveDownButton && this._oMoveDownButton.isDestroyed()) {
1128
+ this._oMoveDownButton = null;
1129
+ }
1130
+
1131
+ return BasePanel.prototype._getMoveDownButton.apply(this, arguments);
1132
+ };
1133
+
1134
+ ChartItemPanel.prototype._getMoveBottomButton = function() {
1135
+
1136
+ if (this._oMoveBottomButton && this._oMoveBottomButton.isDestroyed()) {
1137
+ this._oMoveBottomButton = null;
1138
+ }
1139
+
1140
+ return BasePanel.prototype._getMoveBottomButton.apply(this, arguments);
102
1141
  };
103
1142
 
104
1143
  ChartItemPanel.prototype._getChartItemTextByKey = function (sKey) {
@@ -132,6 +1171,11 @@ sap.ui.define([
132
1171
  return oAvailableRoles[sKey];
133
1172
  };
134
1173
 
1174
+ ChartItemPanel.prototype._getResourceTextMDC = function(sText, vValue) {
1175
+ this.oResourceBundleMDC = this.oResourceBundleMDC ? this.oResourceBundleMDC : sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
1176
+ return sText ? this.oResourceBundleMDC.getText(sText, vValue) : this.oResourceBundleMDC;
1177
+ };
1178
+
135
1179
  return ChartItemPanel;
136
1180
 
137
- });
1181
+ });