@openui5/sap.ui.mdc 1.97.1 → 1.99.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 (263) hide show
  1. package/.reuse/dep5 +25 -30
  2. package/THIRDPARTY.txt +14 -21
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +6 -3
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -2
  7. package/src/sap/ui/mdc/BaseDelegate.js +1 -1
  8. package/src/sap/ui/mdc/Chart.js +1100 -1796
  9. package/src/sap/ui/mdc/ChartDelegate.js +429 -270
  10. package/src/sap/ui/mdc/ChartRenderer.js +73 -77
  11. package/src/sap/ui/mdc/Control.js +1 -1
  12. package/src/sap/ui/mdc/Element.js +1 -1
  13. package/src/sap/ui/mdc/Field.js +2 -2
  14. package/src/sap/ui/mdc/FilterBar.js +3 -2
  15. package/src/sap/ui/mdc/FilterField.js +11 -8
  16. package/src/sap/ui/mdc/Link.js +23 -4
  17. package/src/sap/ui/mdc/LinkDelegate.js +3 -3
  18. package/src/sap/ui/mdc/MultiValueField.js +20 -6
  19. package/src/sap/ui/mdc/Table.js +79 -64
  20. package/src/sap/ui/mdc/TableDelegate.js +40 -12
  21. package/src/sap/ui/mdc/ValueHelp.js +19 -9
  22. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +2 -2
  23. package/src/sap/ui/mdc/{chartNew/ChartSelectionDetailsNew.js → chart/ChartSelectionDetails.js} +8 -8
  24. package/src/sap/ui/mdc/{chartNew/ChartToolbarNew.js → chart/ChartToolbar.js} +49 -13
  25. package/src/sap/ui/mdc/chart/ChartTypeButton.js +55 -54
  26. package/src/sap/ui/mdc/{chartNew/DrillBreadcrumbsNew.js → chart/DrillBreadcrumbs.js} +3 -3
  27. package/src/sap/ui/mdc/chart/DrillStackHandler.js +38 -249
  28. package/src/sap/ui/mdc/chart/Item.js +62 -92
  29. package/src/sap/ui/mdc/{chartNew/PropertyHelperNew.js → chart/PropertyHelper.js} +3 -3
  30. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +17 -21
  31. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  32. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  33. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  34. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  35. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +256 -43
  36. package/src/sap/ui/mdc/condition/Operator.js +1 -1
  37. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +1 -1
  38. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  39. package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +80 -5
  40. package/src/sap/ui/mdc/designtime/field/Field.designtime.js +81 -5
  41. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +3 -0
  42. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +60 -20
  43. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  44. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  45. package/src/sap/ui/mdc/field/ConditionType.js +3 -3
  46. package/src/sap/ui/mdc/field/ConditionsType.js +1 -1
  47. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  48. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  49. package/src/sap/ui/mdc/field/DefineConditionPanel.js +75 -27
  50. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +4 -4
  51. package/src/sap/ui/mdc/field/FieldBase.js +32 -6
  52. package/src/sap/ui/mdc/field/FieldBaseRenderer.js +0 -3
  53. package/src/sap/ui/mdc/field/FieldHelpBase.js +2 -2
  54. package/src/sap/ui/mdc/field/FieldInfoBase.js +23 -10
  55. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  56. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  57. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  58. package/src/sap/ui/mdc/field/FieldValueHelp.js +2 -2
  59. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  60. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +2 -2
  62. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +6 -3
  63. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  64. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  65. package/src/sap/ui/mdc/field/ListFieldHelp.js +10 -2
  66. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  67. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  68. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  69. package/src/sap/ui/mdc/field/TokenDisplay.js +70 -0
  70. package/src/sap/ui/mdc/field/TokenDisplayRenderer.js +24 -0
  71. package/src/sap/ui/mdc/field/TokenizerDisplay.js +80 -0
  72. package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +69 -0
  73. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  74. package/src/sap/ui/mdc/field/content/ContentFactory.js +5 -5
  75. package/src/sap/ui/mdc/field/content/DateContent.js +2 -2
  76. package/src/sap/ui/mdc/field/content/DefaultContent.js +35 -13
  77. package/src/sap/ui/mdc/field/content/LinkContent.js +1 -1
  78. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +335 -126
  79. package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +1 -1
  80. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  81. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +8 -2
  82. package/src/sap/ui/mdc/filterbar/vh/CollectiveSearchSelect.js +3 -1
  83. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +7 -1
  84. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +6 -6
  85. package/src/sap/ui/mdc/flexibility/AggregateFlex.js +2 -2
  86. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +6 -4
  87. package/src/sap/ui/mdc/flexibility/ColumnFlex.js +1 -1
  88. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +4 -3
  89. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  90. package/src/sap/ui/mdc/flexibility/GroupFlex.js +1 -1
  91. package/src/sap/ui/mdc/flexibility/Panel.flexibility.js +9 -3
  92. package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +110 -0
  93. package/src/sap/ui/mdc/flexibility/SortFlex.js +2 -2
  94. package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +6 -6
  95. package/src/sap/ui/mdc/library.js +45 -42
  96. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  97. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  98. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  99. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  100. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  101. package/src/sap/ui/mdc/link/Factory.js +2 -2
  102. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  103. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  104. package/src/sap/ui/mdc/link/Log.js +1 -1
  105. package/src/sap/ui/mdc/link/Panel.js +140 -177
  106. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  107. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  108. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  109. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  110. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  111. package/src/sap/ui/mdc/messagebundle.properties +55 -1
  112. package/src/sap/ui/mdc/messagebundle_ar.properties +39 -4
  113. package/src/sap/ui/mdc/messagebundle_bg.properties +54 -19
  114. package/src/sap/ui/mdc/messagebundle_ca.properties +37 -2
  115. package/src/sap/ui/mdc/messagebundle_cs.properties +52 -17
  116. package/src/sap/ui/mdc/messagebundle_cy.properties +37 -2
  117. package/src/sap/ui/mdc/messagebundle_da.properties +44 -9
  118. package/src/sap/ui/mdc/messagebundle_de.properties +37 -2
  119. package/src/sap/ui/mdc/messagebundle_el.properties +38 -3
  120. package/src/sap/ui/mdc/messagebundle_en.properties +37 -2
  121. package/src/sap/ui/mdc/messagebundle_en_GB.properties +37 -2
  122. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +37 -2
  123. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +61 -4
  124. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +37 -2
  125. package/src/sap/ui/mdc/messagebundle_es.properties +37 -2
  126. package/src/sap/ui/mdc/messagebundle_es_MX.properties +51 -16
  127. package/src/sap/ui/mdc/messagebundle_et.properties +37 -2
  128. package/src/sap/ui/mdc/messagebundle_fi.properties +43 -8
  129. package/src/sap/ui/mdc/messagebundle_fr.properties +38 -3
  130. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +37 -2
  131. package/src/sap/ui/mdc/messagebundle_hi.properties +38 -3
  132. package/src/sap/ui/mdc/messagebundle_hr.properties +37 -2
  133. package/src/sap/ui/mdc/messagebundle_hu.properties +37 -2
  134. package/src/sap/ui/mdc/messagebundle_id.properties +37 -2
  135. package/src/sap/ui/mdc/messagebundle_it.properties +53 -18
  136. package/src/sap/ui/mdc/messagebundle_iw.properties +38 -3
  137. package/src/sap/ui/mdc/messagebundle_ja.properties +37 -2
  138. package/src/sap/ui/mdc/messagebundle_kk.properties +37 -2
  139. package/src/sap/ui/mdc/messagebundle_ko.properties +41 -6
  140. package/src/sap/ui/mdc/messagebundle_lt.properties +37 -2
  141. package/src/sap/ui/mdc/messagebundle_lv.properties +41 -6
  142. package/src/sap/ui/mdc/messagebundle_ms.properties +37 -2
  143. package/src/sap/ui/mdc/messagebundle_nl.properties +42 -7
  144. package/src/sap/ui/mdc/messagebundle_no.properties +45 -10
  145. package/src/sap/ui/mdc/messagebundle_pl.properties +38 -3
  146. package/src/sap/ui/mdc/messagebundle_pt.properties +44 -9
  147. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +37 -2
  148. package/src/sap/ui/mdc/messagebundle_ro.properties +37 -2
  149. package/src/sap/ui/mdc/messagebundle_ru.properties +37 -2
  150. package/src/sap/ui/mdc/messagebundle_sh.properties +37 -2
  151. package/src/sap/ui/mdc/messagebundle_sk.properties +37 -2
  152. package/src/sap/ui/mdc/messagebundle_sl.properties +37 -2
  153. package/src/sap/ui/mdc/messagebundle_sv.properties +39 -4
  154. package/src/sap/ui/mdc/messagebundle_th.properties +40 -5
  155. package/src/sap/ui/mdc/messagebundle_tr.properties +37 -2
  156. package/src/sap/ui/mdc/messagebundle_uk.properties +41 -6
  157. package/src/sap/ui/mdc/messagebundle_vi.properties +37 -2
  158. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +37 -2
  159. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +37 -2
  160. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +19 -5
  161. package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
  162. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +14 -9
  163. package/src/sap/ui/mdc/mixin/PromiseMixin.js +2 -3
  164. package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
  165. package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +29 -483
  166. package/src/sap/ui/mdc/odata/v4/{ChartPropertyHelperNew.js → ChartPropertyHelper.js} +5 -5
  167. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +112 -96
  168. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +1 -1
  169. package/src/sap/ui/mdc/odata/v4/util/DelegateUtil.js +1 -1
  170. package/src/sap/ui/mdc/odata/v4/vizChart/{ChartDelegateNew.js → ChartDelegate.js} +206 -116
  171. package/src/sap/ui/mdc/p13n/Engine.js +31 -13
  172. package/src/sap/ui/mdc/p13n/FlexUtil.js +11 -118
  173. package/src/sap/ui/mdc/p13n/P13nBuilder.js +7 -7
  174. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  175. package/src/sap/ui/mdc/p13n/StateUtil.js +20 -6
  176. package/src/sap/ui/mdc/p13n/UIManager.js +5 -7
  177. package/src/sap/ui/mdc/p13n/modification/FlexModificationHandler.js +4 -1
  178. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +9 -6
  179. package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
  180. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1092 -48
  181. package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +72 -0
  182. package/src/sap/ui/mdc/p13n/panels/ListView.js +6 -2
  183. package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +6 -5
  184. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +156 -11
  185. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +15 -26
  186. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +6 -5
  187. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +14 -7
  188. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +173 -0
  189. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +10 -17
  190. package/src/sap/ui/mdc/table/Column.js +12 -12
  191. package/src/sap/ui/mdc/table/CreationRow.js +11 -11
  192. package/src/sap/ui/mdc/table/GridTableType.js +5 -6
  193. package/src/sap/ui/mdc/table/PropertyHelper.js +44 -7
  194. package/src/sap/ui/mdc/table/ResponsiveTableType.js +8 -10
  195. package/src/sap/ui/mdc/table/RowSettings.js +4 -4
  196. package/src/sap/ui/mdc/table/TableTypeBase.js +2 -2
  197. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  198. package/src/sap/ui/mdc/themes/base/FieldBase.less +0 -5
  199. package/src/sap/ui/mdc/themes/base/TokenDisplay.less +89 -0
  200. package/src/sap/ui/mdc/themes/base/TokenizerDisplay.less +90 -0
  201. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +15 -4
  202. package/src/sap/ui/mdc/themes/base/library.source.less +2 -0
  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 +1 -1
  206. package/src/sap/ui/mdc/util/DateUtil.js +1 -1
  207. package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
  208. package/src/sap/ui/mdc/util/FormatUtil.js +3 -3
  209. package/src/sap/ui/mdc/util/IdentifierUtil.js +6 -6
  210. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  211. package/src/sap/ui/mdc/util/PropertyHelper.js +43 -12
  212. package/src/sap/ui/mdc/util/TypeUtil.js +5 -4
  213. package/src/sap/ui/mdc/valuehelp/Dialog.js +11 -8
  214. package/src/sap/ui/mdc/valuehelp/Popover.js +2 -1
  215. package/src/sap/ui/mdc/valuehelp/base/Container.js +2 -1
  216. package/src/sap/ui/mdc/valuehelp/base/Content.js +2 -1
  217. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +2 -1
  218. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +2 -1
  219. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +2 -1
  220. package/src/sap/ui/mdc/valuehelp/content/Bool.js +2 -1
  221. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +4 -2
  222. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +11 -5
  223. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +43 -8
  224. package/src/sap/ui/mdc/valuehelp/content/MTable.js +43 -24
  225. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -1
  226. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +3 -3
  227. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ActionsBase.js +3 -3
  228. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ActionsViz.js +0 -0
  229. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/AssertionsBase.js +1 -1
  230. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/AssertionsViz.js +0 -0
  231. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ChartNew.js +0 -0
  232. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +289 -0
  233. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +7 -7
  234. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +9 -9
  235. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +12 -11
  236. package/test/sap/ui/mdc/testutils/opa/link/Actions.js +85 -0
  237. package/test/sap/ui/mdc/testutils/opa/link/Assertions.js +79 -0
  238. package/test/sap/ui/mdc/testutils/opa/link/TestObjects.js +112 -0
  239. package/test/sap/ui/mdc/testutils/opa/link/waitForLink.js +50 -0
  240. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +261 -138
  241. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +27 -26
  242. package/test/sap/ui/mdc/testutils/opa/valueHelp/Actions.js +54 -0
  243. package/test/sap/ui/mdc/testutils/opa/valueHelp/Assertions.js +5 -0
  244. package/test/sap/ui/mdc/testutils/opa/valueHelp/TestObjects.js +40 -0
  245. package/test/sap/ui/mdc/testutils/opa/valueHelp/Util.js +28 -0
  246. package/src/sap/ui/mdc/ChartDelegateNew.js +0 -395
  247. package/src/sap/ui/mdc/ChartNew.js +0 -1114
  248. package/src/sap/ui/mdc/ChartNewRenderer.js +0 -91
  249. package/src/sap/ui/mdc/chart/DimensionItem.js +0 -281
  250. package/src/sap/ui/mdc/chart/MeasureItem.js +0 -318
  251. package/src/sap/ui/mdc/chart/MetadataDelegate.js +0 -31
  252. package/src/sap/ui/mdc/chart/SelectionHandler.js +0 -127
  253. package/src/sap/ui/mdc/chart/ToolbarHandler.js +0 -328
  254. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +0 -295
  255. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +0 -212
  256. package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -72
  257. package/src/sap/ui/mdc/chartNew/SelectionDetailsActionsNew.js +0 -34
  258. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +0 -91
  259. package/src/sap/ui/mdc/link/SelectionDialog.control.xml +0 -66
  260. package/src/sap/ui/mdc/link/SelectionDialog.js +0 -213
  261. package/src/sap/ui/mdc/link/SelectionDialogItem.js +0 -86
  262. package/src/sap/ui/mdc/odata/v4/ChartDelegateNew.js +0 -35
  263. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +0 -1179
