@openui5/sap.m 1.103.1 → 1.106.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 (494) hide show
  1. package/.eslintrc.json +2 -3
  2. package/.reuse/dep5 +35 -15
  3. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
  4. package/THIRDPARTY.txt +64 -21
  5. package/package.json +4 -4
  6. package/src/sap/m/.library +17 -1
  7. package/src/sap/m/AccButton.js +1 -1
  8. package/src/sap/m/ActionListItem.js +1 -1
  9. package/src/sap/m/ActionSelect.js +1 -1
  10. package/src/sap/m/ActionSheet.js +1 -1
  11. package/src/sap/m/App.js +2 -3
  12. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  13. package/src/sap/m/Avatar.js +2 -2
  14. package/src/sap/m/BadgeEnabler.js +1 -2
  15. package/src/sap/m/Bar.js +11 -10
  16. package/src/sap/m/Breadcrumbs.js +2 -2
  17. package/src/sap/m/BusyDialog.js +1 -1
  18. package/src/sap/m/BusyIndicator.js +1 -1
  19. package/src/sap/m/Button.js +49 -10
  20. package/src/sap/m/ButtonRenderer.js +10 -2
  21. package/src/sap/m/Carousel.js +3 -4
  22. package/src/sap/m/CarouselLayout.js +1 -1
  23. package/src/sap/m/CarouselRenderer.js +3 -3
  24. package/src/sap/m/CheckBox.js +46 -6
  25. package/src/sap/m/CheckBoxRenderer.js +1 -0
  26. package/src/sap/m/ColorPalette.js +1 -1
  27. package/src/sap/m/ColorPalettePopover.js +1 -1
  28. package/src/sap/m/Column.js +5 -5
  29. package/src/sap/m/ColumnHeaderPopover.js +5 -7
  30. package/src/sap/m/ColumnListItem.js +1 -4
  31. package/src/sap/m/ColumnListItemRenderer.js +1 -2
  32. package/src/sap/m/ColumnPopoverActionItem.js +3 -3
  33. package/src/sap/m/ColumnPopoverCustomItem.js +3 -3
  34. package/src/sap/m/ColumnPopoverItem.js +3 -3
  35. package/src/sap/m/ColumnPopoverSelectListItem.js +3 -5
  36. package/src/sap/m/ColumnPopoverSortItem.js +3 -3
  37. package/src/sap/m/ComboBox.js +6 -5
  38. package/src/sap/m/ComboBoxBase.js +3 -7
  39. package/src/sap/m/ComboBoxBaseRenderer.js +2 -2
  40. package/src/sap/m/ComboBoxTextField.js +1 -7
  41. package/src/sap/m/ComboBoxTextFieldRenderer.js +19 -4
  42. package/src/sap/m/CustomDynamicDateOption.js +1 -1
  43. package/src/sap/m/CustomListItem.js +1 -1
  44. package/src/sap/m/CustomTile.js +1 -1
  45. package/src/sap/m/CustomTreeItem.js +3 -3
  46. package/src/sap/m/CustomTreeItemRenderer.js +2 -2
  47. package/src/sap/m/DatePicker.js +16 -26
  48. package/src/sap/m/DateRangeSelection.js +45 -38
  49. package/src/sap/m/DateTimeField.js +87 -20
  50. package/src/sap/m/DateTimeInput.js +1 -1
  51. package/src/sap/m/DateTimePicker.js +58 -32
  52. package/src/sap/m/DateTimePickerRenderer.js +1 -1
  53. package/src/sap/m/Dialog.js +44 -2
  54. package/src/sap/m/DisplayListItem.js +1 -1
  55. package/src/sap/m/DraftIndicator.js +1 -1
  56. package/src/sap/m/DynamicDate.js +1 -1
  57. package/src/sap/m/DynamicDateFormat.js +2 -5
  58. package/src/sap/m/DynamicDateOption.js +43 -16
  59. package/src/sap/m/DynamicDateRange.js +49 -7
  60. package/src/sap/m/DynamicDateRangeRenderer.js +5 -2
  61. package/src/sap/m/DynamicDateUtil.js +23 -2
  62. package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
  63. package/src/sap/m/ExpandableText.js +1 -1
  64. package/src/sap/m/FacetFilter.js +2 -2
  65. package/src/sap/m/FacetFilterItem.js +1 -1
  66. package/src/sap/m/FacetFilterList.js +4 -4
  67. package/src/sap/m/FeedContent.js +1 -1
  68. package/src/sap/m/FeedInput.js +1 -1
  69. package/src/sap/m/FeedListItem.js +1 -1
  70. package/src/sap/m/FeedListItemAction.js +1 -1
  71. package/src/sap/m/Fiori20Adapter.js +2 -2
  72. package/src/sap/m/FlexBox.js +1 -1
  73. package/src/sap/m/FlexItemData.js +1 -1
  74. package/src/sap/m/FormattedText.js +1 -1
  75. package/src/sap/m/GenericTag.js +1 -1
  76. package/src/sap/m/GenericTile.js +116 -23
  77. package/src/sap/m/GenericTileLineModeRenderer.js +4 -4
  78. package/src/sap/m/GenericTileRenderer.js +23 -10
  79. package/src/sap/m/GroupHeaderListItem.js +1 -1
  80. package/src/sap/m/GrowingEnablement.js +60 -36
  81. package/src/sap/m/GrowingList.js +1 -1
  82. package/src/sap/m/HBox.js +1 -1
  83. package/src/sap/m/HeaderContainer.js +34 -32
  84. package/src/sap/m/HeaderContainerItemNavigator.js +3 -6
  85. package/src/sap/m/IconTabBar.js +54 -22
  86. package/src/sap/m/IconTabBarSelectList.js +1 -1
  87. package/src/sap/m/IconTabFilter.js +1 -1
  88. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  89. package/src/sap/m/IconTabHeader.js +6 -19
  90. package/src/sap/m/IconTabSeparator.js +1 -1
  91. package/src/sap/m/IllustratedMessage.js +98 -25
  92. package/src/sap/m/IllustratedMessageRenderer.js +10 -6
  93. package/src/sap/m/Illustration.js +8 -1
  94. package/src/sap/m/IllustrationPool.js +1 -0
  95. package/src/sap/m/IllustrationRenderer.js +2 -1
  96. package/src/sap/m/Image.js +73 -3
  97. package/src/sap/m/ImageContent.js +1 -1
  98. package/src/sap/m/ImageRenderer.js +66 -2
  99. package/src/sap/m/Input.js +62 -7
  100. package/src/sap/m/InputBase.js +1 -1
  101. package/src/sap/m/InputBaseRenderer.js +2 -2
  102. package/src/sap/m/InputListItem.js +1 -1
  103. package/src/sap/m/InputRenderer.js +4 -0
  104. package/src/sap/m/InstanceManager.js +6 -6
  105. package/src/sap/m/Label.js +34 -4
  106. package/src/sap/m/LabelRenderer.js +7 -2
  107. package/src/sap/m/LightBox.js +2 -2
  108. package/src/sap/m/LightBoxItem.js +1 -1
  109. package/src/sap/m/Link.js +74 -10
  110. package/src/sap/m/LinkRenderer.js +26 -12
  111. package/src/sap/m/List.js +38 -1
  112. package/src/sap/m/ListBase.js +109 -44
  113. package/src/sap/m/ListBaseRenderer.js +7 -15
  114. package/src/sap/m/ListItemBase.js +40 -11
  115. package/src/sap/m/ListItemBaseRenderer.js +17 -6
  116. package/src/sap/m/ListRenderer.js +2 -2
  117. package/src/sap/m/MaskEnabler.js +52 -2
  118. package/src/sap/m/MaskInput.js +23 -1
  119. package/src/sap/m/MaskInputRule.js +1 -1
  120. package/src/sap/m/Menu.js +1 -1
  121. package/src/sap/m/MenuButton.js +1 -1
  122. package/src/sap/m/MenuItem.js +1 -1
  123. package/src/sap/m/MenuListItem.js +1 -1
  124. package/src/sap/m/MessageBox.js +1 -1
  125. package/src/sap/m/MessageItem.js +3 -4
  126. package/src/sap/m/MessageListItem.js +10 -6
  127. package/src/sap/m/MessagePage.js +1 -1
  128. package/src/sap/m/MessagePopover.js +4 -1
  129. package/src/sap/m/MessagePopoverItem.js +1 -1
  130. package/src/sap/m/MessageStrip.js +1 -1
  131. package/src/sap/m/MessageToast.js +1 -1
  132. package/src/sap/m/MessageView.js +1 -1
  133. package/src/sap/m/MultiComboBox.js +5 -16
  134. package/src/sap/m/MultiEditField.js +1 -1
  135. package/src/sap/m/MultiInput.js +1 -15
  136. package/src/sap/m/NavContainer.js +21 -19
  137. package/src/sap/m/NewsContent.js +2 -3
  138. package/src/sap/m/NotificationList.js +1 -1
  139. package/src/sap/m/NotificationListBase.js +1 -1
  140. package/src/sap/m/NotificationListGroup.js +3 -7
  141. package/src/sap/m/NotificationListGroupRenderer.js +1 -1
  142. package/src/sap/m/NotificationListItem.js +1 -1
  143. package/src/sap/m/NumericContent.js +1 -1
  144. package/src/sap/m/NumericInput.js +1 -1
  145. package/src/sap/m/ObjectAttribute.js +1 -1
  146. package/src/sap/m/ObjectHeader.js +3 -3
  147. package/src/sap/m/ObjectIdentifier.js +8 -5
  148. package/src/sap/m/ObjectListItem.js +7 -1
  149. package/src/sap/m/ObjectMarker.js +1 -1
  150. package/src/sap/m/ObjectNumber.js +2 -3
  151. package/src/sap/m/ObjectNumberRenderer.js +10 -3
  152. package/src/sap/m/ObjectStatus.js +2 -3
  153. package/src/sap/m/ObjectStatusRenderer.js +2 -2
  154. package/src/sap/m/OverflowToolbar.js +3 -8
  155. package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
  156. package/src/sap/m/OverflowToolbarAssociativePopoverControls.js +3 -8
  157. package/src/sap/m/OverflowToolbarAssociativePopoverRenderer.js +2 -2
  158. package/src/sap/m/OverflowToolbarButton.js +2 -2
  159. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  160. package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
  161. package/src/sap/m/P13nAnyFilterItem.js +3 -3
  162. package/src/sap/m/P13nColumnsItem.js +3 -3
  163. package/src/sap/m/P13nColumnsPanel.js +3 -3
  164. package/src/sap/m/P13nConditionPanel.js +10 -3
  165. package/src/sap/m/P13nDialog.js +3 -3
  166. package/src/sap/m/P13nDimMeasureItem.js +3 -3
  167. package/src/sap/m/P13nDimMeasurePanel.js +3 -3
  168. package/src/sap/m/P13nFilterItem.js +3 -3
  169. package/src/sap/m/P13nFilterPanel.js +3 -3
  170. package/src/sap/m/P13nGroupItem.js +3 -3
  171. package/src/sap/m/P13nGroupPanel.js +3 -3
  172. package/src/sap/m/P13nItem.js +3 -3
  173. package/src/sap/m/P13nOperationsHelper.js +2 -2
  174. package/src/sap/m/P13nPanel.js +3 -3
  175. package/src/sap/m/P13nSelectionItem.js +3 -3
  176. package/src/sap/m/P13nSelectionPanel.js +3 -3
  177. package/src/sap/m/P13nSortItem.js +3 -3
  178. package/src/sap/m/P13nSortPanel.js +3 -3
  179. package/src/sap/m/PDFViewer.js +2 -2
  180. package/src/sap/m/PDFViewerRenderer.js +1 -0
  181. package/src/sap/m/Page.js +1 -3
  182. package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
  183. package/src/sap/m/PagingButton.js +1 -1
  184. package/src/sap/m/Panel.js +1 -1
  185. package/src/sap/m/PlanningCalendar.js +4 -16
  186. package/src/sap/m/PlanningCalendarHeader.js +1 -5
  187. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  188. package/src/sap/m/PlanningCalendarRow.js +1 -1
  189. package/src/sap/m/PlanningCalendarView.js +1 -1
  190. package/src/sap/m/Popover.js +11 -4
  191. package/src/sap/m/ProgressIndicator.js +1 -1
  192. package/src/sap/m/ProgressIndicatorRenderer.js +6 -3
  193. package/src/sap/m/PullToRefresh.js +1 -1
  194. package/src/sap/m/QuickView.js +3 -3
  195. package/src/sap/m/QuickViewBase.js +3 -3
  196. package/src/sap/m/QuickViewCard.js +3 -3
  197. package/src/sap/m/QuickViewGroup.js +1 -1
  198. package/src/sap/m/QuickViewGroupElement.js +3 -3
  199. package/src/sap/m/QuickViewPage.js +3 -3
  200. package/src/sap/m/RadioButton.js +47 -20
  201. package/src/sap/m/RadioButtonGroup.js +29 -26
  202. package/src/sap/m/RangeSlider.js +1 -3
  203. package/src/sap/m/RatingIndicator.js +8 -1
  204. package/src/sap/m/RatingIndicatorRenderer.js +13 -4
  205. package/src/sap/m/ResponsivePopover.js +3 -3
  206. package/src/sap/m/ResponsiveScale.js +1 -1
  207. package/src/sap/m/ScrollBar.js +1 -1
  208. package/src/sap/m/ScrollContainer.js +1 -1
  209. package/src/sap/m/SearchField.js +1 -1
  210. package/src/sap/m/SearchFieldRenderer.js +1 -0
  211. package/src/sap/m/SegmentedButton.js +1 -1
  212. package/src/sap/m/SegmentedButtonItem.js +1 -1
  213. package/src/sap/m/Select.js +8 -14
  214. package/src/sap/m/SelectDialog.js +2 -1
  215. package/src/sap/m/SelectDialogBase.js +1 -1
  216. package/src/sap/m/SelectList.js +1 -1
  217. package/src/sap/m/SelectListRenderer.js +2 -2
  218. package/src/sap/m/SelectionDetails.js +2 -2
  219. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  220. package/src/sap/m/SelectionDetailsItem.js +1 -1
  221. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  222. package/src/sap/m/Shell.js +1 -1
  223. package/src/sap/m/SimpleFixFlex.js +1 -1
  224. package/src/sap/m/SinglePlanningCalendar.js +7 -9
  225. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  226. package/src/sap/m/SinglePlanningCalendarGrid.js +1 -7
  227. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
  228. package/src/sap/m/SinglePlanningCalendarMonthGridRenderer.js +0 -2
  229. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  230. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  231. package/src/sap/m/SinglePlanningCalendarWeekView.js +12 -13
  232. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  233. package/src/sap/m/SlideTile.js +30 -5
  234. package/src/sap/m/Slider.js +1 -1
  235. package/src/sap/m/SliderTooltip.js +1 -3
  236. package/src/sap/m/SliderTooltipBase.js +1 -1
  237. package/src/sap/m/SliderTooltipBaseRenderer.js +2 -2
  238. package/src/sap/m/SliderTooltipContainer.js +1 -1
  239. package/src/sap/m/SliderTooltipContainerRenderer.js +2 -2
  240. package/src/sap/m/SliderTooltipRenderer.js +2 -2
  241. package/src/sap/m/SplitApp.js +1 -1
  242. package/src/sap/m/SplitButton.js +1 -3
  243. package/src/sap/m/SplitContainer.js +3 -7
  244. package/src/sap/m/StandardDynamicDateOption.js +9 -15
  245. package/src/sap/m/StandardListItem.js +1 -1
  246. package/src/sap/m/StandardListItemRenderer.js +2 -2
  247. package/src/sap/m/StandardTile.js +1 -1
  248. package/src/sap/m/StandardTreeItem.js +1 -1
  249. package/src/sap/m/StepInput.js +1 -1
  250. package/src/sap/m/SuggestionItem.js +1 -1
  251. package/src/sap/m/SuggestionsPopover.js +4 -2
  252. package/src/sap/m/Switch.js +1 -1
  253. package/src/sap/m/TabContainer.js +1 -1
  254. package/src/sap/m/TabContainerItem.js +1 -1
  255. package/src/sap/m/TabStrip.js +1 -1
  256. package/src/sap/m/TabStripItem.js +1 -1
  257. package/src/sap/m/Table.js +11 -9
  258. package/src/sap/m/TablePersoController.js +1 -1
  259. package/src/sap/m/TablePersoDialog.js +6 -15
  260. package/src/sap/m/TablePersoProvider.js +1 -1
  261. package/src/sap/m/TableRenderer.js +2 -9
  262. package/src/sap/m/TableSelectDialog.js +1 -1
  263. package/src/sap/m/Text.js +1 -1
  264. package/src/sap/m/TextArea.js +1 -1
  265. package/src/sap/m/TextAreaRenderer.js +1 -2
  266. package/src/sap/m/Tile.js +1 -1
  267. package/src/sap/m/TileContainer.js +1 -1
  268. package/src/sap/m/TileContent.js +8 -9
  269. package/src/sap/m/TileContentRenderer.js +3 -3
  270. package/src/sap/m/TimePicker.js +45 -8
  271. package/src/sap/m/TimePickerClock.js +2 -3
  272. package/src/sap/m/TimePickerClocks.js +5 -3
  273. package/src/sap/m/TimePickerClocksRenderer.js +4 -2
  274. package/src/sap/m/TimePickerInputs.js +1 -1
  275. package/src/sap/m/TimePickerInputsRenderer.js +1 -1
  276. package/src/sap/m/TimePickerInternals.js +1 -1
  277. package/src/sap/m/TimePickerSlider.js +1 -1
  278. package/src/sap/m/TimePickerSliders.js +3 -5
  279. package/src/sap/m/Title.js +1 -1
  280. package/src/sap/m/TitlePropagationSupport.js +1 -1
  281. package/src/sap/m/ToggleButton.js +2 -2
  282. package/src/sap/m/Token.js +1 -3
  283. package/src/sap/m/Tokenizer.js +1 -1
  284. package/src/sap/m/Toolbar.js +1 -1
  285. package/src/sap/m/ToolbarLayoutData.js +1 -1
  286. package/src/sap/m/ToolbarSeparator.js +1 -1
  287. package/src/sap/m/ToolbarSpacer.js +1 -1
  288. package/src/sap/m/Tree.js +8 -1
  289. package/src/sap/m/TreeItemBase.js +1 -1
  290. package/src/sap/m/TreeRenderer.js +0 -10
  291. package/src/sap/m/UploadCollection.js +2 -2
  292. package/src/sap/m/UploadCollectionItem.js +1 -1
  293. package/src/sap/m/UploadCollectionParameter.js +1 -1
  294. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
  295. package/src/sap/m/VBox.js +1 -1
  296. package/src/sap/m/ValueStateHeader.js +1 -1
  297. package/src/sap/m/VariantItem.js +160 -0
  298. package/src/sap/m/VariantManagement.js +717 -571
  299. package/src/sap/m/ViewSettingsCustomItem.js +1 -1
  300. package/src/sap/m/ViewSettingsCustomTab.js +1 -1
  301. package/src/sap/m/ViewSettingsDialog.js +1 -1
  302. package/src/sap/m/ViewSettingsFilterItem.js +1 -1
  303. package/src/sap/m/ViewSettingsItem.js +1 -1
  304. package/src/sap/m/VisibleItem.js +1 -1
  305. package/src/sap/m/WheelSlider.js +1 -1
  306. package/src/sap/m/WheelSliderContainer.js +1 -1
  307. package/src/sap/m/Wizard.js +10 -3
  308. package/src/sap/m/WizardProgressNavigator.js +1 -1
  309. package/src/sap/m/WizardStep.js +3 -1
  310. package/src/sap/m/_thirdparty/purify.js +1622 -0
  311. package/src/sap/m/changeHandler/AddTableColumn.js +12 -13
  312. package/src/sap/m/changeHandler/ChangeLinkTarget.js +2 -3
  313. package/src/sap/m/changeHandler/CombineButtons.js +19 -22
  314. package/src/sap/m/changeHandler/MoveTableColumns.js +6 -6
  315. package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +5 -5
  316. package/src/sap/m/changeHandler/SplitMenuButton.js +7 -6
  317. package/src/sap/m/delegate/DateNavigation.js +0 -4
  318. package/src/sap/m/designtime/Link.designtime.js +19 -11
  319. package/src/sap/m/designtime/VariantManagement.designtime.js +36 -26
  320. package/src/sap/m/flexibility/EngineFlex.js +48 -0
  321. package/src/sap/m/inputUtils/selectionRange.js +1 -2
  322. package/src/sap/m/library.js +60 -7
  323. package/src/sap/m/messagebundle.properties +57 -6
  324. package/src/sap/m/messagebundle_ar.properties +39 -9
  325. package/src/sap/m/messagebundle_bg.properties +33 -3
  326. package/src/sap/m/messagebundle_ca.properties +32 -2
  327. package/src/sap/m/messagebundle_cs.properties +32 -2
  328. package/src/sap/m/messagebundle_cy.properties +34 -4
  329. package/src/sap/m/messagebundle_da.properties +32 -2
  330. package/src/sap/m/messagebundle_de.properties +32 -2
  331. package/src/sap/m/messagebundle_el.properties +35 -5
  332. package/src/sap/m/messagebundle_en.properties +34 -4
  333. package/src/sap/m/messagebundle_en_GB.properties +34 -4
  334. package/src/sap/m/messagebundle_en_US_sappsd.properties +33 -3
  335. package/src/sap/m/messagebundle_en_US_saprigi.properties +31 -3
  336. package/src/sap/m/messagebundle_en_US_saptrc.properties +33 -3
  337. package/src/sap/m/messagebundle_es.properties +33 -3
  338. package/src/sap/m/messagebundle_es_MX.properties +32 -2
  339. package/src/sap/m/messagebundle_et.properties +32 -2
  340. package/src/sap/m/messagebundle_fi.properties +36 -6
  341. package/src/sap/m/messagebundle_fr.properties +33 -3
  342. package/src/sap/m/messagebundle_fr_CA.properties +34 -4
  343. package/src/sap/m/messagebundle_hi.properties +34 -4
  344. package/src/sap/m/messagebundle_hr.properties +36 -6
  345. package/src/sap/m/messagebundle_hu.properties +34 -4
  346. package/src/sap/m/messagebundle_id.properties +34 -4
  347. package/src/sap/m/messagebundle_it.properties +33 -3
  348. package/src/sap/m/messagebundle_iw.properties +34 -4
  349. package/src/sap/m/messagebundle_ja.properties +33 -3
  350. package/src/sap/m/messagebundle_kk.properties +32 -2
  351. package/src/sap/m/messagebundle_ko.properties +40 -10
  352. package/src/sap/m/messagebundle_lt.properties +32 -2
  353. package/src/sap/m/messagebundle_lv.properties +32 -2
  354. package/src/sap/m/messagebundle_ms.properties +33 -3
  355. package/src/sap/m/messagebundle_nl.properties +46 -16
  356. package/src/sap/m/messagebundle_no.properties +34 -4
  357. package/src/sap/m/messagebundle_pl.properties +33 -3
  358. package/src/sap/m/messagebundle_pt.properties +37 -7
  359. package/src/sap/m/messagebundle_pt_PT.properties +32 -2
  360. package/src/sap/m/messagebundle_ro.properties +33 -3
  361. package/src/sap/m/messagebundle_ru.properties +33 -3
  362. package/src/sap/m/messagebundle_sh.properties +33 -3
  363. package/src/sap/m/messagebundle_sk.properties +32 -2
  364. package/src/sap/m/messagebundle_sl.properties +33 -3
  365. package/src/sap/m/messagebundle_sv.properties +32 -2
  366. package/src/sap/m/messagebundle_th.properties +65 -35
  367. package/src/sap/m/messagebundle_tr.properties +36 -6
  368. package/src/sap/m/messagebundle_uk.properties +33 -3
  369. package/src/sap/m/messagebundle_vi.properties +33 -3
  370. package/src/sap/m/messagebundle_zh_CN.properties +33 -3
  371. package/src/sap/m/messagebundle_zh_TW.properties +32 -2
  372. package/src/sap/m/p13n/AbstractContainer.js +7 -7
  373. package/src/sap/m/p13n/AbstractContainerItem.js +4 -4
  374. package/src/sap/m/p13n/BasePanel.js +24 -13
  375. package/src/sap/m/p13n/Container.js +3 -3
  376. package/src/sap/m/p13n/Engine.js +1254 -0
  377. package/src/sap/m/p13n/FlexUtil.js +161 -0
  378. package/src/sap/m/p13n/GroupController.js +145 -0
  379. package/src/sap/m/p13n/GroupPanel.js +12 -5
  380. package/src/sap/m/p13n/MetadataHelper.js +35 -0
  381. package/src/sap/m/p13n/PersistenceProvider.js +160 -0
  382. package/src/sap/m/p13n/Popup.js +49 -12
  383. package/src/sap/m/p13n/QueryPanel.js +3 -3
  384. package/src/sap/m/p13n/SelectionController.js +548 -0
  385. package/src/sap/m/p13n/SelectionPanel.js +23 -5
  386. package/src/sap/m/p13n/SortController.js +153 -0
  387. package/src/sap/m/p13n/SortPanel.js +15 -5
  388. package/src/sap/m/p13n/enum/PersistenceMode.js +43 -0
  389. package/src/sap/m/p13n/handler/xConfigHandler.js +166 -0
  390. package/src/sap/m/p13n/modification/FlexModificationHandler.js +90 -0
  391. package/src/sap/m/p13n/modification/LocalStorageModificationHandler.js +75 -0
  392. package/src/sap/m/p13n/modification/ModificationHandler.js +143 -0
  393. package/src/sap/m/p13n/modules/AdaptationProvider.js +67 -0
  394. package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +147 -0
  395. package/src/sap/m/p13n/modules/StateHandlerRegistry.js +101 -0
  396. package/src/sap/m/p13n/modules/UIManager.js +230 -0
  397. package/src/sap/m/p13n/modules/xConfigAPI.js +288 -0
  398. package/src/sap/m/plugins/CellSelector.js +741 -0
  399. package/src/sap/m/plugins/ColumnResizer.js +15 -1
  400. package/src/sap/m/plugins/DataStateIndicator.js +2 -2
  401. package/src/sap/m/plugins/PasteProvider.js +1 -1
  402. package/src/sap/m/plugins/PluginBase.js +4 -3
  403. package/src/sap/m/rules/CheckBox.support.js +1 -1
  404. package/src/sap/m/rules/Image.support.js +1 -1
  405. package/src/sap/m/rules/Link.support.js +1 -1
  406. package/src/sap/m/rules/MessagePage.support.js +1 -1
  407. package/src/sap/m/rules/ObjectHeader.support.js +6 -6
  408. package/src/sap/m/rules/ObjectListItem.support.js +1 -1
  409. package/src/sap/m/rules/ObjectMarker.support.js +1 -1
  410. package/src/sap/m/rules/ObjectStatus.support.js +1 -1
  411. package/src/sap/m/rules/Panel.support.js +1 -1
  412. package/src/sap/m/rules/Select.support.js +1 -1
  413. package/src/sap/m/rules/Table.support.js +3 -3
  414. package/src/sap/m/semantic/AddAction.js +1 -1
  415. package/src/sap/m/semantic/CancelAction.js +1 -1
  416. package/src/sap/m/semantic/DeleteAction.js +1 -1
  417. package/src/sap/m/semantic/DetailPage.js +1 -1
  418. package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
  419. package/src/sap/m/semantic/EditAction.js +1 -1
  420. package/src/sap/m/semantic/FavoriteAction.js +1 -1
  421. package/src/sap/m/semantic/FilterAction.js +1 -1
  422. package/src/sap/m/semantic/FilterSelect.js +1 -1
  423. package/src/sap/m/semantic/FlagAction.js +1 -1
  424. package/src/sap/m/semantic/ForwardAction.js +1 -1
  425. package/src/sap/m/semantic/FullscreenPage.js +1 -1
  426. package/src/sap/m/semantic/GroupAction.js +1 -1
  427. package/src/sap/m/semantic/GroupSelect.js +1 -1
  428. package/src/sap/m/semantic/MainAction.js +1 -1
  429. package/src/sap/m/semantic/MasterPage.js +1 -1
  430. package/src/sap/m/semantic/MessagesIndicator.js +1 -1
  431. package/src/sap/m/semantic/MultiSelectAction.js +1 -1
  432. package/src/sap/m/semantic/NegativeAction.js +1 -1
  433. package/src/sap/m/semantic/OpenInAction.js +1 -1
  434. package/src/sap/m/semantic/PositiveAction.js +1 -1
  435. package/src/sap/m/semantic/PrintAction.js +1 -1
  436. package/src/sap/m/semantic/SaveAction.js +1 -1
  437. package/src/sap/m/semantic/Segment.js +1 -1
  438. package/src/sap/m/semantic/SegmentedContainer.js +1 -1
  439. package/src/sap/m/semantic/SemanticButton.js +1 -1
  440. package/src/sap/m/semantic/SemanticConfiguration.js +3 -4
  441. package/src/sap/m/semantic/SemanticControl.js +1 -1
  442. package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
  443. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
  444. package/src/sap/m/semantic/SemanticPage.js +1 -1
  445. package/src/sap/m/semantic/SemanticSelect.js +1 -1
  446. package/src/sap/m/semantic/SemanticToggleButton.js +1 -3
  447. package/src/sap/m/semantic/SendEmailAction.js +1 -1
  448. package/src/sap/m/semantic/SendMessageAction.js +1 -1
  449. package/src/sap/m/semantic/ShareInJamAction.js +1 -1
  450. package/src/sap/m/semantic/ShareMenu.js +1 -1
  451. package/src/sap/m/semantic/ShareMenuPage.js +1 -1
  452. package/src/sap/m/semantic/SortAction.js +1 -1
  453. package/src/sap/m/semantic/SortSelect.js +1 -1
  454. package/src/sap/m/table/Util.js +30 -11
  455. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  456. package/src/sap/m/table/columnmenu/Entry.js +1 -1
  457. package/src/sap/m/table/columnmenu/Item.js +1 -1
  458. package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
  459. package/src/sap/m/table/columnmenu/Menu.js +50 -13
  460. package/src/sap/m/table/columnmenu/QuickAction.js +16 -8
  461. package/src/sap/m/table/columnmenu/QuickActionBase.js +18 -3
  462. package/src/sap/m/table/columnmenu/QuickActionItem.js +5 -6
  463. package/src/sap/m/table/columnmenu/QuickGroup.js +29 -5
  464. package/src/sap/m/table/columnmenu/QuickGroupItem.js +13 -1
  465. package/src/sap/m/table/columnmenu/QuickSort.js +1 -3
  466. package/src/sap/m/table/columnmenu/QuickSortItem.js +8 -7
  467. package/src/sap/m/table/columnmenu/QuickTotal.js +29 -5
  468. package/src/sap/m/table/columnmenu/QuickTotalItem.js +13 -1
  469. package/src/sap/m/themes/base/Breadcrumbs.less +6 -0
  470. package/src/sap/m/themes/base/Button.less +0 -1
  471. package/src/sap/m/themes/base/Carousel.less +8 -8
  472. package/src/sap/m/themes/base/CellSelector.less +9 -0
  473. package/src/sap/m/themes/base/CheckBox.less +1 -0
  474. package/src/sap/m/themes/base/Dialog.less +1 -0
  475. package/src/sap/m/themes/base/DisplayListItem.less +3 -3
  476. package/src/sap/m/themes/base/DynamicDateRange.less +4 -0
  477. package/src/sap/m/themes/base/FeedContent.less +13 -5
  478. package/src/sap/m/themes/base/GenericTile.less +56 -9
  479. package/src/sap/m/themes/base/IllustratedMessage.less +7 -0
  480. package/src/sap/m/themes/base/NewsContent.less +6 -0
  481. package/src/sap/m/themes/base/NumericContent.less +1 -1
  482. package/src/sap/m/themes/base/ObjectStatus.less +2 -1
  483. package/src/sap/m/themes/base/OverflowToolbarAssociativePopover.less +5 -1
  484. package/src/sap/m/themes/base/SelectList.less +0 -5
  485. package/src/sap/m/themes/base/SinglePlanningCalendarGrid.less +7 -0
  486. package/src/sap/m/themes/base/SlideTile.less +35 -4
  487. package/src/sap/m/themes/base/Table.less +11 -2
  488. package/src/sap/m/themes/base/TileContent.less +17 -0
  489. package/src/sap/m/themes/base/library.source.less +1 -0
  490. package/src/sap/m/upload/UploadSet.js +300 -23
  491. package/src/sap/m/upload/UploadSetItem.js +18 -7
  492. package/src/sap/m/upload/UploadSetRenderer.js +8 -16
  493. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
  494. package/src/sap/m/upload/Uploader.js +1 -2