@@ -0,0 +1,72 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/m/p13n/SelectionPanel",
9
+ "sap/m/ColumnListItem",
10
+ "sap/m/HBox",
11
+ "sap/m/VBox",
12
+ "sap/m/Link",
13
+ "sap/m/Text",
14
+ "sap/ui/core/Icon",
15
+ "sap/m/library",
16
+ "sap/m/MessageBox"
17
+ ], function (SelectionPanel, ColumnListItem, HBox, VBox, Link, Text, Icon, mLibrary, MessageBox) {
18
+ "use strict";
19
+
20
+ // shortcut for sap.m.ListType
21
+ var ListType = mLibrary.ListType;
22
+
23
+ var LinkSelectionPanel = SelectionPanel.extend("sap.ui.mdc.p13n.panels.LinkSelectionPanel", {
24
+ metadata: {
25
+ library: "sap.ui.mdc",
26
+ /**
27
+ * This event is fired when a Link on the SelectionPanel is pressed.
28
+ */
29
+ events: {
30
+ linkPressed: {}
31
+ }
32
+ },
33
+ renderer: {
34
+ apiVersion: 2
35
+ }
36
+ });
37
+
38
+ LinkSelectionPanel.prototype._getListTemplate = function() {
39
+ return new ColumnListItem({
40
+ selected: "{" + this.P13N_MODEL + ">" + this.PRESENCE_ATTRIBUTE + "}",
41
+ type: ListType.Active,
42
+ cells: [
43
+ new VBox({
44
+ items: [
45
+ new Link({
46
+ tooltip: "{" + this.P13N_MODEL + ">tooltip}",
47
+ text: "{" + this.P13N_MODEL + ">text}",
48
+ href: "{" + this.P13N_MODEL + ">href}",
49
+ target: "{" + this.P13N_MODEL + ">target}",
50
+ press: this._onLinkPressed.bind(this)
51
+ }),
52
+ new Text({
53
+ text: "{" + this.P13N_MODEL + ">description}",
54
+ visible: "{= ${" + this.P13N_MODEL + ">description} ? true:false}"
55
+ })
56
+ ]
57
+ })
58
+ ]
59
+ });
60
+ };
61
+
62
+ LinkSelectionPanel.prototype._onLinkPressed = function(oEvent) {
63
+ this.fireLinkPressed(oEvent);
64
+ };
65
+
66
+ LinkSelectionPanel.prototype.setMultiSelectMode = function(sMultiSelectMode) {
67
+ this._oListControl.setMultiSelectMode(sMultiSelectMode);
68
+ };
69
+
70
+ return LinkSelectionPanel;
71
+
72
+ });
@@ -10,6 +10,7 @@ sap.ui.define([
10
10
  "sap/m/HBox",
11
11
  "sap/m/VBox",
12
12
  "sap/ui/core/Icon",
13
+ "sap/ui/core/library",
13
14
  "sap/m/Text",
14
15
  "sap/m/Column",
15
16
  "sap/m/Table",
@@ -18,7 +19,7 @@ sap.ui.define([
18
19
  "sap/m/Button",
19
20
  "sap/m/OverflowToolbar",
20
21
  "sap/ui/model/Filter"
21
- ], function(BasePanel, Label, ColumnListItem, HBox, VBox, Icon, Text, Column, Table, mLibrary, ToolbarSpacer, Button, OverflowToolbar, Filter) {
22
+ ], function(BasePanel, Label, ColumnListItem, HBox, VBox, Icon, coreLibrary, Text, Column, Table, mLibrary, ToolbarSpacer, Button, OverflowToolbar, Filter) {
22
23
  "use strict";
23
24
 
24
25
  // shortcut for sap.m.ListKeyboardMode
@@ -30,6 +31,9 @@ sap.ui.define([
30
31
  // shortcut for sap.m.ListType
31
32
  var ListType = mLibrary.ListType;
32
33
 
34
+ // shortcut for sap.ui.core.IconColor;
35
+ var IconColor = coreLibrary.IconColor;
36
+
33
37
  /**
34
38
  * Constructor for a new ListView
35
39
  *
@@ -112,7 +116,7 @@ sap.ui.define([
112
116
  new Icon({
113
117
  src: "sap-icon://circle-task-2",
114
118
  size: "0.5rem",
115
- color: sap.ui.core.IconColor.Neutral,
119
+ color: IconColor.Neutral,
116
120
  visible: {
117
121
  path: this.P13N_MODEL + ">isFiltered",
118
122
  formatter: function(bIsFiltered) {
@@ -9,7 +9,12 @@ sap.ui.define([
9
9
  ], function (BaseController, P13nBuilder, merge) {
10
10
  "use strict";
11
11
 
12
- var AdaptFiltersController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.AdaptFiltersController");
12
+ var AdaptFiltersController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.AdaptFiltersController", {
13
+ constructor: function() {
14
+ BaseController.apply(this, arguments);
15
+ this._bResetEnabled = true;
16
+ }
17
+ });
13
18
 
14
19
  AdaptFiltersController.prototype.getUISettings = function() {
15
20
  return {
@@ -56,10 +61,6 @@ sap.ui.define([
56
61
  }.bind(this));
57
62
  };
58
63
 
59
- AdaptFiltersController.prototype.getResetEnabled = function () {
60
- return true;
61
- };
62
-
63
64
  AdaptFiltersController.prototype.update = function(){
64
65
  BaseController.prototype.update.apply(this, arguments);
65
66
  this.getAdaptationControl().getInbuiltFilter().createFilterFields();
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
+ 'sap/base/util/array/diff',
8
9
  'sap/ui/base/Object',
9
10
  'sap/ui/mdc/p13n/FlexUtil',
10
11
  'sap/ui/mdc/p13n/P13nBuilder',
@@ -12,18 +13,22 @@ sap.ui.define([
12
13
  'sap/base/util/deepEqual',
13
14
  'sap/ui/model/json/JSONModel',
14
15
  'sap/m/p13n/SelectionPanel'
15
- ], function (BaseObject, FlexUtil, P13nBuilder, merge, deepEqual, JSONModel, SelectionPanel) {
16
+ ], function (diff, BaseObject, FlexUtil, P13nBuilder, merge, deepEqual, JSONModel, SelectionPanel) {
16
17
  "use strict";
17
18
 
18
- /**
19
- * Constructor for a new BaseController. The BaseController serves as
20
- * base class to create control specific personalization implementations.
19
+ /**
20
+ * Constructor for a new <code>BaseController</code>.
21
+ *
22
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
23
+ * @param {object} [mSettings] Initial settings for the new control
21
24
  *
22
25
  * @class
26
+ * The <code>BaseController</code> serves as base class to create control specific personalization implementations.
27
+ *
23
28
  * @extends sap.ui.base.Object
24
29
  *
25
30
  * @author SAP SE
26
- * @version 1.97.1
31
+ * @version 1.99.1
27
32
  *
28
33
  * @private
29
34
  * @ui5-restricted sap.ui.mdc
@@ -66,7 +71,7 @@ sap.ui.define([
66
71
  /**
67
72
  * Defines whether a Dialog (Change creation on 'OK') or a Popover (liveChanges) should be used.
68
73
  *
69
- * @returns {boolean}
74
+ * @returns {boolean} Determines if the livemode should be enabled
70
75
  */
71
76
  BaseController.prototype.getLiveMode = function(){
72
77
  return this._bLiveMode;
@@ -88,12 +93,21 @@ sap.ui.define([
88
93
  /**
89
94
  * Defines whether the container should include a reset.
90
95
  *
91
- * @returns {boolean}
96
+ * @returns {boolean} Determines if the reset should be enabled
92
97
  */
93
98
  BaseController.prototype.getResetEnabled = function() {
94
99
  return this._bResetEnabled;
95
100
  };
96
101
 
102
+ /**
103
+ * Defines which control(s) are considered for the reset.
104
+ *
105
+ * @returns {sap.ui.core.Control|sap.ui.core.Control[]}
106
+ */
107
+ BaseController.prototype.getSelectorForReset = function() {
108
+ return this._oAdaptationControl;
109
+ };
110
+
97
111
  BaseController.prototype.sanityCheck = function(oState) {
98
112
  return oState;
99
113
  };
@@ -101,6 +115,7 @@ sap.ui.define([
101
115
  /**
102
116
  * The actual UI used for personalization.
103
117
  *
118
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
104
119
  * @returns {sap.ui.core.Control|string|Promise} The control which is going to be used in the p13n container.
105
120
  */
106
121
  BaseController.prototype.getAdaptationUI = function(oPropertyHelper){
@@ -133,12 +148,137 @@ sap.ui.define([
133
148
  if (deepEqual(mPropertyBag.existingState, aNewStatePrepared)){
134
149
  return [];
135
150
  } else {
136
- return FlexUtil.getArrayDeltaChanges(mPropertyBag);
151
+ return this.getArrayDeltaChanges(mPropertyBag);
152
+ }
153
+
154
+ };
155
+
156
+ /**
157
+ * Generates a set of changes based on the given arrays for a specified control
158
+ *
159
+ * @public
160
+ *
161
+ * @param {object} mDeltaInfo Map containing the necessary information to calculate the diff as change objects
162
+ * @param {array} mDeltaInfo.existingState An array describing the control state before a adaptation
163
+ * @param {array} mDeltaInfo.changedState An array describing the control state after a certain adaptation
164
+ * @param {object} mDeltaInfo.control Control instance which is being used to generate the changes
165
+ * @param {object} mDeltaInfo.changeOperations Map containing the changeOperations for the given Control instance
166
+ * @param {string} mDeltaInfo.changeOperations.add Name of the control specific 'add' changehandler
167
+ * @param {string} mDeltaInfo.changeOperations.remove Name of the control specific 'remove' changehandler
168
+ * @param {string} [mDeltaInfo.changeOperations.move] Name of the control specific 'move' changehandler
169
+ * @param {string} [mDeltaInfo.generator] Name of the change generator (E.g. the namespace of the UI creating the change object)
170
+ *
171
+ * @returns {array} Array containing the delta based created changes
172
+ */
173
+ BaseController.prototype.getArrayDeltaChanges = function (mDeltaInfo) {
174
+
175
+ var aExistingArray = mDeltaInfo.existingState;
176
+ var aChangedArray = mDeltaInfo.changedState;
177
+ var oControl = mDeltaInfo.control;
178
+ var sInsertOperation = mDeltaInfo.changeOperations.add;
179
+ var sRemoveOperation = mDeltaInfo.changeOperations.remove;
180
+ var sMoveOperation = mDeltaInfo.changeOperations.move;
181
+ var sGenerator = mDeltaInfo.generator;
182
+
183
+ var aDeltaAttributes = mDeltaInfo.deltaAttributes || [];
184
+
185
+ var fnSymbol = function(o) {
186
+ var sDiff = "";
187
+ aDeltaAttributes.forEach(function(sAttribute){
188
+ sDiff = sDiff + o[sAttribute];
189
+ });
190
+ return sDiff;
191
+ };
192
+
193
+ var aResults = diff(aExistingArray, aChangedArray, fnSymbol);
194
+ // Function to match field with exising field in the given array
195
+ var fMatch = function (oField, aArray) {
196
+ return aArray.filter(function (oExistingField) {
197
+ return oExistingField && (oExistingField.name === oField.name);
198
+ })[0];
199
+ };
200
+
201
+ var aChanges = [];
202
+ var aProcessedArray = aExistingArray.slice(0);
203
+
204
+ aResults.forEach(function (oResult) {
205
+ // Begin --> hack for handling result returned by diff
206
+ if (oResult.type === "delete" && aProcessedArray[oResult.index] === undefined) {
207
+ aProcessedArray.splice(oResult.index, 1);
208
+ return;
209
+ }
210
+
211
+ var oProp, oExistingProp, iLength;
212
+ if (oResult.type === "insert") {
213
+ oExistingProp = fMatch(aChangedArray[oResult.index], aProcessedArray);
214
+ if (oExistingProp) {
215
+ oExistingProp.index = aProcessedArray.indexOf(oExistingProp);
216
+ aProcessedArray.splice(oExistingProp.index, 1, undefined);
217
+ aChanges = aChanges.concat(this._createAddRemoveChange(oControl, sRemoveOperation, FlexUtil._getChangeContent(oExistingProp, aDeltaAttributes), sGenerator));
218
+ }
219
+ }
220
+ // End hack
221
+ oProp = oResult.type === "delete" ? aProcessedArray[oResult.index] : aChangedArray[oResult.index];
222
+ oProp.index = oResult.index;
223
+ if (oResult.type === "delete") {
224
+ aProcessedArray.splice(oProp.index, 1);
225
+ } else {
226
+ aProcessedArray.splice(oProp.index, 0, oProp);
227
+ }
228
+ // Move operation shows up as insert followed by delete OR delete followed by insert
229
+ if (sMoveOperation) {
230
+ iLength = aChanges.length;
231
+ // Get the last added change
232
+ if (iLength) {
233
+ oExistingProp = aChanges[iLength - 1];
234
+ oExistingProp = oExistingProp ? oExistingProp.changeSpecificData.content : undefined;
235
+ }
236
+ // Matching property exists with a different index --> then this is a move operation
237
+ if (oExistingProp && oExistingProp.name === oProp.name && oResult.index != oExistingProp.index) {
238
+ // remove the last insert/delete operation
239
+ aChanges.pop();
240
+ aChanges = aChanges.concat(this._createMoveChange(oExistingProp.id, oExistingProp.name, oResult.index, sMoveOperation, oControl, sMoveOperation !== "moveSort", sGenerator));
241
+ return;
242
+ }
243
+ }
244
+
245
+ aChanges = aChanges.concat(this._createAddRemoveChange(oControl, oResult.type === "delete" ? sRemoveOperation : sInsertOperation, FlexUtil._getChangeContent(oProp, aDeltaAttributes), sGenerator));
246
+
247
+ }.bind(this));
248
+ return aChanges;
249
+ };
250
+
251
+ BaseController.prototype._createAddRemoveChange = function(oControl, sOperation, oContent){
252
+ var oAddRemoveChange = {
253
+ selectorElement: oControl,
254
+ changeSpecificData: {
255
+ changeType: sOperation,
256
+ content: oContent
257
+ }
258
+ };
259
+ return oAddRemoveChange;
260
+ };
261
+
262
+ BaseController.prototype._createMoveChange = function(sId, sPropertyName, iNewIndex, sMoveOperation, oControl, bPersistId){
263
+ var oMoveChange = {
264
+ selectorElement: oControl,
265
+ changeSpecificData: {
266
+ changeType: sMoveOperation,
267
+ content: {
268
+ id: sId,
269
+ name: sPropertyName,
270
+ index: iNewIndex
271
+ }
272
+ }
273
+ };
274
+
275
+ if (!bPersistId) {
276
+ delete oMoveChange.changeSpecificData.content.id;
137
277
  }
138
278
 
279
+ return oMoveChange;
139
280
  };
140
281
 
141
- //TODO: check if this can be avoided
142
282
  BaseController.prototype._getPresenceAttribute = function(bexternalAppliance){
143
283
  return "visible";
144
284
  };
@@ -157,6 +297,7 @@ sap.ui.define([
157
297
  * Initialized the inner model for the Personalization.
158
298
  *
159
299
  * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The propertyhelper that should be utilized for property determination.
300
+ * @returns {object} The personalization model data
160
301
  */
161
302
  BaseController.prototype.mixInfoAndState = function(oPropertyHelper) {
162
303
 
@@ -191,6 +332,8 @@ sap.ui.define([
191
332
 
192
333
  /**
193
334
  * Can be used to trigger update after UI interactions such as "Ok" and "Reset"
335
+ *
336
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
194
337
  */
195
338
  BaseController.prototype.update = function(oPropertyHelper) {
196
339
  if (this._oPanel) {
@@ -204,8 +347,6 @@ sap.ui.define([
204
347
  }
205
348
  };
206
349
 
207
-
208
- //TODO: move to FlexUtil? --> Split FlexUtil<>DeltaUtil
209
350
  BaseController.prototype._getFilledArray = function(aPreviousItems, aNewItems, sRemoveProperty) {
210
351
  var aNewItemsPrepared = merge([], aPreviousItems);
211
352
  var aNewItemState = merge([], aNewItems);
@@ -235,6 +376,10 @@ sap.ui.define([
235
376
  };
236
377
 
237
378
  /**
379
+ *
380
+ * Getter for the personalization model
381
+ *
382
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
238
383
  * @returns {sap.ui.model.json.JSONModel} The personalization model.
239
384
  *
240
385
  */
@@ -6,10 +6,8 @@
6
6
 
7
7
  sap.ui.define([
8
8
  "./BaseController",
9
- "sap/ui/mdc/p13n/P13nBuilder",
10
- "sap/base/util/UriParameters",
11
- "sap/ui/mdc/p13n/panels/ChartItemPanel"
12
- ], function (BaseController, P13nBuilder, UriParameters, ChartItemPanel) {
9
+ "sap/ui/mdc/p13n/P13nBuilder"
10
+ ], function (BaseController, P13nBuilder) {
13
11
  "use strict";
14
12
 
15
13
  var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
@@ -18,36 +16,27 @@ sap.ui.define([
18
16
 
19
17
  ChartItemController.prototype.getAdaptationUI = function(oPropertyHelper) {
20
18
 
21
- if (UriParameters.fromQuery(window.location.search).get("newChartP13n") === "true"){
19
+ var fnResolve;
22
20
 
23
- var fnResolve;
21
+ this._oAdaptationControl.getAdaptationUI().then(function(oPanel){
22
+ this._oPanel = oPanel;
23
+ this._oPropHelper = oPropertyHelper;
24
+ var oAdaptationData = this.mixInfoAndState(oPropertyHelper);
25
+ oPanel.setP13nData(oAdaptationData.items);
26
+ fnResolve(oPanel);
27
+ }.bind(this));
24
28
 
25
- this._oAdaptationControl.getAdaptationUI().then(function(oPanel){
26
- this._oPanel = oPanel;
27
- this._oPropHelper = oPropertyHelper;
28
- var oAdaptationData = this.mixInfoAndState(oPropertyHelper);
29
- oPanel.setP13nData(oAdaptationData.items);
30
- fnResolve(oPanel);
31
- }.bind(this));
32
-
33
- return new Promise(function (resolve, reject) {
34
- fnResolve = resolve;
35
- });
36
-
37
- } else {
38
- var oChartItemPanel = new ChartItemPanel();
39
- oChartItemPanel.setP13nModel(this._getP13nModel(oPropertyHelper));
40
- return Promise.resolve(oChartItemPanel);
41
- }
29
+ return new Promise(function (resolve, reject) {
30
+ fnResolve = resolve;
31
+ });
42
32
 
43
33
  };
44
34
 
45
35
  ChartItemController.prototype.update = function(){
46
36
  BaseController.prototype.update.apply(this, arguments);
47
37
 
48
- if (UriParameters.fromQuery(window.location.search).get("newChartP13n") === "true"){
49
- this._oPanel.setP13nData(this.mixInfoAndState(this._oPropHelper).items);
50
- }
38
+ this._oPanel.setP13nData(this.mixInfoAndState(this._oPropHelper).items);
39
+
51
40
  };
52
41
 
53
42
  ChartItemController.prototype.getDelta = function(mPropertyBag) {
@@ -10,7 +10,12 @@ sap.ui.define([
10
10
  "use strict";
11
11
 
12
12
  var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
13
- var ColumnController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.ColumnController");
13
+ var ColumnController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.ColumnController", {
14
+ constructor: function() {
15
+ BaseController.apply(this, arguments);
16
+ this._bResetEnabled = true;
17
+ }
18
+ });
14
19
 
15
20
  ColumnController.prototype.getUISettings = function() {
16
21
  return {
@@ -19,10 +24,6 @@ sap.ui.define([
19
24
  };
20
25
  };
21
26
 
22
- ColumnController.prototype.getResetEnabled = function() {
23
- return true;
24
- };
25
-
26
27
  ColumnController.prototype.model2State = function() {
27
28
  var aItems = [];
28
29
  this._oPanel.getP13nData(true).forEach(function(oItem){
@@ -9,17 +9,18 @@ sap.ui.define([
9
9
  ], function (FilterOperatorUtil, BaseController, P13nBuilder, FlexUtil, Log) {
10
10
  "use strict";
11
11
 
12
- var FilterController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.FilterController");
12
+ var FilterController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.FilterController", {
13
+ constructor: function() {
14
+ BaseController.apply(this, arguments);
15
+ this._bResetEnabled = true;
16
+ }
17
+ });
13
18
 
14
19
  FilterController.prototype.getCurrentState = function() {
15
20
  var oControlState = this.getAdaptationControl().getCurrentState();
16
21
  return oControlState.hasOwnProperty("filter") ? oControlState.filter : {};
17
22
  };
18
23
 
19
- FilterController.prototype.getResetEnabled = function() {
20
- return true;
21
- };
22
-
23
24
  FilterController.prototype.getUISettings = function() {
24
25
  return {
25
26
  title: sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc").getText("filter.PERSONALIZATION_DIALOG_TITLE"),
@@ -27,9 +28,15 @@ sap.ui.define([
27
28
  afterClose: function(oEvt) {
28
29
  var oDialog = oEvt.getSource();
29
30
  if (oDialog) {
30
- oDialog.removeAllContent();
31
- oDialog.destroy();
31
+ var oDialogContent = oDialog.getContent()[0];
32
+ if (oDialogContent.isA("sap.m.p13n.Container")) {
33
+ oDialogContent.removeView("Filter");
34
+ } else {
35
+ oDialog.removeAllContent();
36
+ }
32
37
  }
38
+
39
+ oDialog.destroy();
33
40
  }
34
41
  };
35
42
  };
@@ -0,0 +1,173 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ui/mdc/p13n/P13nBuilder",
9
+ "./BaseController",
10
+ "sap/ui/mdc/p13n/panels/LinkSelectionPanel",
11
+ "sap/m/library",
12
+ "sap/m/MessageBox"
13
+ ], function (P13nBuilder, BaseController, SelectionPanel, library, MessageBox) {
14
+ "use strict";
15
+
16
+ var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
17
+
18
+ var MultiSelectMode = library.MultiSelectMode;
19
+ var LinkPanelController = BaseController.extend("sap.ui.mdc.p13n.subcontroller.LinkPanelController", {
20
+ constructor: function() {
21
+ BaseController.apply(this, arguments);
22
+ this._bResetEnabled = true;
23
+ }
24
+ });
25
+
26
+ LinkPanelController.prototype.getUISettings = function() {
27
+ return {
28
+ contentWidth: "28rem",
29
+ contentHeight: "35rem",
30
+ reset: {
31
+ warningText: oResourceBundle.getText("info.SELECTION_DIALOG_RESET_WARNING")
32
+ },
33
+ title: oResourceBundle.getText("info.SELECTION_DIALOG_ALIGNEDTITLE")
34
+ };
35
+ };
36
+
37
+ LinkPanelController.prototype.getSelectorForReset = function() {
38
+ return this.getAdaptationControl().getItems().concat(this.getAdaptationControl());
39
+ };
40
+
41
+ LinkPanelController.prototype.getAdaptationUI = function(oPropertyHelper) {
42
+ var oSelectionPanel = new SelectionPanel({
43
+ fieldColumn: oResourceBundle.getText("info.SELECTION_DIALOG_COLUMNHEADER_WITHOUT_COUNT"),
44
+ enableCount: true,
45
+ linkPressed: this._onLinkPressed.bind(this)
46
+ });
47
+ var oAdaptationData = this.mixInfoAndState(oPropertyHelper);
48
+ oSelectionPanel.setP13nData(oAdaptationData.items);
49
+ oSelectionPanel.setEnableReorder(false);
50
+ oSelectionPanel.setMultiSelectMode(MultiSelectMode.Default);
51
+ this._oPanel = oSelectionPanel;
52
+ return Promise.resolve(oSelectionPanel);
53
+ };
54
+
55
+ LinkPanelController.prototype._onLinkPressed = function(oEvent) {
56
+ var oSource = oEvent.getParameter("oSource");
57
+ var sTarget = oSource.getTarget();
58
+
59
+ if (sTarget !== "_blank") {
60
+ oEvent.preventDefault();
61
+
62
+ var oPanel = this.getAdaptationControl();
63
+ var sHref = oSource.getHref();
64
+
65
+ if (oPanel.getBeforeNavigationCallback) {
66
+ oPanel.getBeforeNavigationCallback()(oEvent).then(function (bNavigate) {
67
+ if (bNavigate) {
68
+ oPanel.navigate(sHref);
69
+ }
70
+ });
71
+ } else {
72
+ MessageBox.show(sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc").getText("info.SELECTION_DIALOG_LINK_VALIDATION_QUESTION"), {
73
+ icon: MessageBox.Icon.WARNING,
74
+ title: sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc").getText("info.SELECTION_DIALOG_LINK_VALIDATION_TITLE"),
75
+ actions: [
76
+ MessageBox.Action.YES, MessageBox.Action.NO
77
+ ],
78
+ onClose: function (oAction) {
79
+ if (oAction === MessageBox.Action.YES) {
80
+ oPanel.navigate(sHref);
81
+ }
82
+ },
83
+ styleClass: this.$().closest(".sapUiSizeCompact").length ? "sapUiSizeCompact" : ""
84
+ });
85
+ }
86
+ }
87
+ };
88
+
89
+ LinkPanelController.prototype._createAddRemoveChange = function(oControl, vOperations, oContent) {
90
+ var sLinkItemId = oContent.name;
91
+
92
+ var oLinkItem = sap.ui.getCore().byId(sLinkItemId);
93
+
94
+ var aChanges = [];
95
+
96
+ if (!oLinkItem) {
97
+ aChanges.push({
98
+ selectorElement: oControl,
99
+ changeSpecificData: {
100
+ changeType: "createItem",
101
+ content: {
102
+ selector: sLinkItemId
103
+ }
104
+ }
105
+ });
106
+ } else {
107
+ aChanges.push({
108
+ selectorElement: oLinkItem,
109
+ changeSpecificData: {
110
+ changeType: vOperations === "hideItem" ? "hideItem" : "revealItem",
111
+ content: {}
112
+ }
113
+ });
114
+ }
115
+
116
+ return aChanges;
117
+ };
118
+
119
+ LinkPanelController.prototype.mixInfoAndState = function(oPropertyHelper) {
120
+
121
+ var aItemState = this.getCurrentState();
122
+ var mExistingLinkItems = P13nBuilder.arrayToMap(aItemState);
123
+
124
+ var oP13nData = P13nBuilder.prepareAdaptationData(oPropertyHelper, function(mItem, oProperty){
125
+
126
+ var oExistingLinkItem = mExistingLinkItems[oProperty.name];
127
+ mItem.visible = oExistingLinkItem ? true : false;
128
+ mItem.position = oExistingLinkItem ? oExistingLinkItem.position : -1;
129
+ mItem.href = oProperty.href;
130
+ mItem.description = oProperty.description;
131
+ mItem.target = oProperty.target;
132
+ mItem.text = oProperty.text;
133
+ //mItem.icon = oProperty.icon;
134
+
135
+ return true;
136
+ });
137
+
138
+ P13nBuilder.sortP13nData({
139
+ visible: "visible",
140
+ position: "position"
141
+ }, oP13nData.items);
142
+
143
+ oP13nData.presenceAttribute = this._getPresenceAttribute();
144
+
145
+ oP13nData.items.forEach(function(oItem){delete oItem.position;});
146
+
147
+ return oP13nData;
148
+ };
149
+
150
+ LinkPanelController.prototype._createMoveChange = function(sId, sPropertyName, iNewIndex, sMoveOperation, oControl, bPersistId) {
151
+ return {
152
+ selectorElement: oControl,
153
+ changeSpecificData: {
154
+ changeType: sMoveOperation,
155
+ content: {
156
+ index: iNewIndex,
157
+ name: sPropertyName
158
+ }
159
+ }
160
+ };
161
+ };
162
+
163
+ LinkPanelController.prototype.getChangeOperations = function() {
164
+ return {
165
+ add: ["createItem", "revealItem"],
166
+ remove: "hideItem",
167
+ move: "moveItem"
168
+ };
169
+ };
170
+
171
+ return LinkPanelController;
172
+
173
+ });