@@ -1,23 +1,23 @@
1
- /*
2
- * ! OpenUI5
1
+ /*!
2
+ * OpenUI5
3
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
 
7
7
  // Provides control sap.m.VariantManagement.
8
8
  sap.ui.define([
9
- "sap/ui/model/Context",
10
- "sap/ui/model/PropertyBinding",
11
9
  "sap/ui/model/json/JSONModel",
10
+ "sap/ui/model/base/ManagedObjectModel",
12
11
  "sap/ui/model/Filter",
13
12
  "sap/ui/model/FilterOperator",
13
+ 'sap/ui/base/ManagedObjectObserver',
14
14
  "sap/ui/Device",
15
15
  "sap/ui/core/InvisibleText",
16
16
  "sap/ui/core/Control",
17
17
  "sap/ui/core/Icon",
18
+ "sap/ui/core/Item",
18
19
  "sap/ui/layout/HorizontalLayout",
19
20
  "sap/ui/layout/Grid",
20
- 'sap/base/Log',
21
21
  "sap/m/SearchField",
22
22
  "sap/m/RadioButton",
23
23
  "sap/m/ColumnListItem",
@@ -43,21 +43,22 @@ sap.ui.define([
43
43
  "sap/m/VBox",
44
44
  'sap/m/HBox',
45
45
  "sap/ui/events/KeyCodes",
46
+ 'sap/base/Log',
46
47
  "sap/ui/core/library",
47
48
  "sap/m/library"
48
49
  ], function(
49
- Context,
50
- PropertyBinding,
51
50
  JSONModel,
51
+ ManagedObjectModel,
52
52
  Filter,
53
53
  FilterOperator,
54
+ ManagedObjectObserver,
54
55
  Device,
55
56
  InvisibleText,
56
57
  Control,
57
58
  Icon,
59
+ Item,
58
60
  HorizontalLayout,
59
61
  Grid,
60
- Log,
61
62
  SearchField,
62
63
  RadioButton,
63
64
  ColumnListItem,
@@ -83,6 +84,7 @@ sap.ui.define([
83
84
  VBox,
84
85
  HBox,
85
86
  KeyCodes,
87
+ Log,
86
88
  coreLibrary,
87
89
  mobileLibrary
88
90
  ) {
@@ -94,6 +96,9 @@ sap.ui.define([
94
96
  // shortcut for sap.m.ButtonType
95
97
  var ButtonType = mobileLibrary.ButtonType;
96
98
 
99
+ // shortcut for sap.m.FlexAlignItems
100
+ var FlexAlignItems = mobileLibrary.FlexAlignItems;
101
+
97
102
  // shortcut for sap.m.PlacementType
98
103
  var PlacementType = mobileLibrary.PlacementType;
99
104
 
@@ -103,12 +108,17 @@ sap.ui.define([
103
108
  // shortcut for sap.m.ScreenSize
104
109
  var ScreenSize = mobileLibrary.ScreenSize;
105
110
 
111
+ var ListKeyboardMode = mobileLibrary.ListKeyboardMode;
112
+
106
113
  // shortcut for sap.ui.core.ValueState
107
114
  var ValueState = coreLibrary.ValueState;
108
115
 
109
116
  // shortcut for sap.ui.core.TextAlign
110
117
  var TextAlign = coreLibrary.TextAlign;
111
118
 
119
+ // shortcut for sap.ui.core.TitleLevel
120
+ var TitleLevel = coreLibrary.TitleLevel;
121
+
112
122
  /**
113
123
  * Constructor for a new <code>VariantManagement</code>.
114
124
  * @param {string} [sId] - ID for the new control, generated automatically if no ID is given
@@ -132,42 +142,121 @@ sap.ui.define([
132
142
  designtime: "sap/m/designtime/VariantManagement.designtime",
133
143
  properties: {
134
144
  /**
135
- * Indicates that <i>Set as Default</i> is visible in the <i>Save View</i> and the <i>Manage Views</i> dialogs.
145
+ * Indicates that default of variants is supported
136
146
  */
137
- showSetAsDefault: {
147
+ supportDefault: {
138
148
  type: "boolean",
139
149
  group: "Misc",
140
150
  defaultValue: true
141
151
  },
142
152
 
143
153
  /**
144
- * Indicates that the control is in error state. If set to <code>true</code>, an error message will be displayed whenever the variant is
145
- * opened.
154
+ * Indicates that favorite handling is supported
146
155
  */
147
- inErrorState: {
156
+ supportFavorites: {
157
+ type: "boolean",
158
+ group: "Misc",
159
+ defaultValue: true
160
+ },
161
+
162
+ /**
163
+ * Indicates that apply automatically functionality is supported
164
+ */
165
+ supportApplyAutomatically: {
166
+ type: "boolean",
167
+ group: "Misc",
168
+ defaultValue: true
169
+ },
170
+
171
+ /**
172
+ * Indicates that public functionality is supported
173
+ */
174
+ supportPublic: {
175
+ type: "boolean",
176
+ group: "Misc",
177
+ defaultValue: true
178
+ },
179
+
180
+ /**
181
+ * Indicates that contexts functionality is supported
182
+ */
183
+ supportContexts: {
148
184
  type: "boolean",
149
185
  group: "Misc",
150
186
  defaultValue: false
151
187
  },
152
188
 
189
+ /**
190
+ * Identifies the currently selected item
191
+ */
192
+ selectedKey: {
193
+ type: "string",
194
+ group: "Misc",
195
+ defaultValue: ""
196
+ },
197
+
198
+ /**
199
+ * Identifies the defaulted item
200
+ */
201
+ defaultKey: {
202
+ type: "string",
203
+ group: "Misc",
204
+ defaultValue: ""
205
+ },
206
+
207
+ /**
208
+ * Controls the visibility of the 'SaveAs' button
209
+ */
210
+ showSaveAs: {
211
+ type: "boolean",
212
+ group: "Misc",
213
+ defaultValue: true
214
+ },
215
+
216
+ /**
217
+ * If set to <code>false</code> neither 'Save As' nor 'Save' buttons on the 'My Views' dialog are visible.
218
+ */
219
+ creationAllowed: {
220
+ type: "boolean",
221
+ group: "Misc",
222
+ defaultValue: true
223
+ },
224
+
153
225
  /**
154
226
  * Indicates that the control is in edit state. If set to <code>false</code>, the footer of the <i>Views</i> list will be hidden.
155
227
  */
156
- editable: {
228
+ showFooter: {
157
229
  type: "boolean",
158
230
  group: "Misc",
159
231
  defaultValue: true
160
232
  },
161
233
 
162
234
  /**
163
- * Determines the name of the model containing the variants.
164
- * <p>
165
- * Note: This property has be set only once, at a very early point in time and may not be changed afterwards.
235
+ * Indicates the visible and selected item.
236
+ */
237
+ modified: {
238
+ type: "boolean",
239
+ group: "Misc",
240
+ defaultValue: false
241
+ },
242
+
243
+ /**
244
+ * Indicates the title in the 'My Views' popover.
166
245
  */
167
- modelName: {
246
+ popoverTitle: {
168
247
  type: "string",
169
248
  group: "Misc",
170
- defaultValue: null
249
+ defaultValue: ""
250
+ },
251
+
252
+ /**
253
+ * Indicates that the control is in error state. If set to <code>true</code>, an error message will be displayed whenever the variant is
254
+ * opened.
255
+ */
256
+ inErrorState: {
257
+ type: "boolean",
258
+ group: "Misc",
259
+ defaultValue: false
171
260
  },
172
261
 
173
262
  /**
@@ -182,13 +271,33 @@ sap.ui.define([
182
271
 
183
272
  /**
184
273
  * Defines the Apply Automatically text for the standard variant in the Manage Views dialog if the application controls this behavior.
185
- *
186
- * <br><b>Note:</b> the usage of this property is restricted to <code>sap.fe</code> components only.
187
274
  */
188
275
  displayTextForExecuteOnSelectionForStandardVariant: {
189
276
  type: "string",
190
277
  group: "Misc",
191
278
  defaultValue: ""
279
+ },
280
+
281
+ /**
282
+ * Semantic level of the header.
283
+ * For more information, see {@link sap.m.Title#setLevel}.
284
+ */
285
+ level: {
286
+ type: "sap.ui.core.TitleLevel",
287
+ group: "Appearance",
288
+ defaultValue: TitleLevel.Auto
289
+ }
290
+ },
291
+ defaultAggregation: "items",
292
+ aggregations: {
293
+
294
+ /**
295
+ * Items displayed by the <code>VariantManagement</code> control.
296
+ */
297
+ items: {
298
+ type: "sap.m.VariantItem",
299
+ multiple: true,
300
+ singularName: "item"
192
301
  }
193
302
  },
194
303
  events: {
@@ -233,6 +342,13 @@ sap.ui.define([
233
342
  type: "boolean"
234
343
  },
235
344
 
345
+ /**
346
+ * Indicates the check box state for 'Public'.
347
+ */
348
+ 'public': {
349
+ type: "boolean"
350
+ },
351
+
236
352
  /**
237
353
  * Indicates the check box state for 'Create Tile'.
238
354
  * <br>Note:</br>This event parameter is used only internally.
@@ -248,6 +364,11 @@ sap.ui.define([
248
364
  */
249
365
  cancel: {},
250
366
 
367
+ /**
368
+ * This event is fired when users presses the cancel button inside <i>Manage Views</i> dialog.
369
+ */
370
+ manageCancel: {},
371
+
251
372
  /**
252
373
  * This event is fired when users apply changes to variants in the <i>Manage Views</i> dialog.
253
374
  */
@@ -275,6 +396,13 @@ sap.ui.define([
275
396
  type: "object[]"
276
397
  },
277
398
 
399
+ /**
400
+ * List of variant keys and the associated favorite indicator
401
+ */
402
+ fav: {
403
+ type: "object[]"
404
+ },
405
+
278
406
  /**
279
407
  * The default variant key
280
408
  */
@@ -330,11 +458,78 @@ sap.ui.define([
330
458
 
331
459
  this._oRb = sap.ui.getCore().getLibraryResourceBundle("sap.m");
332
460
 
461
+
462
+ this._oManagedObjectModel = new ManagedObjectModel(this);
463
+ this.setModel(this._oManagedObjectModel, "$mVariants");
464
+
465
+ this._oObserver = new ManagedObjectObserver(this._observeChanges.bind(this));
466
+ this._oObserver.observe(this, {
467
+ aggregations: [
468
+ "items"
469
+ ]
470
+ });
471
+ };
472
+
473
+ VariantManagement.prototype._observeChanges = function(oChanges) {
474
+ var oVariantItem;
475
+
476
+ if (oChanges.type === "aggregation") {
477
+
478
+ if (oChanges.name === "items") {
479
+
480
+ oVariantItem = oChanges.child;
481
+
482
+ switch (oChanges.mutation) {
483
+ case "insert":
484
+ if (!this._oObserver.isObserved(oVariantItem, {properties: ["title"]})) {
485
+ this._oObserver.observe(oVariantItem, {properties: ["title"]});
486
+ }
487
+ break;
488
+ case "remove":
489
+ if (this._oObserver.isObserved(oVariantItem, {properties: ["title"]})) {
490
+ this._oObserver.unobserve(oVariantItem, {properties: ["title"]});
491
+ }
492
+ break;
493
+ default:
494
+ Log.error("operation " + oChanges.mutation + " not yet implemented");
495
+ }
496
+ }
497
+ } else if (oChanges.type === "property") {
498
+
499
+ if (oChanges.object.isA && oChanges.object.isA("sap.m.VariantItem")) {
500
+ oVariantItem = oChanges.object;
501
+ if (oVariantItem) {
502
+ if (this.getSelectedKey() === oVariantItem.getKey()) {
503
+ this.refreshTitle();
504
+ }
505
+ }
506
+ }
507
+ }
508
+ };
509
+
510
+ VariantManagement.prototype.applySettings = function(mSettings, oScope) {
511
+ Control.prototype.applySettings.apply(this, arguments);
512
+
333
513
  this._createInnerModel();
514
+ this._initializeControl();
515
+ };
334
516
 
335
- this._fRegisteredApplyAutomaticallyOnStandardVariant = null;
517
+ VariantManagement.prototype.setShowFooter = function(bValue) {
518
+ this.setProperty("showFooter", bValue);
519
+ return this;
336
520
  };
337
521
 
522
+ VariantManagement.prototype.setDefaultKey = function(sValue) {
523
+ this.setProperty("defaultKey", sValue);
524
+ return this;
525
+ };
526
+
527
+ VariantManagement.prototype.setPopoverTitle = function(sValue) {
528
+ this.setProperty("popoverTitle", sValue);
529
+ return this;
530
+ };
531
+
532
+
338
533
  VariantManagement.prototype._initializeControl = function() {
339
534
  if (this.oVariantInvisibleText) {
340
535
  return;
@@ -344,8 +539,8 @@ sap.ui.define([
344
539
 
345
540
  this.oVariantText = new Title(this.getId() + "-text", {
346
541
  text: {
347
- path: '/currentVariant',
348
- model: this._sModelName,
542
+ path: '/selectedKey',
543
+ model: "$mVariants",
349
544
  formatter: function(sKey) {
350
545
  var sText = "";
351
546
  if (sKey) {
@@ -355,6 +550,10 @@ sap.ui.define([
355
550
 
356
551
  return sText;
357
552
  }.bind(this)
553
+ },
554
+ level: {
555
+ path: '/level',
556
+ model: "$mVariants"
358
557
  }
359
558
  });
360
559
 
@@ -371,9 +570,9 @@ sap.ui.define([
371
570
  text: "*",
372
571
  visible: {
373
572
  path: "/modified",
374
- model: this._sModelName,
573
+ model: "$mVariants",
375
574
  formatter: function(bValue) {
376
- var sKey = this.getCurrentVariantKey();
575
+ var sKey = this.getSelectedKey();
377
576
 
378
577
  if (sKey) {
379
578
  this._setInvisibleText(this.getSelectedVariantText(sKey), bValue);
@@ -412,55 +611,6 @@ sap.ui.define([
412
611
  this.addDependent(this.oVariantLayout);
413
612
  };
414
613
 
415
- VariantManagement.prototype.applySettings = function(mSettings, oScope) {
416
- Control.prototype.applySettings.apply(this, arguments);
417
- };
418
-
419
- VariantManagement.prototype.setModelName = function(sName) {
420
- this.setProperty("modelName", sName);
421
-
422
- this._sModelName = sName;
423
-
424
- this._initializeControl();
425
-
426
- return this;
427
- };
428
-
429
- /**
430
- * Registration of a callback function. The provided callback function is executed to check if apply automatically on standard variant should be considered.
431
- * @private
432
- * @ui5-restricted sap.fe
433
- * @since 1.103
434
- * @param {function} fCallBack Called when standard variant must be applied. It determines if apply automatically on standard variant should be considered.
435
- * As a convenience the current variant will be passed to the callback. This variant instance may not be changed in any ways. It is only intended to provide certain variant information.
436
- * @returns {this} Reference to this in order to allow method chaining.
437
- */
438
- VariantManagement.prototype.registerApplyAutomaticallyOnStandardVariant = function(fCallBack) {
439
- this._fRegisteredApplyAutomaticallyOnStandardVariant = fCallBack;
440
-
441
- return this;
442
- };
443
-
444
- /**
445
- * Retrieves the apply automatically state for a variant.
446
- * @private
447
- * @ui5-restricted sap.mdc
448
- * @param {object} oVariant the inner variant object
449
- * @returns {boolean} apply automatically state
450
- */
451
- VariantManagement.prototype.getApplyAutomaticallyOnVariant = function(oVariant) {
452
- var bExecuteOnSelection = oVariant.executeOnSelect;
453
-
454
- if (this._fRegisteredApplyAutomaticallyOnStandardVariant && this.getDisplayTextForExecuteOnSelectionForStandardVariant() && (oVariant.key === this.getStandardVariantKey())) {
455
- try {
456
- bExecuteOnSelection = this._fRegisteredApplyAutomaticallyOnStandardVariant(oVariant);
457
- } catch (ex) {
458
- Log.error("callback for determination of apply automatically on standard variant failed");
459
- }
460
- }
461
-
462
- return bExecuteOnSelection;
463
- };
464
614
 
465
615
  /**
466
616
  * Required by the {@link sap.m.IOverflowToolbarContent} interface.
@@ -484,6 +634,9 @@ sap.ui.define([
484
634
  VariantManagement.prototype.getTitle = function() {
485
635
  return this.oVariantText;
486
636
  };
637
+ VariantManagement.prototype.refreshTitle = function() {
638
+ this.oVariantText.getBinding("text").refresh(true);
639
+ };
487
640
 
488
641
  VariantManagement.prototype._setInvisibleText = function(sText, bFlag) {
489
642
  var sInvisibleTextKey;
@@ -500,68 +653,13 @@ sap.ui.define([
500
653
 
501
654
  VariantManagement.prototype._createInnerModel = function() {
502
655
  var oModel = new JSONModel({
503
- showExecuteOnSelection: false,
504
- showSetAsDefault: true,
505
- showSaveAs: true,
506
- showPublic: false,
507
- showContexts: false,
508
- editable: true,
509
656
  showManualVariantKey: false,
510
- showCreateTile: false,
511
- popoverTitle: this._oRb.getText("VARIANT_MANAGEMENT_VARIANTS")
657
+ showCreateTile: false
512
658
  });
513
659
  this.setModel(oModel, VariantManagement.INNER_MODEL_NAME);
514
-
515
- this._bindProperties();
516
-
517
- this._updateInnerModelWithSettingsInfo();
518
- };
519
-
520
- VariantManagement.prototype._bindProperties = function() {
521
- this.bindProperty("showSetAsDefault", {
522
- path: "/showSetAsDefault",
523
- model: VariantManagement.INNER_MODEL_NAME
524
- });
525
- this.bindProperty("editable", {
526
- path: "/editable",
527
- model: VariantManagement.INNER_MODEL_NAME
528
- });
529
- };
530
-
531
- VariantManagement.prototype._setShowSaveAs = function(bValue) {
532
- this._setInnerModelProperty("/showSaveAs", bValue);
533
- };
534
-
535
- VariantManagement.prototype._setShowFooter = function(bValue) {
536
- this._setInnerModelProperty("/editable", bValue);
537
- };
538
-
539
- VariantManagement.prototype._setPopoverTitle = function(sText) {
540
- this._setInnerModelProperty("/popoverTitle", sText);
541
- };
542
-
543
- VariantManagement.prototype._getShowPublic = function() {
544
- return this._getInnerModelProperty("/showPublic");
545
- };
546
- VariantManagement.prototype._setShowPublic = function(bValue) {
547
- this._setInnerModelProperty("/showPublic", bValue);
548
660
  };
549
661
 
550
662
 
551
- VariantManagement.prototype._getShowContexts = function() {
552
- return this._getInnerModelProperty("/showContexts");
553
- };
554
- VariantManagement.prototype._setShowContexts = function(bValue) {
555
- this._setInnerModelProperty("/showContexts", bValue);
556
- };
557
-
558
- VariantManagement.prototype._getShowExecuteOnSelection = function() {
559
- return this._getInnerModelProperty("/showExecuteOnSelection");
560
- };
561
- VariantManagement.prototype._setShowExecuteOnSelection = function(bValue) {
562
- this._setInnerModelProperty("/showExecuteOnSelection", bValue);
563
- };
564
-
565
663
  VariantManagement.prototype._getShowCreateTile = function() {
566
664
  return this._getInnerModelProperty("/showCreateTile");
567
665
  };
@@ -576,7 +674,6 @@ sap.ui.define([
576
674
  this._setInnerModelProperty("/showManualVariantKey", bValue);
577
675
  };
578
676
 
579
-
580
677
  VariantManagement.prototype._setInnerModelProperty = function(sPropertyPath, vValue) {
581
678
  var oInnerModel = this.getModel(VariantManagement.INNER_MODEL_NAME);
582
679
  if (oInnerModel) {
@@ -594,153 +691,21 @@ sap.ui.define([
594
691
  };
595
692
 
596
693
 
597
- /**
598
- * Gets the previous default variant key
599
- * @public
600
- * @abstract
601
- * @returns {string} Key of the previous dfault variant
602
- */
603
- VariantManagement.prototype.getOriginalDefaultVariantKey = function() {
604
- };
605
-
606
- /**
607
- * Sets the default variant key
608
- * @public
609
- * @abstract
610
- * @param {string} sKey - the variant key should be set as default
611
- */
612
- VariantManagement.prototype.setDefaultVariantKey = function(sKey) {
613
- };
614
-
615
- /**
616
- * Gets the default variant key
617
- * @public
618
- * @abstract
619
- * @returns {string} Key of the default variant
620
- */
621
- VariantManagement.prototype.getDefaultVariantKey = function() {
622
- };
623
-
624
- /**
625
- * Sets the currently selected variant key.
626
- * @public
627
- * @abstract
628
- * @param {string} sKey - the new current variant key
629
- */
630
- VariantManagement.prototype.setCurrentVariantKey = function(sKey) {
631
- };
632
-
633
- /**
634
- * Gets the currently selected variant key.
635
- * @public
636
- * @abstract
637
- * @returns {string} Key of the currently selected variant. In case the model is not yet set <code>null</code> will be returned.
638
- */
639
- VariantManagement.prototype.getCurrentVariantKey = function() {
640
- };
641
-
642
-
643
- /**
644
- * Retrieves all variants.
645
- * @public
646
- * @returns {array} All variants. In case the model is not yet set, an empty array will be returned.
647
- */
648
- VariantManagement.prototype.getVariants = function() {
649
- return this._getItems();
650
- };
651
-
652
- /**
653
- * Sets the modified flag
654
- * @public
655
- * @abstract
656
- * @param {boolean} bFlag - represents the variant modify state
657
- */
658
- VariantManagement.prototype.setModified = function(bFlag) {
659
- };
660
-
661
- /**
662
- * Determines if the current variant is modified.
663
- * @public
664
- * @abstract
665
- * @returns {boolean} If the current variant is modified <code>true</code>, otherwise <code>false</code>
666
- */
667
- VariantManagement.prototype.getModified = function() {
668
- };
669
-
670
- /**
671
- * Gets the information, if favorites should be shown.
672
- * @public
673
- * @abstract
674
- * @returns {boolean} The information if favorites should be shown
675
- */
676
- VariantManagement.prototype.getShowFavorites = function() {
677
- };
678
-
679
694
  /**
680
695
  * Gets all the variants
681
696
  * @private
682
- * @abstract
683
697
  * @returns {array} Of variants
684
698
  */
685
699
  VariantManagement.prototype._getItems = function() {
700
+ return this.getItems();
686
701
  };
687
702
 
688
- /**
689
- * Gets all the binding path
690
- * @private
691
- * @abstract
692
- * @returns {array} Of variants
693
- */
694
- VariantManagement.prototype._getBindingPath = function() {
695
- return "";
696
- };
697
-
698
- /**
699
- * Propagate information about public and save as
700
- * @private
701
- * @abstract
702
- */
703
- VariantManagement.prototype._updateInnerModelWithSettingsInfo = function() {
704
- };
705
-
706
- /**
707
- * Check if the item is delete enabled.
708
- * @private
709
- * @abstract
710
- * @param {object} oItem - represents the variant
711
- * @returns {boolean} indicator if the item is delete enabled
712
- */
713
- VariantManagement.prototype.isItemDeleteEnabled = function(oItem) {
714
- return true;
715
- };
716
-
717
- /**
718
- * Check if the item is delete enabled.
719
- * @private
720
- * @abstract
721
- * @param {object} oItem - represents the variant
722
- * @returns {boolean} indicator if the item is delete enabled
723
- */
724
- VariantManagement.prototype.isItemDeleteVisible = function(oItem) {
725
- return oItem.remove;
726
- };
727
-
728
- /**
729
- * Check if the item is delete enabled.
730
- * @private
731
- * @abstract
732
- * @param {object} oItem - represents the variant
733
- * @returns {boolean} indicator if the item is delete enabled
734
- */
735
- VariantManagement.prototype.isItemRenameAllowed = function(oItem) {
736
- return oItem.rename;
737
- };
738
703
 
739
704
  VariantManagement.prototype.getSelectedVariantText = function(sKey) {
740
705
  var oItem = this._getItemByKey(sKey);
741
706
 
742
707
  if (oItem) {
743
- return oItem.title;
708
+ return oItem.getTitle();
744
709
  }
745
710
 
746
711
  return "";
@@ -749,7 +714,7 @@ sap.ui.define([
749
714
  VariantManagement.prototype.getStandardVariantKey = function() {
750
715
  var aItems = this._getItems();
751
716
  if (aItems && aItems[0]) {
752
- return aItems[0].key;
717
+ return aItems[0].getKey();
753
718
  }
754
719
 
755
720
  return null;
@@ -761,20 +726,46 @@ sap.ui.define([
761
726
  };
762
727
 
763
728
  VariantManagement.prototype._addDeletedItem = function(oItem) {
764
- this._aDeletedItems.push(oItem);
729
+ var sKey = oItem.getKey();
730
+ if (this._aDeletedItems.indexOf(sKey) < 0) {
731
+ this._aDeletedItems.push(sKey);
732
+ }
765
733
  };
766
734
 
767
735
  VariantManagement.prototype._getDeletedItems = function() {
768
736
  return this._aDeletedItems;
769
737
  };
770
738
 
739
+ VariantManagement.prototype._clearRenamedItems = function() {
740
+ this._aRenamedItems = [];
741
+ };
742
+
743
+ VariantManagement.prototype._addRenamedItem = function(oItem) {
744
+ var sKey = oItem.getKey();
745
+ if (this._aRenamedItems.indexOf(sKey) < 0) {
746
+ this._aRenamedItems.push(sKey);
747
+ }
748
+ };
749
+
750
+ VariantManagement.prototype._removeRenamedItem = function(oItem) {
751
+ var sKey = oItem.getKey();
752
+ var nIdx = this._aRenamedItems.indexOf(sKey);
753
+ if ( nIdx >= 0) {
754
+ this._aRenamedItems.splice(nIdx, 1);
755
+ }
756
+ };
757
+
758
+ VariantManagement.prototype._getRenamedItems = function() {
759
+ return this._aRenamedItems;
760
+ };
761
+
771
762
 
772
763
  VariantManagement.prototype._getItemByKey = function(sKey) {
773
764
  var oItem = null;
774
765
  var aItems = this._getItems();
775
766
  if (aItems) {
776
767
  aItems.some(function(oEntry) {
777
- if (oEntry.key === sKey) {
768
+ if (oEntry.getKey() === sKey) {
778
769
  oItem = oEntry;
779
770
  }
780
771
 
@@ -785,38 +776,6 @@ sap.ui.define([
785
776
  return oItem;
786
777
  };
787
778
 
788
- VariantManagement.prototype._rebindControl = function() {
789
- this.oVariantText.unbindProperty("text");
790
- this.oVariantText.bindProperty("text", {
791
- path: 'currentVariant',
792
- model: this._sModelName,
793
- formatter: function(sKey) {
794
- var sText = "";
795
- if (sKey) {
796
- sText = this.getSelectedVariantText(sKey);
797
- this._setInvisibleText(sText, this.getModified());
798
- }
799
-
800
- return sText;
801
- }.bind(this)
802
- });
803
-
804
- this.oVariantModifiedText.unbindProperty("visible");
805
- this.oVariantModifiedText.bindProperty("visible", {
806
- path: "modified",
807
- model: this._sModelName,
808
- formatter: function(bValue) {
809
- var sKey = this.getCurrentVariantKey();
810
-
811
- if (sKey) {
812
- this._setInvisibleText(this.getSelectedVariantText(sKey), bValue);
813
- }
814
-
815
- return ((bValue === null) || (bValue === undefined)) ? false : bValue;
816
- }.bind(this)
817
- });
818
- };
819
-
820
779
 
821
780
  VariantManagement.prototype._obtainControl = function(oEvent) {
822
781
  if (oEvent && oEvent.target && oEvent.target.id) {
@@ -879,17 +838,17 @@ sap.ui.define([
879
838
  if (!this.oErrorVariantPopOver) {
880
839
  oVBox = new VBox({
881
840
  fitContainer: true,
882
- alignItems: sap.m.FlexAlignItems.Center,
841
+ alignItems: FlexAlignItems.Center,
883
842
  items: [
884
843
  new Icon({
885
844
  size: "4rem",
886
845
  color: "lightgray",
887
846
  src: "sap-icon://message-error"
888
847
  }), new Title({
889
- titleStyle: sap.ui.core.TitleLevel.H2,
848
+ titleStyle: TitleLevel.H2,
890
849
  text: this._oRb.getText("VARIANT_MANAGEMENT_ERROR_TEXT1")
891
850
  }), new Text({
892
- textAlign: sap.ui.core.TextAlign.Center,
851
+ textAlign: TextAlign.Center,
893
852
  text: this._oRb.getText("VARIANT_MANAGEMENT_ERROR_TEXT2")
894
853
  })
895
854
  ]
@@ -900,7 +859,7 @@ sap.ui.define([
900
859
  this.oErrorVariantPopOver = new ResponsivePopover(this.getId() + "-errorpopover", {
901
860
  title: {
902
861
  path: "/popoverTitle",
903
- model: VariantManagement.INNER_MODEL_NAME
862
+ model: "$mVariants"
904
863
  },
905
864
  contentWidth: "400px",
906
865
  placement: PlacementType.VerticalPreferredBottom,
@@ -964,11 +923,22 @@ sap.ui.define([
964
923
  this._handleVariantSave();
965
924
  }.bind(this),
966
925
  visible: {
967
- path: "modified",
968
- model: this._sModelName,
969
- formatter: function(bValue) {
970
- return bValue;
926
+ parts: [{
927
+ path: '$mVariants>/creationAllowed'
928
+ },{
929
+ path: '$mVariants>/modified'
930
+ },{
931
+ path: '$mVariants>/selectedKey'
971
932
  }
933
+ ],
934
+ formatter: function(bCreationAllowed, bModified, sSelectedKey) {
935
+ var bItemChangeable = false;
936
+ var oItem = this._getItemByKey(sSelectedKey);
937
+ if (oItem) {
938
+ bItemChangeable = oItem.getChangeable();
939
+ }
940
+ return bCreationAllowed && bModified && bItemChangeable;
941
+ }.bind(this)
972
942
  },
973
943
  type: ButtonType.Emphasized,
974
944
  layoutData: new OverflowToolbarLayoutData({
@@ -985,15 +955,22 @@ sap.ui.define([
985
955
  priority: OverflowToolbarPriority.Low
986
956
  }),
987
957
  visible: {
988
- path: "/showSaveAs",
989
- model: VariantManagement.INNER_MODEL_NAME
958
+ parts: [{
959
+ path: '$mVariants>/creationAllowed'
960
+ },{
961
+ path: '$mVariants>/showSaveAs'
962
+ }],
963
+ formatter: function(bCreationAllowed, bShowSaveAs) {
964
+ return bCreationAllowed && bShowSaveAs;
965
+ }
990
966
  }
967
+
991
968
  });
992
969
 
993
970
  this.oVariantList = new SelectList(this.getId() + "-list", {
994
971
  selectedKey: {
995
- path: this._checkForFinalBindingPath("currentVariant"),
996
- model: this._sModelName
972
+ path: "/selectedKey",
973
+ model: "$mVariants"
997
974
  },
998
975
  itemPress: function(oEvent) {
999
976
  var sSelectionKey = null;
@@ -1005,7 +982,7 @@ sap.ui.define([
1005
982
  }
1006
983
  if (sSelectionKey) {
1007
984
  // this.setModified(false);
1008
- this.setCurrentVariantKey(sSelectionKey);
985
+ this.setSelectedKey(sSelectionKey);
1009
986
 
1010
987
  this.fireSelect({
1011
988
  key: sSelectionKey
@@ -1016,14 +993,16 @@ sap.ui.define([
1016
993
  });
1017
994
  this.oVariantList.setNoDataText(this._oRb.getText("VARIANT_MANAGEMENT_NODATA"));
1018
995
 
1019
- var oItemTemplate = new sap.ui.core.Item({
1020
- key: '{' + this._sModelName + ">key}",
1021
- text: '{' + this._sModelName + ">title}"
996
+
997
+ var oItemTemplate = new Item({
998
+ key: "{$mVariants>key}",
999
+ text: "{$mVariants>title}"
1022
1000
  });
1023
1001
 
1002
+
1024
1003
  this.oVariantList.bindAggregation("items", {
1025
- path: this._checkForFinalBindingPath("variants"),
1026
- model: this._sModelName,
1004
+ path: "/items",
1005
+ model: "$mVariants",
1027
1006
  template: oItemTemplate
1028
1007
  });
1029
1008
 
@@ -1048,21 +1027,17 @@ sap.ui.define([
1048
1027
  }),
1049
1028
  showNavButton: false,
1050
1029
  showHeader: false
1051
- // showFooter: {
1052
- // path: "/editable",
1053
- // model: VariantManagement.INNER_MODEL_NAME
1054
- // }
1055
1030
  });
1056
1031
 
1057
1032
  this.oVariantSelectionPage.bindProperty("showFooter", {
1058
- path: "/editable",
1059
- model: VariantManagement.INNER_MODEL_NAME
1033
+ path: "/showFooter",
1034
+ model: "$mVariants"
1060
1035
  });
1061
1036
 
1062
1037
  this.oVariantPopOver = new ResponsivePopover(this.getId() + "-popover", {
1063
1038
  title: {
1064
1039
  path: "/popoverTitle",
1065
- model: VariantManagement.INNER_MODEL_NAME
1040
+ model: "$mVariants"
1066
1041
  },
1067
1042
  titleAlignment: "Auto",
1068
1043
  contentWidth: "400px",
@@ -1094,29 +1069,22 @@ sap.ui.define([
1094
1069
  // this.oVariantList.getBinding("items").filter(this._getFilters());
1095
1070
  };
1096
1071
 
1097
- /**
1098
- * Hide or show <i>Save</i> button and emphasize "most positive action" - either <i>Save</i> button if it is visible, or <i>Save As</i> button if <i>Save</i> is hidden.
1099
- * @param {boolean} bShow - Indicator if <i>Save</i> button should be visible
1100
- * @private
1101
- */
1102
- VariantManagement.prototype.showSaveButton = function(bShow) {
1103
- if (bShow === false) {
1104
- this.oVariantSaveAsBtn.setType(ButtonType.Emphasized);
1105
- this.oVariantSaveBtn.setVisible(false);
1106
- } else {
1072
+
1073
+ VariantManagement.prototype._determineEmphasizedFooterButton = function() {
1074
+ if (this.oVariantSaveBtn.getVisible()) {
1075
+ this.oVariantSaveBtn.setType(ButtonType.Emphasized);
1107
1076
  this.oVariantSaveAsBtn.setType(ButtonType.Default);
1108
- this.oVariantSaveBtn.setVisible(true);
1077
+ } else {
1078
+ this.oVariantSaveAsBtn.setType(ButtonType.Emphasized);
1109
1079
  }
1110
1080
  };
1111
1081
 
1112
-
1113
- VariantManagement.prototype._checkForFinalBindingPath = function(sPath) {
1114
- return this._getBindingPath() ? sPath : ('/' + sPath);
1082
+ VariantManagement.prototype.setModified = function(bValue) {
1083
+ this.setProperty("modified", bValue);
1084
+ return this;
1115
1085
  };
1116
1086
 
1117
1087
  VariantManagement.prototype._openVariantList = function() {
1118
- var oItem;
1119
-
1120
1088
  if (this.getInErrorState()) {
1121
1089
  this._openInErrorState();
1122
1090
  return;
@@ -1126,11 +1094,6 @@ sap.ui.define([
1126
1094
  return;
1127
1095
  }
1128
1096
 
1129
- // proceed only if context is available
1130
- // if (!this.oContext) {
1131
- // return;
1132
- // }
1133
-
1134
1097
  this._createVariantList();
1135
1098
  this._oSearchField.setValue("");
1136
1099
 
@@ -1138,13 +1101,11 @@ sap.ui.define([
1138
1101
 
1139
1102
  this.oVariantSelectionPage.setShowSubHeader(this.oVariantList.getItems().length > 9);
1140
1103
 
1141
- this.showSaveButton(false);
1104
+ this._determineEmphasizedFooterButton();
1142
1105
 
1143
- if (this.getModified()) {
1144
- oItem = this._getItemByKey(this.getCurrentVariantKey());
1145
- if (oItem && oItem.change) {
1146
- this.showSaveButton(true);
1147
- }
1106
+ var oSelectedItem = this.oVariantList.getSelectedItem();
1107
+ if (oSelectedItem) {
1108
+ this.oVariantPopOver.setInitialFocus(oSelectedItem.getId());
1148
1109
  }
1149
1110
 
1150
1111
  var oControlRef = this._oCtrlRef ? this._oCtrlRef : this.oVariantLayout;
@@ -1192,8 +1153,8 @@ sap.ui.define([
1192
1153
  this.oDefault = new CheckBox(this.getId() + "-default", {
1193
1154
  text: this._oRb.getText("VARIANT_MANAGEMENT_SETASDEFAULT"),
1194
1155
  visible: {
1195
- path: "/showSetAsDefault",
1196
- model: VariantManagement.INNER_MODEL_NAME
1156
+ path: "/supportDefault",
1157
+ model: "$mVariants"
1197
1158
  },
1198
1159
  width: "100%"
1199
1160
  });
@@ -1201,8 +1162,8 @@ sap.ui.define([
1201
1162
  this.oPublic = new CheckBox(this.getId() + "-public", {
1202
1163
  text: this._oRb.getText("VARIANT_MANAGEMENT_SETASPUBLIC"),
1203
1164
  visible: {
1204
- path: "/showPublic",
1205
- model: VariantManagement.INNER_MODEL_NAME
1165
+ path: "/supportPublic",
1166
+ model: "$mVariants"
1206
1167
  },
1207
1168
  width: "100%"
1208
1169
  });
@@ -1210,8 +1171,8 @@ sap.ui.define([
1210
1171
  this.oExecuteOnSelect = new CheckBox(this.getId() + "-execute", {
1211
1172
  text: this._oRb.getText("VARIANT_MANAGEMENT_EXECUTEONSELECT"),
1212
1173
  visible: {
1213
- path: "/showExecuteOnSelection",
1214
- model: VariantManagement.INNER_MODEL_NAME
1174
+ path: "/supportApplyAutomatically",
1175
+ model: "$mVariants"
1215
1176
  },
1216
1177
  width: "100%"
1217
1178
  });
@@ -1283,7 +1244,7 @@ sap.ui.define([
1283
1244
  this._bSaveOngoing = false;
1284
1245
 
1285
1246
  if (this._sStyleClass) {
1286
- this._setShowPublic(this._bShowPublic);
1247
+ this.setSupportPublic(this._bShowPublic);
1287
1248
  this.oSaveAsDialog.removeStyleClass(this._sStyleClass);
1288
1249
 
1289
1250
  if (this._oRolesComponentContainer) {
@@ -1293,6 +1254,7 @@ sap.ui.define([
1293
1254
  this._sStyleClass = undefined;
1294
1255
  this._oRolesComponentContainer = null;
1295
1256
  }
1257
+
1296
1258
  }.bind(this),
1297
1259
  beginButton: this.oSaveSave,
1298
1260
  endButton: new Button(this.getId() + "-variantcancel", {
@@ -1411,10 +1373,10 @@ sap.ui.define([
1411
1373
  VariantManagement.prototype._openRolesDialog = function(oItem, oTextControl) {
1412
1374
  this._createRolesDialog();
1413
1375
 
1414
- this._oCurrentContextsKey = oItem.key;
1376
+ this._oCurrentContextsKey = oItem.getKey();
1415
1377
  this._oTextControl = oTextControl;
1416
1378
 
1417
- this._setSelectedContexts(oItem.contexts);
1379
+ this._setSelectedContexts(oItem.getContexts());
1418
1380
 
1419
1381
  this._oRolesDialog.open();
1420
1382
  };
@@ -1428,7 +1390,7 @@ sap.ui.define([
1428
1390
 
1429
1391
  var oItem = this._getItemByKey(sKey);
1430
1392
  if (oItem) {
1431
- oItem.contexts = mContexts;
1393
+ oItem.setContexts(mContexts);
1432
1394
  this._determineRolesSpecificText(mContexts, oTextControl);
1433
1395
  }
1434
1396
  } else {
@@ -1464,20 +1426,23 @@ sap.ui.define([
1464
1426
 
1465
1427
  /**
1466
1428
  * Opens the <i>Save As</i> dialog.
1467
- * @param {string} sRtaStyleClassName - style-class to be used
1429
+ * @param {string} sStyleClassName - style-class to be used
1468
1430
  * @param {object} oRolesComponentContainer - component for roles handling
1469
1431
  */
1470
- VariantManagement.prototype.openSaveAsDialogForKeyUser = function (sRtaStyleClassName, oRolesComponentContainer) {
1432
+ VariantManagement.prototype.openSaveAsDialog = function (sStyleClassName, oRolesComponentContainer) {
1471
1433
  this._openSaveAsDialog(true);
1472
- this.oSaveAsDialog.addStyleClass(sRtaStyleClassName);
1473
- this._sStyleClass = sRtaStyleClassName; // indicates that dialog is running in key user scenario
1434
+ this.oSaveAsDialog.addStyleClass(sStyleClassName);
1435
+ this._sStyleClass = sStyleClassName; // indicates that dialog is running in key user scenario
1474
1436
 
1475
- this._bShowPublic = this._getShowPublic();
1476
- this._setShowPublic(false);
1437
+ this._bShowPublic = this.getSupportPublic();
1438
+ this.setSupportPublic(false);
1477
1439
 
1478
1440
  if (oRolesComponentContainer) {
1479
1441
  Promise.all([oRolesComponentContainer]).then(function(vArgs) {
1480
1442
  this._oRolesComponentContainer = vArgs[0];
1443
+
1444
+ this.setSupportContexts(!!this._oRolesComponentContainer );
1445
+
1481
1446
  this._checkAndAddRolesContainerToSaveAsDialog();
1482
1447
 
1483
1448
  this.oSaveAsDialog.open();
@@ -1487,10 +1452,13 @@ sap.ui.define([
1487
1452
  }
1488
1453
  };
1489
1454
 
1455
+
1490
1456
  VariantManagement.prototype._openSaveAsDialog = function(bDoNotOpen) {
1491
1457
  this._createSaveAsDialog();
1492
1458
 
1493
- this.oInputName.setValue(this.getSelectedVariantText(this.getCurrentVariantKey()));
1459
+ this.setSupportContexts(false);
1460
+
1461
+ this.oInputName.setValue(this.getSelectedVariantText(this.getSelectedKey()));
1494
1462
  this.oInputName.setEnabled(true);
1495
1463
  this.oInputName.setValueState(ValueState.None);
1496
1464
  this.oInputName.setValueStateText(null);
@@ -1520,7 +1488,7 @@ sap.ui.define([
1520
1488
  }
1521
1489
  };
1522
1490
 
1523
- VariantManagement.prototype._handleVariantSaveAs = function(sNewVariantName, bKeyUser) {
1491
+ VariantManagement.prototype._handleVariantSaveAs = function(sNewVariantName) {
1524
1492
  var sKey = null;
1525
1493
  var sName = sNewVariantName.trim();
1526
1494
  var sManualKey = this.oInputManualKey.getValue().trim();
@@ -1544,14 +1512,8 @@ sap.ui.define([
1544
1512
  this.oSaveAsDialog.close();
1545
1513
  }
1546
1514
 
1547
- // if (this.oDefault.getSelected()) {
1548
- // this.setDefaultVariantKey(sKey);
1549
- // }
1550
-
1551
- this.setModified(false);
1552
-
1553
- if (bKeyUser) {
1554
- return true;
1515
+ if (this.oDefault.getSelected()) {
1516
+ this.setDefaultKey(this.oDefault.getSelected());
1555
1517
  }
1556
1518
 
1557
1519
  var oObj = {
@@ -1560,11 +1522,11 @@ sap.ui.define([
1560
1522
  overwrite: false,
1561
1523
  def: this.oDefault.getSelected(),
1562
1524
  execute: this.oExecuteOnSelect.getSelected(),
1563
- "public": this._sStyleClass ? undefined : this.oPublic.getSelected(),
1564
- contexts: this._sStyleClass ? this._getContextInfoChanges() : undefined
1525
+ "public": this.getSupportPublic() ? this.oPublic.getSelected() : undefined,
1526
+ contexts: this._getContextInfoChanges()
1565
1527
  };
1566
1528
 
1567
- if (!this._sStyleClass && this._getShowCreateTile() && this.oCreateTile) {
1529
+ if (this._getShowCreateTile() && this.oCreateTile) {
1568
1530
  oObj.tile = this.oCreateTile.getSelected();
1569
1531
  }
1570
1532
 
@@ -1580,18 +1542,18 @@ sap.ui.define([
1580
1542
  return this._getSelectedContexts();
1581
1543
  }
1582
1544
  } catch (ex) {
1583
- return null;
1545
+ return undefined;
1584
1546
  }
1585
1547
  }
1586
1548
 
1587
- return null;
1549
+ return undefined;
1588
1550
  };
1589
1551
 
1590
1552
  VariantManagement.prototype._handleVariantSave = function() {
1591
- var oItem = this._getItemByKey(this.getCurrentVariantKey());
1553
+ var oItem = this._getItemByKey(this.getSelectedKey());
1592
1554
 
1593
1555
  var bDefault = false;
1594
- if (this.getDefaultVariantKey() === oItem.key) {
1556
+ if (this.getDefaultKey() === oItem.getKey()) {
1595
1557
  bDefault = true;
1596
1558
  }
1597
1559
 
@@ -1600,40 +1562,47 @@ sap.ui.define([
1600
1562
  }
1601
1563
 
1602
1564
  this.fireSave({
1603
- name: oItem.title,
1565
+ name: oItem.getTitle(),
1604
1566
  overwrite: true,
1605
- key: oItem.key,
1567
+ key: oItem.getKey(),
1606
1568
  def: bDefault
1607
1569
  });
1608
-
1609
- this.setModified(false);
1610
1570
  };
1611
1571
 
1612
1572
  // Manage Views dialog
1613
1573
 
1574
+ VariantManagement.prototype.destroyManageDialog = function() {
1575
+ if (this.oManagementDialog) {
1576
+ this.oManagementDialog.destroy();
1577
+ this.oManagementDialog = undefined;
1578
+ }
1579
+ };
1580
+
1614
1581
  /**
1615
1582
  * Opens the <i>Manage Views</i> dialog.
1616
1583
  * @param {boolean} bCreateAlways - Indicates that if this is set to <code>true</code>, the former dialog will be destroyed before a new one is created
1617
- * @param {string} sClass - style-class to be used
1584
+ * @param {string} sStyleClass - style-class to be used
1618
1585
  * @param {object} oRolesComponentContainer - component for roles handling
1619
1586
  */
1620
- VariantManagement.prototype.openManagementDialog = function(bCreateAlways, sClass, oRolesComponentContainer) {
1587
+ VariantManagement.prototype.openManagementDialog = function(bCreateAlways, sStyleClass, oRolesComponentContainer) {
1621
1588
  if (bCreateAlways && this.oManagementDialog) {
1622
1589
  this.oManagementDialog.destroy();
1623
1590
  this.oManagementDialog = undefined;
1624
1591
  }
1625
1592
 
1626
- if (sClass) {
1627
- this._sStyleClass = sClass;
1628
- this._bShowPublic = this._getShowPublic();
1629
- this._setShowPublic(false);
1593
+ if (sStyleClass) {
1594
+ this._sStyleClass = sStyleClass;
1595
+ this._bShowPublic = this.getSupportPublic();
1596
+ this.setSupportPublic(false);
1597
+
1598
+ this.setSupportContexts(false);
1630
1599
  }
1631
1600
 
1632
1601
  if (oRolesComponentContainer) {
1633
1602
  Promise.all([oRolesComponentContainer]).then(function(vArgs) {
1634
1603
  this._oRolesComponentContainer = vArgs[0];
1635
1604
 
1636
- this._setShowContexts(!!this._oRolesComponentContainer);
1605
+ this.setSupportContexts(!!this._oRolesComponentContainer);
1637
1606
  this._openManagementDialog();
1638
1607
 
1639
1608
  if (this._sStyleClass) {
@@ -1641,7 +1610,6 @@ sap.ui.define([
1641
1610
  }
1642
1611
  }.bind(this));
1643
1612
  } else {
1644
- this._setShowContexts(false);
1645
1613
  this._openManagementDialog();
1646
1614
 
1647
1615
  if (this._sStyleClass) {
@@ -1660,7 +1628,17 @@ sap.ui.define([
1660
1628
  return;
1661
1629
  }
1662
1630
 
1663
- var sValue = parameters.newValue ? parameters.newValue : "";
1631
+ var sValue;
1632
+ if (parameters.query) {
1633
+ sValue = parameters.query;
1634
+ } else {
1635
+ sValue = parameters.newValue ? parameters.newValue : "";
1636
+ }
1637
+
1638
+ this._triggerSearchInManageDialogByValue(sValue, oManagementTable);
1639
+ };
1640
+
1641
+ VariantManagement.prototype._triggerSearchInManageDialogByValue = function(sValue, oManagementTable) {
1664
1642
 
1665
1643
  var aFilters = [
1666
1644
  this._getVisibleFilter(), new Filter({
@@ -1690,16 +1668,18 @@ sap.ui.define([
1690
1668
 
1691
1669
  VariantManagement.prototype._createManagementDialog = function() {
1692
1670
  if (!this.oManagementDialog || this.oManagementDialog.bIsDestroyed) {
1671
+
1693
1672
  this.oManagementTable = new Table(this.getId() + "-managementTable", {
1694
1673
  contextualWidth: "Auto",
1695
1674
  fixedLayout: false,
1696
1675
  growing: true,
1676
+ keyboardMode: ListKeyboardMode.Edit,
1697
1677
  columns: [
1698
1678
  new Column({
1699
1679
  width: "3rem",
1700
1680
  visible: {
1701
- path: this._checkForFinalBindingPath("showFavorites"),
1702
- model: this._sModelName
1681
+ path: "/supportFavorites",
1682
+ model: "$mVariants"
1703
1683
  }
1704
1684
  }), new Column({
1705
1685
  header: new Text({
@@ -1712,8 +1692,8 @@ sap.ui.define([
1712
1692
  wrappingType: "Hyphenated"
1713
1693
  }),
1714
1694
  visible: {
1715
- path: "/showPublic",
1716
- model: VariantManagement.INNER_MODEL_NAME
1695
+ path: "/supportPublic",
1696
+ model: "$mVariants"
1717
1697
  },
1718
1698
  demandPopin: true,
1719
1699
  popinDisplay: PopinDisplay.Inline,
@@ -1728,8 +1708,8 @@ sap.ui.define([
1728
1708
  popinDisplay: PopinDisplay.Block,
1729
1709
  minScreenWidth: ScreenSize.Tablet,
1730
1710
  visible: {
1731
- path: "/showSetAsDefault",
1732
- model: VariantManagement.INNER_MODEL_NAME
1711
+ path: "/supportDefault",
1712
+ model: "$mVariants"
1733
1713
  }
1734
1714
  }), new Column({
1735
1715
  header: new Text({
@@ -1741,8 +1721,8 @@ sap.ui.define([
1741
1721
  popinDisplay: PopinDisplay.Block,
1742
1722
  minScreenWidth: ScreenSize.Tablet,
1743
1723
  visible: {
1744
- path: "/showExecuteOnSelection",
1745
- model: VariantManagement.INNER_MODEL_NAME
1724
+ path: "/supportApplyAutomatically",
1725
+ model: "$mVariants"
1746
1726
  }
1747
1727
  }), new Column({
1748
1728
  header: new Text({
@@ -1754,8 +1734,8 @@ sap.ui.define([
1754
1734
  popinDisplay: PopinDisplay.Inline,
1755
1735
  minScreenWidth: ScreenSize.Tablet,
1756
1736
  visible: {
1757
- path: "/showContexts",
1758
- model: VariantManagement.INNER_MODEL_NAME
1737
+ path: "/supportContexts",
1738
+ model: "$mVariants"
1759
1739
  }
1760
1740
  }), new Column({
1761
1741
  header: new Text({
@@ -1778,6 +1758,7 @@ sap.ui.define([
1778
1758
  type: ButtonType.Emphasized,
1779
1759
  press: function() {
1780
1760
  this._handleManageSavePressed();
1761
+ //this.oManagementDialog.close();
1781
1762
  }.bind(this)
1782
1763
  });
1783
1764
 
@@ -1785,8 +1766,10 @@ sap.ui.define([
1785
1766
  text: this._oRb.getText("VARIANT_MANAGEMENT_CANCEL"),
1786
1767
  press: function() {
1787
1768
  this._resumeManagementTableBinding();
1788
- this.oManagementDialog.close();
1789
1769
  this._handleManageCancelPressed();
1770
+ if (this.oManagementDialog) { // can be deleted during manageCancel event
1771
+ this.oManagementDialog.close();
1772
+ }
1790
1773
  }.bind(this)
1791
1774
  });
1792
1775
 
@@ -1799,7 +1782,7 @@ sap.ui.define([
1799
1782
  endButton: this.oManagementCancel,
1800
1783
  afterClose: function() {
1801
1784
  if (this._sStyleClass) {
1802
- this._setShowPublic(this._bShowPublic);
1785
+ this.setSupportPublic(this._bShowPublic, true);
1803
1786
  this.oManagementDialog.removeStyleClass(this._sStyleClass);
1804
1787
  this._sStyleClass = undefined;
1805
1788
  this._oRolesComponentContainer = null;
@@ -1821,6 +1804,10 @@ sap.ui.define([
1821
1804
  this._triggerSearchInManageDialog(oEvent, this.oManagementTable);
1822
1805
  }.bind(this));
1823
1806
 
1807
+ this._oSearchFieldOnMgmtDialog.attachSearch(function(oEvent) {
1808
+ this._triggerSearchInManageDialog(oEvent, this.oManagementTable);
1809
+ }.bind(this));
1810
+
1824
1811
  var oSubHeader = new Bar(this.getId() + "-mgmHeaderSearch", {
1825
1812
  contentMiddle: [
1826
1813
  this._oSearchFieldOnMgmtDialog
@@ -1828,14 +1815,16 @@ sap.ui.define([
1828
1815
  });
1829
1816
  this.oManagementDialog.setSubHeader(oSubHeader);
1830
1817
 
1818
+ this.oManagementDialog.setInitialFocus(this._oSearchFieldOnMgmtDialog);
1819
+
1831
1820
  if (this.oVariantLayout.$().closest(".sapUiSizeCompact").length > 0) {
1832
1821
  this.oManagementDialog.addStyleClass("sapUiSizeCompact");
1833
1822
  }
1834
1823
  this.addDependent(this.oManagementDialog);
1835
1824
 
1836
1825
  this.oManagementTable.bindAggregation("items", {
1837
- path: this._checkForFinalBindingPath("variants"),
1838
- model: this._sModelName,
1826
+ path: "/items",
1827
+ model: "$mVariants",
1839
1828
  factory: this._templateFactoryManagementDialog.bind(this),
1840
1829
  filters: this._getVisibleFilter()
1841
1830
  });
@@ -1855,33 +1844,41 @@ sap.ui.define([
1855
1844
  VariantManagement.prototype._templateFactoryManagementDialog = function(sId, oContext) {
1856
1845
  var sTooltip = null;
1857
1846
  var oDeleteButton;
1858
- var sBindingPath;
1859
1847
  var oNameControl;
1860
1848
  var oExecuteOnSelectCtrl;
1861
1849
  var oRolesCell;
1862
1850
  var oItem = oContext.getObject();
1863
1851
  if (!oItem) {
1852
+ Log.error("couldn't obtain the item for '" + oContext.getPath() + "'");
1864
1853
  return undefined;
1865
1854
  }
1866
1855
 
1856
+ var nPos = this._determineIndex(oContext.getPath());
1857
+ if (nPos < 0) {
1858
+ Log.error("couldn't obtain item position for '" + oContext.getPath() + "'");
1859
+ return undefined;
1860
+ }
1861
+
1862
+ var sIdPrefix = this.getId() + "-manage";
1863
+
1864
+ var sModelName = "$mVariants";
1865
+
1867
1866
  var fLiveChange = function(oEvent) {
1868
- this._checkVariantNameConstraints(oEvent.oSource, oEvent.oSource.getBindingContext(this._sModelName).getObject().key);
1867
+ var oItem = oEvent.oSource.getBindingContext(sModelName).getObject();
1868
+ this._handleManageTitleChange(oEvent.oSource, oItem);
1869
1869
  }.bind(this);
1870
1870
 
1871
1871
  var fChange = function(oEvent) {
1872
- this._handleManageTitleChanged(oEvent.oSource.getBindingContext(this._sModelName).getObject());
1872
+ var oItem = oEvent.oSource.getBindingContext(sModelName).getObject();
1873
+ this._handleManageTitleChange(oEvent.oSource, oItem);
1873
1874
  }.bind(this);
1874
1875
 
1875
1876
  var fSelectRB = function(oEvent) {
1876
- this._handleManageDefaultVariantChange(oEvent.oSource, oEvent.oSource.getBindingContext(this._sModelName).getObject(), oEvent.getParameters().selected);
1877
- }.bind(this);
1878
-
1879
- var fSelectCB = function(oEvent) {
1880
- this._handleManageExecuteOnSelectionChanged(oEvent.oSource.getBindingContext(this._sModelName).getObject());
1877
+ this._handleManageDefaultVariantChange(oEvent.oSource, oEvent.oSource.getBindingContext(sModelName).getObject(), oEvent.getParameters().selected);
1881
1878
  }.bind(this);
1882
1879
 
1883
1880
  var fPress = function(oEvent) {
1884
- this._handleManageDeletePressed(oEvent.oSource.getBindingContext(this._sModelName).getObject());
1881
+ this._handleManageDeletePressed(oEvent.oSource.getBindingContext(sModelName).getObject());
1885
1882
  var oListItem = oEvent.oSource.getParent();
1886
1883
  if (oListItem) {
1887
1884
  oListItem.setVisible(false);
@@ -1891,141 +1888,132 @@ sap.ui.define([
1891
1888
  }.bind(this);
1892
1889
 
1893
1890
  var fSelectFav = function(oEvent) {
1894
- this._handleManageFavoriteChanged(oEvent.oSource, oEvent.oSource.getBindingContext(this._sModelName).getObject());
1891
+ this._handleManageFavoriteChanged(oEvent.oSource, oEvent.oSource.getBindingContext(sModelName).getObject());
1895
1892
  }.bind(this);
1896
1893
 
1897
1894
  var fRolesPressed = function(oEvent) {
1898
- var oItem = oEvent.oSource.getBindingContext(this._sModelName).getObject();
1895
+ var oItem = oEvent.oSource.getBindingContext(sModelName).getObject();
1899
1896
  this._openRolesDialog(oItem, oEvent.oSource.getParent().getItems()[0]);
1900
1897
  }.bind(this);
1901
1898
 
1902
- var bRenameEnabled = this.isItemRenameAllowed(oItem);
1903
- if (bRenameEnabled) {
1904
- oNameControl = new Input({
1899
+ if (oItem.getRename()) {
1900
+ oNameControl = new Input(sIdPrefix + "-input-" + nPos, {
1905
1901
  liveChange: fLiveChange,
1906
1902
  change: fChange,
1907
- value: '{' + this._sModelName + ">title}"
1903
+ value: '{' + sModelName + ">title}"
1908
1904
  });
1905
+
1906
+ if (oItem.getTitle() !== oItem.getOriginalTitle()) {
1907
+ this._verifyVariantNameConstraints(oNameControl, oItem.getKey(), oItem.getTitle());
1908
+ }
1909
+
1910
+
1909
1911
  } else {
1910
- oNameControl = new ObjectIdentifier({
1911
- title: '{' + this._sModelName + ">title}"
1912
+ oNameControl = new ObjectIdentifier(sIdPrefix + "-text-" + nPos, {
1913
+ title: '{' + sModelName + ">title}"
1912
1914
  });
1913
1915
  if (sTooltip) {
1914
1916
  oNameControl.setTooltip(sTooltip);
1915
1917
  }
1916
1918
  }
1917
1919
 
1918
- var bDeleteEnabled = this.isItemDeleteEnabled(oItem);
1919
- var bDeleteVisible = this.isItemDeleteVisible(oItem);
1920
-
1921
- oDeleteButton = new Button({
1920
+ oDeleteButton = new Button(sIdPrefix + "-del-" + nPos, {
1922
1921
  icon: "sap-icon://decline",
1923
- enabled: bDeleteEnabled,
1922
+ enabled: true,
1924
1923
  type: ButtonType.Transparent,
1925
1924
  press: fPress,
1926
1925
  tooltip: this._oRb.getText("VARIANT_MANAGEMENT_DELETE"),
1927
- visible: bDeleteVisible
1926
+ visible: oItem.getRemove()
1928
1927
  });
1929
1928
 
1930
-
1931
-
1932
- this._assignColumnInfoForDeleteButton(oDeleteButton);
1933
-
1934
- sBindingPath = this._getBindingPath();
1935
-
1936
- var oFavoriteIcon = new Icon({
1929
+ var oFavoriteIcon = new Icon(sIdPrefix + "-fav-" + nPos, {
1937
1930
  src: {
1938
1931
  path: "favorite",
1939
- model: this._sModelName,
1932
+ model: sModelName,
1940
1933
  formatter: function(bFlagged) {
1941
1934
  return bFlagged ? "sap-icon://favorite" : "sap-icon://unfavorite";
1942
1935
  }
1943
1936
  },
1944
1937
  tooltip: {
1945
1938
  path: 'favorite',
1946
- model: this._sModelName,
1939
+ model: sModelName,
1947
1940
  formatter: function(bFlagged) {
1948
1941
  return this._oRb.getText(bFlagged ? "VARIANT_MANAGEMENT_FAV_DEL_TOOLTIP" : "VARIANT_MANAGEMENT_FAV_ADD_TOOLTIP");
1949
1942
  }.bind(this)
1950
1943
  },
1951
- press: fSelectFav
1944
+ press: fSelectFav,
1945
+ decorative: false
1952
1946
  });
1953
1947
 
1954
- if ((this.getStandardVariantKey() === oItem.key) || (this.getDefaultVariantKey() === oItem.key)) {
1948
+ if ((this.getStandardVariantKey() === oItem.getKey()) || (this.getDefaultKey() === oItem.getKey())) {
1955
1949
  oFavoriteIcon.addStyleClass("sapMVarMngmtFavNonInteractiveColor");
1956
1950
  } else {
1957
1951
  oFavoriteIcon.addStyleClass("sapMVarMngmtFavColor");
1958
1952
  }
1959
1953
 
1960
- if (this.getDisplayTextForExecuteOnSelectionForStandardVariant() && (this.getStandardVariantKey() === oItem.key)) {
1961
- oExecuteOnSelectCtrl = new CheckBox(this.getId() + "-manage-exe-0",{
1954
+ if (this.getDisplayTextForExecuteOnSelectionForStandardVariant() && (this.getStandardVariantKey() === oItem.getKey())) {
1955
+ oExecuteOnSelectCtrl = new CheckBox(sIdPrefix + "-exe-" + nPos, {
1962
1956
  wrapping: true,
1963
- text: this.getDisplayTextForExecuteOnSelectionForStandardVariant(),
1964
- select: fSelectCB,
1965
- selected: '{' + this._sModelName + ">executeOnSelect}"
1966
- });
1967
- } else if (this.getStandardVariantKey() === oItem.key) {
1968
- oExecuteOnSelectCtrl = new CheckBox(this.getId() + "-manage-exe-0",{
1969
- text: "",
1970
- select: fSelectCB,
1971
- selected: '{' + this._sModelName + ">executeOnSelect}"
1957
+ text: '{' + sModelName + ">/displayTextForExecuteOnSelectionForStandardVariant}",
1958
+ selected: '{' + sModelName + ">executeOnSelect}"
1972
1959
  });
1973
1960
  } else {
1974
- oExecuteOnSelectCtrl = new CheckBox({
1961
+ oExecuteOnSelectCtrl = new CheckBox(sIdPrefix + "-exe-" + nPos, {
1975
1962
  text: "",
1976
- select: fSelectCB,
1977
- selected: '{' + this._sModelName + ">executeOnSelect}"
1963
+ selected: '{' + sModelName + ">executeOnSelect}"
1978
1964
  });
1979
1965
  }
1980
1966
 
1981
1967
  // roles
1982
- if (this._sStyleClass && (oItem.key !== this.getStandardVariantKey())) {
1968
+ if (this._sStyleClass && (oItem.getKey() !== this.getStandardVariantKey())) {
1983
1969
  var oText = new Text({ wrapping: false });
1984
- this._determineRolesSpecificText(oItem.contexts, oText);
1970
+ this._determineRolesSpecificText(oItem.getContexts(), oText);
1985
1971
  var oIcon = new Icon({
1986
1972
  src: "sap-icon://edit",
1987
1973
  press: fRolesPressed
1988
1974
  });
1989
1975
  oIcon.addStyleClass("sapMVarMngmtRolesEdit");
1990
1976
  oIcon.setTooltip(this._oRb.getText("VARIANT_MANAGEMENT_VISIBILITY_ICON_TT"));
1991
- oRolesCell = new HBox({
1977
+ oRolesCell = new HBox(sIdPrefix + "-role-" + nPos, {
1992
1978
  items: [oText, oIcon]
1993
1979
  });
1994
1980
  } else {
1995
1981
  oRolesCell = new Text();
1996
1982
  }
1997
1983
 
1984
+
1998
1985
  return new ColumnListItem({
1999
1986
  cells: [
2000
- oFavoriteIcon, oNameControl, new Text({
1987
+ oFavoriteIcon, oNameControl, new Text(sIdPrefix + "-type-" + nPos, {
2001
1988
  text: {
2002
1989
  path: "sharing",
2003
- model: this._sModelName,
1990
+ model: sModelName,
2004
1991
  formatter: function(sValue) {
2005
1992
  return this._oRb.getText(sValue === "private" ? "VARIANT_MANAGEMENT_PRIVATE" : "VARIANT_MANAGEMENT_PUBLIC");
2006
1993
  }.bind(this)
2007
1994
  },
2008
1995
  textAlign: "Center"
2009
- }), new RadioButton({
1996
+ }), new RadioButton(sIdPrefix + "-def-" + nPos, {
2010
1997
  groupName: this.getId(),
2011
1998
  select: fSelectRB,
2012
1999
  selected: {
2013
- path: sBindingPath + "/defaultVariant",
2014
- model: this._sModelName,
2000
+ path: "/defaultKey",
2001
+ model: sModelName,
2015
2002
  formatter: function(sKey) {
2016
- return oItem.key === sKey;
2003
+ return oItem.getKey() === sKey;
2017
2004
  }
2018
2005
  }
2019
- }), oExecuteOnSelectCtrl, oRolesCell, new Text({
2020
- text: '{' + this._sModelName + ">author}",
2006
+ }), oExecuteOnSelectCtrl, oRolesCell, new Text(sIdPrefix + "-author-" + nPos, {
2007
+ text: '{' + sModelName + ">author}",
2021
2008
  textAlign: "Begin"
2022
2009
  }), oDeleteButton, new Text({
2023
- text: '{' + this._sModelName + ">key}"
2010
+ text: '{' + sModelName + ">key}"
2024
2011
  })
2025
2012
  ]
2026
2013
  });
2027
2014
  };
2028
2015
 
2016
+
2029
2017
  VariantManagement.prototype._openManagementDialog = function() {
2030
2018
  this._createManagementDialog();
2031
2019
 
@@ -2036,39 +2024,25 @@ sap.ui.define([
2036
2024
  this._suspendManagementTableBinding();
2037
2025
 
2038
2026
  this._clearDeletedItems();
2039
- // this.oManagementSave.setEnabled(false);
2027
+ this._clearRenamedItems();
2028
+ this._sDefaultKey = this.getDefaultKey();
2029
+ this._sOriginalDefaultKey = this._sDefaultKey;
2030
+
2031
+
2040
2032
  this._oSearchFieldOnMgmtDialog.setValue("");
2041
2033
 
2042
- // Ideally, this should be done only once in <code>_createtManagementDialog</code>. However, the binding does not recognize a change if filtering is involved.
2034
+ // Ideally, this should be done only once in <code>_createManagementDialog</code>. However, the binding does not recognize a change if filtering is involved.
2043
2035
  // After a deletion on the UI, the item is filtered out <code>.visible=false</code>. The real deletion will occur only when <i>OK</i> is pressed.
2044
2036
  // Since the filtered items and the result after the real deletion are identical, no change is detected. Based on this, the context on the table is
2045
2037
  // not invalidated....
2046
2038
  // WA: Always do the binding while opening the dialog.
2047
2039
  if (this._bDeleteOccured) {
2048
2040
  this._bDeleteOccured = false;
2049
- this.oManagementTable.bindAggregation("items", {
2050
- path: "variants",
2051
- model: this._sModelName,
2052
- factory: this._templateFactoryManagementDialog.bind(this),
2053
- filters: this._getVisibleFilter()
2054
- });
2055
- }
2056
2041
 
2057
- this.oManagementDialog.open();
2058
- };
2059
-
2060
- VariantManagement.prototype._assignColumnInfoForDeleteButton = function(oDeleteButton) {
2061
- if (!this._oInvisibleDeleteColumnName) {
2062
- this._oInvisibleDeleteColumnName = new InvisibleText({
2063
- text: this._oRb.getText("VARIANT_MANAGEMENT_ACTION_COLUMN")
2064
- });
2065
-
2066
- this.oManagementDialog.addContent(this._oInvisibleDeleteColumnName);
2042
+ this.oManagementTable.getBinding("items").filter(this._getVisibleFilter());
2067
2043
  }
2068
2044
 
2069
- if (this._oInvisibleDeleteColumnName) {
2070
- oDeleteButton.addAriaLabelledBy(this._oInvisibleDeleteColumnName);
2071
- }
2045
+ this.oManagementDialog.open();
2072
2046
  };
2073
2047
 
2074
2048
  VariantManagement.prototype._toggleIconActivityState = function(oIcon, oItem, bToInActive) {
@@ -2076,7 +2050,7 @@ sap.ui.define([
2076
2050
  return;
2077
2051
  }
2078
2052
 
2079
- if (oItem.key === this.getStandardVariantKey()) {
2053
+ if (oItem.getKey() === this.getStandardVariantKey()) {
2080
2054
  return;
2081
2055
  }
2082
2056
 
@@ -2089,19 +2063,36 @@ sap.ui.define([
2089
2063
  }
2090
2064
  };
2091
2065
 
2066
+
2067
+ VariantManagement.prototype._handleManageTitleChange = function(oInput, oItem) {
2068
+ this._checkVariantNameConstraints(oInput, oItem.getKey());
2069
+
2070
+ this._addRenamedItem(oItem);
2071
+ };
2072
+
2092
2073
  VariantManagement.prototype._handleManageDefaultVariantChange = function(oRadioButton, oItem, bSelected) {
2093
- var sKey = oItem.key;
2074
+ var sKey = oItem.getKey();
2094
2075
 
2095
2076
  if (oRadioButton) {
2096
2077
  var oIcon = oRadioButton.getParent().getCells()[VariantManagement.COLUMN_FAV_IDX];
2097
2078
 
2098
2079
  if (bSelected) {
2099
- if (this.getShowFavorites() && !oItem.favorite) {
2100
- oItem.favorite = true;
2101
- this._setFavoriteIcon(oIcon, true);
2080
+ if (this.getSupportFavorites() && !oItem.getFavorite()) {
2081
+ oItem.setFavorite(true);
2082
+
2083
+ var oRow = this._getRowForKey(oItem.getKey());
2084
+ if (oRow) {
2085
+ var aCells = oRow.getCells();
2086
+ if (aCells) {
2087
+ oIcon = aCells[VariantManagement.COLUMN_FAV_IDX];
2088
+ this._setFavoriteIcon(oIcon, true);
2089
+
2090
+ aCells[VariantManagement.COLUMN_FAV_IDX + 3].focus(); // focus on default
2091
+ }
2092
+ }
2102
2093
  }
2103
2094
 
2104
- this.setDefaultVariantKey(sKey);
2095
+ this.setDefaultKey(sKey);
2105
2096
  }
2106
2097
 
2107
2098
  this._toggleIconActivityState(oIcon, oItem, bSelected);
@@ -2109,51 +2100,74 @@ sap.ui.define([
2109
2100
  };
2110
2101
 
2111
2102
  VariantManagement.prototype._handleManageCancelPressed = function() {
2112
- var sDefaultVariantKey;
2113
- var oModel;
2114
- this._getDeletedItems().forEach(function(oItem) {
2115
- oItem.visible = true;
2116
- });
2117
2103
 
2118
- this._getItems().forEach(function(oItem) {
2119
- oItem.title = oItem.originalTitle;
2120
- oItem.favorite = oItem.originalFavorite;
2121
- oItem.executeOnSelect = oItem.originalExecuteOnSelect;
2122
- oItem.contexts = oItem.originalContexts;
2104
+ if (this._getDeletedItems().length > 0) {
2105
+ this._bDeleteOccured = true;
2106
+
2107
+ this._getDeletedItems().forEach(function(sKey) {
2108
+ var oItem = this._getItemByKey(sKey);
2109
+ if (oItem) {
2110
+ oItem.setVisible(true);
2111
+ }
2112
+ }.bind(this));
2113
+ }
2114
+
2115
+ this.getItems().forEach(function(oItem) {
2116
+ if (oItem.getVisible()) {
2117
+ oItem.setTitle(oItem.getOriginalTitle());
2118
+ oItem.setFavorite(oItem.getOriginalFavorite());
2119
+ oItem.setExecuteOnSelect(oItem.getOriginalExecuteOnSelect());
2120
+ oItem.setContexts(oItem.getOriginalContexts());
2121
+ }
2123
2122
  });
2124
2123
 
2125
- sDefaultVariantKey = this.getOriginalDefaultVariantKey();
2126
- if (sDefaultVariantKey !== this.getDefaultVariantKey()) {
2127
- this.setDefaultVariantKey(sDefaultVariantKey);
2124
+ if (this._sOriginalDefaultKey !== this.getDefaultKey()) {
2125
+ this.setDefaultKey(this._sOriginalDefaultKey);
2128
2126
  }
2129
2127
 
2130
- oModel = this.getModel(this._sModelName);
2131
- if (oModel) {
2132
- oModel.checkUpdate();
2128
+ this._clearRenamedItems();
2129
+ this._clearDeletedItems();
2130
+
2131
+ if (this._oManagedObjectModel) {
2132
+ this._oManagedObjectModel.checkUpdate();
2133
2133
  }
2134
+
2135
+ this.fireManageCancel();
2136
+
2137
+ //fireManageCancel may have deleted the ManageViews dialog
2138
+ // if (this.oManagementDialog) {
2139
+ // this.oManagementTable.getBinding("items").filter(this._getVisibleFilter());
2140
+ // }
2134
2141
  };
2135
2142
 
2136
2143
  VariantManagement.prototype._handleManageFavoriteChanged = function(oIcon, oItem) {
2137
2144
  // if (!this._anyInErrorState(this.oManagementTable)) {
2138
2145
  // this.oManagementSave.setEnabled(true);
2139
2146
  // }
2140
- if (this.getStandardVariantKey() === oItem.key) {
2147
+ if (this.getStandardVariantKey() === oItem.getKey()) {
2141
2148
  return;
2142
2149
  }
2143
2150
 
2144
- if ((this.getDefaultVariantKey() === oItem.key) && oItem.favorite) {
2151
+ if ((this.getDefaultKey() === oItem.getKey()) && oItem.getFavorite()) {
2145
2152
  return;
2146
2153
  }
2147
2154
 
2148
- oItem.favorite = !oItem.favorite;
2149
- this._setFavoriteIcon(oIcon, oItem.favorite);
2155
+ oItem.setFavorite(!oItem.getFavorite());
2156
+ var oRow = this._getRowForKey(oItem.getKey());
2157
+ if (oRow) {
2158
+ oRow.getCells()[VariantManagement.COLUMN_FAV_IDX].focus();
2159
+ }
2150
2160
  };
2151
2161
 
2162
+
2163
+
2152
2164
  VariantManagement.prototype._getRowForKey = function(sKey) {
2153
2165
  var oRowForKey = null;
2154
2166
  if (this.oManagementTable) {
2155
2167
  this.oManagementTable.getItems().some(function(oRow) {
2156
- if (sKey === oRow.getCells()[0].getBindingContext(this._sModelName).getObject().key) {
2168
+ var oColumnItem = oRow.getCells()[0].getParent();
2169
+ var oItem = this.getModel("$mVariants").getObject(oColumnItem.getBindingContextPath());
2170
+ if (sKey === oItem.getKey()) {
2157
2171
  oRowForKey = oRow;
2158
2172
  }
2159
2173
 
@@ -2164,50 +2178,104 @@ sap.ui.define([
2164
2178
  return oRowForKey;
2165
2179
  };
2166
2180
 
2181
+ VariantManagement.prototype._determineIndex = function(sPath) {
2182
+ var nIdx = -1;
2183
+ var nPos = sPath.indexOf('/', 1);
2184
+ if (nPos > 0) {
2185
+ nIdx = parseInt(sPath.substring(nPos + 1));
2186
+ }
2187
+
2188
+ return nIdx;
2189
+ };
2190
+
2167
2191
  VariantManagement.prototype._handleManageDeletePressed = function(oItem) {
2168
- var oModel;
2169
- var sKey = oItem.key;
2192
+ var sKey = oItem.getKey();
2170
2193
 
2171
2194
  // do not allow the deletion of the standard
2172
2195
  if (this.getStandardVariantKey() === sKey) {
2173
2196
  return;
2174
2197
  }
2175
2198
 
2176
- oItem.visible = false;
2199
+ oItem.setVisible(false);
2177
2200
  this._addDeletedItem(oItem);
2178
2201
 
2179
- if ((sKey === this.getDefaultVariantKey())) {
2180
- this.setDefaultVariantKey(this.getStandardVariantKey());
2181
- if (this.getShowFavorites()) {
2202
+ if (sKey === this.getDefaultKey()) {
2203
+ this.setDefaultKey(this.getStandardVariantKey());
2204
+ if (this.getSupportFavorites()) {
2182
2205
  var oNewDefaultItem = this._getItemByKey(this.getStandardVariantKey());
2183
- if (oNewDefaultItem && !oNewDefaultItem.favorite) {
2206
+ if (oNewDefaultItem && !oNewDefaultItem.getFavorite()) {
2184
2207
  var oRow = this._getRowForKey(this.getStandardVariantKey());
2185
2208
  if (oRow) {
2186
- oNewDefaultItem.favorite = true;
2209
+ oNewDefaultItem.setFavorite(true);
2187
2210
  this._setFavoriteIcon(oRow.getCells()[VariantManagement.COLUMN_FAV_IDX], true);
2188
2211
  }
2189
2212
  }
2190
2213
  }
2191
2214
  }
2192
2215
 
2193
- oModel = this.getModel(this._sModelName);
2194
- if (oModel) {
2195
- oModel.checkUpdate();
2196
- }
2216
+ // var oModel = this.oManagementTable.getModel("$mVariants");
2217
+ // if (oModel) {
2218
+ // oModel.checkUpdate();
2219
+ // }
2220
+
2221
+ this.oManagementTable.getBinding("items").filter(this._getVisibleFilter());
2197
2222
 
2198
2223
  this.oManagementCancel.focus();
2199
2224
  };
2200
2225
 
2201
- VariantManagement.prototype._handleManageExecuteOnSelectionChanged = function() {
2202
- // if (!this._anyInErrorState(this.oManagementTable)) {
2203
- // this.oManagementSave.setEnabled(true);
2204
- // }
2226
+ VariantManagement.prototype._collectManageData = function() {
2227
+
2228
+ var oVariantInfo = {};
2229
+
2230
+ var sDefault = this.getDefaultKey();
2231
+ if (sDefault !== this._sOriginalDefaultKey){
2232
+ oVariantInfo.def = sDefault;
2233
+ }
2234
+
2235
+ this.getItems().forEach(function(oItem) {
2236
+
2237
+ if (!oItem.getVisible()) {
2238
+ if (!oVariantInfo.deleted) {
2239
+ oVariantInfo.deleted = [];
2240
+ }
2241
+ oVariantInfo.deleted.push(oItem.getKey());
2242
+ }
2243
+
2244
+ if (oItem.getVisible() && (oItem.getFavorite() !== oItem.getOriginalFavorite())) {
2245
+ if (!oVariantInfo.fav) {
2246
+ oVariantInfo.fav = [];
2247
+ }
2248
+ oVariantInfo.fav.push({ key: oItem.getKey(), visible: oItem.getFavorite()});
2249
+ }
2250
+
2251
+ if (oItem.getVisible() && (oItem.getTitle() !== oItem.getOriginalTitle())) {
2252
+ if (!oVariantInfo.renamed) {
2253
+ oVariantInfo.renamed = [];
2254
+ }
2255
+ oVariantInfo.renamed.push({ key: oItem.getKey(), name: oItem.getTitle()});
2256
+ }
2257
+
2258
+ if (oItem.getVisible() && (oItem.getExecuteOnSelect() !== oItem.getOriginalExecuteOnSelect())) {
2259
+ if (!oVariantInfo.exe) {
2260
+ oVariantInfo.exe = [];
2261
+ }
2262
+ oVariantInfo.exe.push({ key: oItem.getKey(), exe: oItem.getExecuteOnSelect()});
2263
+ }
2264
+
2265
+ if (oItem.getVisible() && this._hasContextsChanged(oItem)) {
2266
+ if (!oVariantInfo.contexts) {
2267
+ oVariantInfo.contexts = [];
2268
+ }
2269
+ oVariantInfo.contexts.push({ key: oItem.getKey(), contexts: oItem.getContexts()});
2270
+ }
2271
+
2272
+ }.bind(this));
2273
+
2274
+ return oVariantInfo;
2205
2275
  };
2206
2276
 
2207
- VariantManagement.prototype._handleManageTitleChanged = function() {
2208
- // if (!this._anyInErrorState(this.oManagementTable)) {
2209
- // this.oManagementSave.setEnabled(true);
2210
- // }
2277
+ VariantManagement.prototype._hasContextsChanged = function(oItem) {
2278
+ return (JSON.stringify(oItem.getContexts()) !== JSON.stringify(oItem.getOriginalContexts()));
2211
2279
  };
2212
2280
 
2213
2281
  VariantManagement.prototype._handleManageSavePressed = function() {
@@ -2215,12 +2283,14 @@ sap.ui.define([
2215
2283
  return;
2216
2284
  }
2217
2285
 
2218
- this._getDeletedItems().some(function(oItem) {
2219
- if (oItem.key === this.getCurrentVariantKey()) {
2286
+ this.oManagementDialog.close();
2287
+
2288
+ this._getDeletedItems().some(function(sItemKey) {
2289
+ if (sItemKey === this.getSelectedKey()) {
2220
2290
  var sKey = this.getStandardVariantKey();
2221
2291
 
2222
2292
  this.setModified(false);
2223
- this.setCurrentVariantKey(sKey);
2293
+ this.setSelectedKey(sKey);
2224
2294
 
2225
2295
  this.fireSelect({
2226
2296
  key: sKey
@@ -2231,12 +2301,19 @@ sap.ui.define([
2231
2301
  return false;
2232
2302
  }.bind(this));
2233
2303
 
2234
- this.fireManage({
2304
+ if (this._getRenamedItems().indexOf(this.getSelectedKey()) >= 0) {
2305
+ var oBinding = this.oVariantText.getBinding("text");
2306
+ if (oBinding) {
2307
+ oBinding.checkUpdate(true);
2308
+ }
2309
+ }
2235
2310
 
2236
- });
2311
+ this.fireManage(this._collectManageData());
2237
2312
 
2238
- this._resumeManagementTableBinding();
2239
- this.oManagementDialog.close();
2313
+ // the manage views dialog may be deleted.
2314
+ if (this.oManagementDialog) {
2315
+ this._resumeManagementTableBinding();
2316
+ }
2240
2317
  };
2241
2318
 
2242
2319
  VariantManagement.prototype._resumeManagementTableBinding = function() {
@@ -2257,14 +2334,28 @@ sap.ui.define([
2257
2334
  }
2258
2335
  };
2259
2336
 
2260
- VariantManagement.prototype._anyInErrorState = function(oManagementTable) {
2261
- var aItems;
2337
+ VariantManagement.prototype._focusOnFirstInputInErrorState = function(oManagementTable) {
2338
+ if (oManagementTable) {
2339
+ oManagementTable.getItems().some(function(oItem) {
2340
+ var oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2341
+ if (oInput && oInput.getValueState && (oInput.getValueState() === ValueState.Error)) {
2342
+ oInput.getDomRef().scrollIntoView();
2343
+ oInput.focus();
2344
+ return true;
2345
+ }
2346
+
2347
+ return false;
2348
+ });
2349
+ }
2350
+ };
2351
+
2352
+
2353
+ VariantManagement.prototype._anyInErrorStateManageTable = function(oManagementTable) {
2262
2354
  var oInput;
2263
2355
  var bInError = false;
2264
2356
 
2265
2357
  if (oManagementTable) {
2266
- aItems = oManagementTable.getItems();
2267
- aItems.some(function(oItem) {
2358
+ oManagementTable.getItems().some(function(oItem) {
2268
2359
  oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2269
2360
  if (oInput && oInput.getValueState && (oInput.getValueState() === ValueState.Error)) {
2270
2361
  bInError = true;
@@ -2276,6 +2367,42 @@ sap.ui.define([
2276
2367
  return bInError;
2277
2368
  };
2278
2369
 
2370
+ VariantManagement.prototype._anyInErrorState = function(oManagementTable) {
2371
+ if (this._anyInErrorStateManageTable(oManagementTable)) {
2372
+ return true;
2373
+ }
2374
+
2375
+ var aRenamedKeys = this._getRenamedItems();
2376
+
2377
+ for (var i = aRenamedKeys.length - 1; i >= 0; i--) {
2378
+ var oItem = this._getItemByKey(aRenamedKeys[i]);
2379
+ if (oItem) {
2380
+ if (oItem.getTitle() === oItem.getOriginalTitle()) {
2381
+ this._removeRenamedItem(oItem);
2382
+ }
2383
+ }
2384
+ }
2385
+
2386
+ var bError = false;
2387
+ this._getRenamedItems().some(function(sKey, nIdx) {
2388
+ var oItem = this._getItemByKey(sKey);
2389
+ if (oItem) {
2390
+ bError = this._checkIsDuplicateInModel(oItem.getTitle(), sKey);
2391
+ }
2392
+ return bError;
2393
+
2394
+ }.bind(this));
2395
+
2396
+ if (bError) {
2397
+ this._oSearchFieldOnMgmtDialog.setValue("");
2398
+ this._triggerSearchInManageDialogByValue("", oManagementTable);
2399
+
2400
+ this._focusOnFirstInputInErrorState(oManagementTable);
2401
+ }
2402
+
2403
+ return bError;
2404
+ };
2405
+
2279
2406
  // UTILS
2280
2407
 
2281
2408
  VariantManagement.prototype._getFilters = function(oFilter) {
@@ -2287,7 +2414,7 @@ sap.ui.define([
2287
2414
 
2288
2415
  aFilters.push(this._getVisibleFilter());
2289
2416
 
2290
- if (this.getShowFavorites()) {
2417
+ if (this.getSupportFavorites()) {
2291
2418
  aFilters.push(this._getFilterFavorites());
2292
2419
  }
2293
2420
 
@@ -2311,12 +2438,12 @@ sap.ui.define([
2311
2438
  };
2312
2439
 
2313
2440
 
2314
- VariantManagement.prototype._verifyVariantNameConstraints = function(oInputField, sKey) {
2441
+ VariantManagement.prototype._verifyVariantNameConstraints = function(oInputField, sKey, sTitle) {
2315
2442
  if (!oInputField) {
2316
2443
  return;
2317
2444
  }
2318
2445
 
2319
- var sValue = oInputField.getValue();
2446
+ var sValue = sTitle || oInputField.getValue();
2320
2447
  sValue = sValue.trim();
2321
2448
 
2322
2449
  if (!this._checkIsDuplicate(sValue, sKey)) {
@@ -2339,7 +2466,13 @@ sap.ui.define([
2339
2466
  }
2340
2467
  } else {
2341
2468
  oInputField.setValueState(ValueState.Error);
2342
- oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_DUPLICATE"));
2469
+
2470
+ if (this._oSearchFieldOnMgmtDialog && this._oSearchFieldOnMgmtDialog.getValue()) {
2471
+ oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_DUPLICATE_SAVE"));
2472
+ } else {
2473
+ oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_DUPLICATE"));
2474
+ }
2475
+
2343
2476
  }
2344
2477
  };
2345
2478
 
@@ -2358,11 +2491,11 @@ sap.ui.define([
2358
2491
  if (this.oManagementTable) {
2359
2492
  aItems = this.oManagementTable.getItems();
2360
2493
  aItems.some(function(oItem) {
2361
- var oObject = oItem.getBindingContext(this._sModelName).getObject();
2362
- if (oObject && oObject.visible) {
2494
+ var oObject = oItem.getBindingContext("$mVariants").getObject();
2495
+ if (oObject && oObject.getVisible()) {
2363
2496
  var oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2364
2497
  if (oInput && oInput.getValueState && (oInput.getValueState() === ValueState.Error)) {
2365
- this._verifyVariantNameConstraints(oInput, oObject.key);
2498
+ this._verifyVariantNameConstraints(oInput, oObject.getKey());
2366
2499
  if (oInput.getValueState() === ValueState.Error) {
2367
2500
  bInError = true;
2368
2501
  }
@@ -2378,7 +2511,10 @@ sap.ui.define([
2378
2511
 
2379
2512
  VariantManagement.prototype._checkIsDuplicate = function(sValue, sKey) {
2380
2513
  if (this.oManagementDialog && this.oManagementDialog.isOpen()) {
2381
- return this._checkIsDuplicateInManageTable(sValue, sKey);
2514
+ var bResult = this._checkIsDuplicateInManageTable(sValue, sKey);
2515
+ if (this._oSearchFieldOnMgmtDialog && this._oSearchFieldOnMgmtDialog.getValue() && bResult) {
2516
+ return bResult;
2517
+ }
2382
2518
  }
2383
2519
 
2384
2520
  return this._checkIsDuplicateInModel(sValue, sKey);
@@ -2389,8 +2525,8 @@ sap.ui.define([
2389
2525
  var aItems = this._getItems();
2390
2526
  var sLowerCaseValue = sValue.toLowerCase();
2391
2527
  aItems.some(function(oItem) {
2392
- if (oItem.title.toLowerCase() === sLowerCaseValue) {
2393
- if (sKey && (sKey === oItem.key)) {
2528
+ if (oItem.getTitle().toLowerCase() === sLowerCaseValue) {
2529
+ if (sKey && (sKey === oItem.getKey())) {
2394
2530
  return false;
2395
2531
  }
2396
2532
  bDublicate = true;
@@ -2411,11 +2547,11 @@ sap.ui.define([
2411
2547
  aItems = this.oManagementTable.getItems();
2412
2548
  aItems.some(function(oItem) {
2413
2549
  var sTitleLowerCase;
2414
- var oObject = oItem.getBindingContext(this._sModelName).getObject();
2415
- if (oObject && oObject.visible) {
2550
+ var oObject = oItem.getBindingContext("$mVariants").getObject();
2551
+ if (oObject && oObject.getVisible()) {
2416
2552
  var oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2417
2553
 
2418
- if (oInput && (oObject.key !== sKey)) {
2554
+ if (oInput && (oObject.getKey() !== sKey)) {
2419
2555
  if (oInput.isA("sap.m.Input")) {
2420
2556
  sTitleLowerCase = oInput.getValue().toLowerCase();
2421
2557
  } else {
@@ -2427,7 +2563,7 @@ sap.ui.define([
2427
2563
  }
2428
2564
  }
2429
2565
  return bInError;
2430
- }.bind(this));
2566
+ });
2431
2567
  }
2432
2568
 
2433
2569
  return bInError;
@@ -2437,7 +2573,14 @@ sap.ui.define([
2437
2573
  VariantManagement.prototype.exit = function() {
2438
2574
  var oModel;
2439
2575
 
2440
- if (this.oVariantInvisibleText) {
2576
+ this._oObserver.disconnect();
2577
+ this._oObserver = undefined;
2578
+
2579
+ Control.prototype.exit.apply(this, arguments);
2580
+ this._clearDeletedItems();
2581
+ this._clearRenamedItems();
2582
+
2583
+ if (this.oVariantInvisibleText && !this.oVariantInvisibleText._bIsBeingDestroyed) {
2441
2584
  this.oVariantInvisibleText.destroy(true);
2442
2585
  this.oVariantInvisibleText = undefined;
2443
2586
  }
@@ -2471,18 +2614,21 @@ sap.ui.define([
2471
2614
  this.oVariantPopoverTrigger = undefined;
2472
2615
  this._oSearchField = undefined;
2473
2616
  this._oSearchFieldOnMgmtDialog = undefined;
2617
+ this._sDefaultKey = undefined;
2474
2618
 
2475
2619
  oModel = this.getModel(VariantManagement.INNER_MODEL_NAME);
2476
2620
  if (oModel) {
2477
2621
  oModel.destroy();
2478
2622
  }
2623
+ if (this._oManagedObjectModel) {
2624
+ this._oManagedObjectModel.destroy();
2625
+ this._oManagedObjectModel = undefined;
2626
+ }
2479
2627
 
2480
2628
  this._oRolesComponentContainer = null;
2481
- this._sStyleClass = null;
2482
2629
 
2483
- this._fRegisteredApplyAutomaticallyOnStandardVariant = null;
2484
2630
 
2485
- if (this._oRolesDialog) {
2631
+ if (this._oRolesDialog && !this._oRolesDialog._bIsBeingDestroyed) {
2486
2632
  this._oRolesDialog.destroy();
2487
2633
  this._oRolesDialog = null;
2488
2634
  }