@openui5/sap.m 1.101.0 → 1.102.2

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 (447) hide show
  1. package/THIRDPARTY.txt +1 -1
  2. package/package.json +4 -4
  3. package/src/sap/m/.library +2 -1
  4. package/src/sap/m/AccButton.js +1 -1
  5. package/src/sap/m/ActionListItem.js +1 -1
  6. package/src/sap/m/ActionSelect.js +1 -1
  7. package/src/sap/m/ActionSheet.js +1 -1
  8. package/src/sap/m/App.js +1 -1
  9. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  10. package/src/sap/m/Avatar.js +1 -1
  11. package/src/sap/m/Bar.js +12 -22
  12. package/src/sap/m/Breadcrumbs.js +3 -3
  13. package/src/sap/m/BusyDialog.js +1 -1
  14. package/src/sap/m/BusyIndicator.js +1 -1
  15. package/src/sap/m/Button.js +1 -1
  16. package/src/sap/m/Carousel.js +1 -1
  17. package/src/sap/m/CarouselLayout.js +1 -1
  18. package/src/sap/m/CheckBox.js +1 -1
  19. package/src/sap/m/ColorPalette.js +13 -1
  20. package/src/sap/m/ColorPalettePopover.js +1 -1
  21. package/src/sap/m/Column.js +10 -1
  22. package/src/sap/m/ColumnHeaderPopover.js +1 -1
  23. package/src/sap/m/ColumnListItem.js +1 -1
  24. package/src/sap/m/ColumnListItemRenderer.js +6 -2
  25. package/src/sap/m/ColumnPopoverActionItem.js +1 -1
  26. package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
  27. package/src/sap/m/ColumnPopoverItem.js +1 -1
  28. package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
  29. package/src/sap/m/ColumnPopoverSortItem.js +1 -1
  30. package/src/sap/m/ComboBox.js +22 -2
  31. package/src/sap/m/ComboBoxBase.js +1 -1
  32. package/src/sap/m/ComboBoxTextField.js +1 -1
  33. package/src/sap/m/CustomDynamicDateOption.js +1 -1
  34. package/src/sap/m/CustomListItem.js +1 -1
  35. package/src/sap/m/CustomTile.js +1 -1
  36. package/src/sap/m/CustomTreeItem.js +1 -1
  37. package/src/sap/m/DatePicker.js +24 -6
  38. package/src/sap/m/DateRangeSelection.js +2 -2
  39. package/src/sap/m/DateTimeField.js +22 -10
  40. package/src/sap/m/DateTimeInput.js +1 -1
  41. package/src/sap/m/DateTimePicker.js +8 -7
  42. package/src/sap/m/Dialog.js +2 -2
  43. package/src/sap/m/DialogRenderer.js +1 -1
  44. package/src/sap/m/DisplayListItem.js +1 -1
  45. package/src/sap/m/DraftIndicator.js +1 -1
  46. package/src/sap/m/DynamicDate.js +1 -1
  47. package/src/sap/m/DynamicDateFormat.js +41 -5
  48. package/src/sap/m/DynamicDateOption.js +1 -1
  49. package/src/sap/m/DynamicDateRange.js +87 -24
  50. package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
  51. package/src/sap/m/ExpandableText.js +1 -1
  52. package/src/sap/m/FacetFilter.js +8 -1
  53. package/src/sap/m/FacetFilterItem.js +1 -1
  54. package/src/sap/m/FacetFilterList.js +1 -1
  55. package/src/sap/m/FeedContent.js +1 -1
  56. package/src/sap/m/FeedInput.js +1 -1
  57. package/src/sap/m/FeedListItem.js +1 -1
  58. package/src/sap/m/FeedListItemAction.js +1 -1
  59. package/src/sap/m/Fiori20Adapter.js +2 -2
  60. package/src/sap/m/FlexBox.js +1 -1
  61. package/src/sap/m/FlexItemData.js +1 -1
  62. package/src/sap/m/FormattedText.js +10 -10
  63. package/src/sap/m/GenericTag.js +1 -1
  64. package/src/sap/m/GenericTile.js +97 -16
  65. package/src/sap/m/GenericTileLineModeRenderer.js +3 -0
  66. package/src/sap/m/GenericTileRenderer.js +96 -60
  67. package/src/sap/m/GroupHeaderListItem.js +1 -1
  68. package/src/sap/m/GrowingEnablement.js +127 -93
  69. package/src/sap/m/GrowingList.js +1 -1
  70. package/src/sap/m/HBox.js +1 -1
  71. package/src/sap/m/HeaderContainer.js +48 -44
  72. package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
  73. package/src/sap/m/IconTabBar.js +2 -2
  74. package/src/sap/m/IconTabBarSelectList.js +1 -1
  75. package/src/sap/m/IconTabFilter.js +1 -1
  76. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  77. package/src/sap/m/IconTabHeader.js +1 -1
  78. package/src/sap/m/IconTabSeparator.js +1 -1
  79. package/src/sap/m/IllustratedMessage.js +1 -1
  80. package/src/sap/m/Illustration.js +1 -1
  81. package/src/sap/m/Image.js +1 -1
  82. package/src/sap/m/ImageContent.js +1 -1
  83. package/src/sap/m/Input.js +1 -1
  84. package/src/sap/m/InputBase.js +5 -5
  85. package/src/sap/m/InputListItem.js +1 -1
  86. package/src/sap/m/Label.js +1 -1
  87. package/src/sap/m/LightBox.js +1 -1
  88. package/src/sap/m/LightBoxItem.js +1 -1
  89. package/src/sap/m/Link.js +1 -1
  90. package/src/sap/m/List.js +1 -1
  91. package/src/sap/m/ListBase.js +17 -16
  92. package/src/sap/m/ListItemBase.js +5 -4
  93. package/src/sap/m/MaskEnabler.js +1 -1
  94. package/src/sap/m/MaskInput.js +1 -1
  95. package/src/sap/m/MaskInputRule.js +1 -1
  96. package/src/sap/m/Menu.js +1 -1
  97. package/src/sap/m/MenuButton.js +1 -1
  98. package/src/sap/m/MenuItem.js +1 -1
  99. package/src/sap/m/MenuListItem.js +1 -1
  100. package/src/sap/m/MessageItem.js +1 -1
  101. package/src/sap/m/MessageListItem.js +1 -1
  102. package/src/sap/m/MessagePage.js +1 -1
  103. package/src/sap/m/MessagePopover.js +1 -1
  104. package/src/sap/m/MessagePopoverItem.js +1 -1
  105. package/src/sap/m/MessageStrip.js +1 -1
  106. package/src/sap/m/MessageToast.js +1 -1
  107. package/src/sap/m/MessageView.js +1 -1
  108. package/src/sap/m/MultiComboBox.js +1 -1
  109. package/src/sap/m/MultiEditField.js +1 -1
  110. package/src/sap/m/MultiInput.js +8 -3
  111. package/src/sap/m/NavContainer.js +1 -1
  112. package/src/sap/m/NewsContent.js +1 -1
  113. package/src/sap/m/NotificationList.js +1 -1
  114. package/src/sap/m/NotificationListBase.js +175 -79
  115. package/src/sap/m/NotificationListGroup.js +1 -2
  116. package/src/sap/m/NotificationListGroupRenderer.js +4 -16
  117. package/src/sap/m/NotificationListItem.js +5 -16
  118. package/src/sap/m/NotificationListItemRenderer.js +0 -1
  119. package/src/sap/m/NumericContent.js +1 -1
  120. package/src/sap/m/NumericInput.js +1 -1
  121. package/src/sap/m/ObjectAttribute.js +1 -1
  122. package/src/sap/m/ObjectAttributeRenderer.js +1 -1
  123. package/src/sap/m/ObjectHeader.js +1 -1
  124. package/src/sap/m/ObjectIdentifier.js +1 -1
  125. package/src/sap/m/ObjectListItem.js +1 -1
  126. package/src/sap/m/ObjectMarker.js +1 -1
  127. package/src/sap/m/ObjectNumber.js +1 -1
  128. package/src/sap/m/ObjectStatus.js +1 -1
  129. package/src/sap/m/OverflowToolbar.js +17 -1
  130. package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
  131. package/src/sap/m/OverflowToolbarButton.js +1 -1
  132. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  133. package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
  134. package/src/sap/m/P13nAnyFilterItem.js +1 -1
  135. package/src/sap/m/P13nColumnsItem.js +1 -1
  136. package/src/sap/m/P13nColumnsPanel.js +1 -1
  137. package/src/sap/m/P13nConditionPanel.js +9 -12
  138. package/src/sap/m/P13nDialog.js +1 -1
  139. package/src/sap/m/P13nDimMeasureItem.js +1 -1
  140. package/src/sap/m/P13nDimMeasurePanel.js +1 -1
  141. package/src/sap/m/P13nFilterItem.js +1 -1
  142. package/src/sap/m/P13nFilterPanel.js +1 -1
  143. package/src/sap/m/P13nGroupItem.js +1 -1
  144. package/src/sap/m/P13nGroupPanel.js +1 -1
  145. package/src/sap/m/P13nItem.js +1 -1
  146. package/src/sap/m/P13nPanel.js +1 -1
  147. package/src/sap/m/P13nSelectionItem.js +1 -1
  148. package/src/sap/m/P13nSelectionPanel.js +1 -1
  149. package/src/sap/m/P13nSortItem.js +1 -1
  150. package/src/sap/m/P13nSortPanel.js +1 -1
  151. package/src/sap/m/PDFViewer.js +2 -2
  152. package/src/sap/m/Page.js +4 -4
  153. package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
  154. package/src/sap/m/PagingButton.js +1 -1
  155. package/src/sap/m/Panel.js +1 -1
  156. package/src/sap/m/PlanningCalendar.js +1 -1
  157. package/src/sap/m/PlanningCalendarHeader.js +1 -1
  158. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  159. package/src/sap/m/PlanningCalendarRow.js +1 -1
  160. package/src/sap/m/PlanningCalendarView.js +1 -1
  161. package/src/sap/m/Popover.js +2 -2
  162. package/src/sap/m/ProgressIndicator.js +1 -1
  163. package/src/sap/m/PullToRefresh.js +1 -1
  164. package/src/sap/m/QuickView.js +1 -1
  165. package/src/sap/m/QuickViewBase.js +1 -1
  166. package/src/sap/m/QuickViewCard.js +1 -1
  167. package/src/sap/m/QuickViewGroup.js +1 -1
  168. package/src/sap/m/QuickViewGroupElement.js +1 -1
  169. package/src/sap/m/QuickViewPage.js +1 -1
  170. package/src/sap/m/RadioButton.js +2 -2
  171. package/src/sap/m/RadioButtonGroup.js +1 -1
  172. package/src/sap/m/RangeSlider.js +8 -5
  173. package/src/sap/m/RatingIndicator.js +1 -1
  174. package/src/sap/m/ResponsivePopover.js +1 -1
  175. package/src/sap/m/ResponsiveScale.js +1 -1
  176. package/src/sap/m/ScrollBar.js +1 -1
  177. package/src/sap/m/ScrollContainer.js +1 -1
  178. package/src/sap/m/SearchField.js +1 -1
  179. package/src/sap/m/SegmentedButton.js +5 -3
  180. package/src/sap/m/SegmentedButtonItem.js +1 -1
  181. package/src/sap/m/Select.js +20 -2
  182. package/src/sap/m/SelectDialog.js +13 -17
  183. package/src/sap/m/SelectDialogBase.js +1 -1
  184. package/src/sap/m/SelectList.js +1 -1
  185. package/src/sap/m/SelectionDetails.js +1 -1
  186. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  187. package/src/sap/m/SelectionDetailsItem.js +1 -1
  188. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  189. package/src/sap/m/Shell.js +1 -1
  190. package/src/sap/m/SimpleFixFlex.js +1 -1
  191. package/src/sap/m/SinglePlanningCalendar.js +1 -1
  192. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  193. package/src/sap/m/SinglePlanningCalendarGrid.js +5 -5
  194. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
  195. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  196. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  197. package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
  198. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  199. package/src/sap/m/SlideTile.js +1 -1
  200. package/src/sap/m/Slider.js +1 -1
  201. package/src/sap/m/SliderTooltip.js +1 -1
  202. package/src/sap/m/SliderTooltipBase.js +1 -1
  203. package/src/sap/m/SliderTooltipContainer.js +1 -1
  204. package/src/sap/m/SplitApp.js +1 -1
  205. package/src/sap/m/SplitButton.js +1 -1
  206. package/src/sap/m/SplitContainer.js +1 -1
  207. package/src/sap/m/StandardDynamicDateOption.js +12 -10
  208. package/src/sap/m/StandardListItem.js +3 -3
  209. package/src/sap/m/StandardListItemRenderer.js +1 -1
  210. package/src/sap/m/StandardTile.js +1 -1
  211. package/src/sap/m/StandardTreeItem.js +1 -1
  212. package/src/sap/m/StepInput.js +1 -1
  213. package/src/sap/m/SuggestionItem.js +1 -1
  214. package/src/sap/m/SuggestionsPopover.js +1 -1
  215. package/src/sap/m/Switch.js +1 -1
  216. package/src/sap/m/TabContainer.js +1 -1
  217. package/src/sap/m/TabContainerItem.js +1 -1
  218. package/src/sap/m/TabStrip.js +5 -3
  219. package/src/sap/m/TabStripItem.js +1 -1
  220. package/src/sap/m/Table.js +7 -1
  221. package/src/sap/m/TablePersoController.js +1 -1
  222. package/src/sap/m/TablePersoDialog.js +1 -1
  223. package/src/sap/m/TablePersoProvider.js +1 -1
  224. package/src/sap/m/TableRenderer.js +27 -0
  225. package/src/sap/m/TableSelectDialog.js +12 -8
  226. package/src/sap/m/Text.js +1 -1
  227. package/src/sap/m/TextArea.js +1 -1
  228. package/src/sap/m/Tile.js +1 -1
  229. package/src/sap/m/TileContainer.js +1 -1
  230. package/src/sap/m/TileContent.js +25 -14
  231. package/src/sap/m/TileContentRenderer.js +16 -7
  232. package/src/sap/m/TimePicker.js +51 -7
  233. package/src/sap/m/TimePickerClock.js +1 -1
  234. package/src/sap/m/TimePickerClocks.js +1 -1
  235. package/src/sap/m/TimePickerInputs.js +1 -1
  236. package/src/sap/m/TimePickerInternals.js +1 -1
  237. package/src/sap/m/TimePickerSlider.js +1 -1
  238. package/src/sap/m/TimePickerSliders.js +1 -1
  239. package/src/sap/m/Title.js +1 -1
  240. package/src/sap/m/TitlePropagationSupport.js +1 -1
  241. package/src/sap/m/ToggleButton.js +1 -1
  242. package/src/sap/m/Token.js +1 -1
  243. package/src/sap/m/Tokenizer.js +14 -3
  244. package/src/sap/m/Toolbar.js +7 -1
  245. package/src/sap/m/ToolbarLayoutData.js +1 -1
  246. package/src/sap/m/ToolbarSeparator.js +1 -1
  247. package/src/sap/m/ToolbarSpacer.js +1 -1
  248. package/src/sap/m/Tree.js +1 -1
  249. package/src/sap/m/TreeItemBase.js +1 -1
  250. package/src/sap/m/UploadCollection.js +1 -1
  251. package/src/sap/m/UploadCollectionItem.js +2 -1
  252. package/src/sap/m/UploadCollectionParameter.js +2 -1
  253. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +2 -1
  254. package/src/sap/m/VBox.js +1 -1
  255. package/src/sap/m/ValueStateHeader.js +1 -1
  256. package/src/sap/m/VariantManagement.js +2492 -0
  257. package/src/sap/m/ViewSettingsCustomItem.js +1 -1
  258. package/src/sap/m/ViewSettingsCustomTab.js +1 -1
  259. package/src/sap/m/ViewSettingsDialog.js +2 -2
  260. package/src/sap/m/ViewSettingsFilterItem.js +1 -1
  261. package/src/sap/m/ViewSettingsItem.js +1 -1
  262. package/src/sap/m/VisibleItem.js +1 -1
  263. package/src/sap/m/WheelSlider.js +1 -1
  264. package/src/sap/m/WheelSliderContainer.js +1 -1
  265. package/src/sap/m/Wizard.js +1 -1
  266. package/src/sap/m/WizardProgressNavigator.js +1 -2
  267. package/src/sap/m/WizardStep.js +1 -1
  268. package/src/sap/m/changeHandler/AddTableColumn.js +3 -5
  269. package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
  270. package/src/sap/m/changeHandler/CombineButtons.js +1 -1
  271. package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
  272. package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
  273. package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
  274. package/src/sap/m/designtime/VariantManagement.designtime.js +56 -0
  275. package/src/sap/m/inputUtils/highlightDOMElements.js +3 -2
  276. package/src/sap/m/library.js +45 -2
  277. package/src/sap/m/messagebundle.properties +146 -11
  278. package/src/sap/m/messagebundle_ar.properties +93 -1
  279. package/src/sap/m/messagebundle_bg.properties +93 -1
  280. package/src/sap/m/messagebundle_ca.properties +93 -1
  281. package/src/sap/m/messagebundle_cs.properties +93 -1
  282. package/src/sap/m/messagebundle_cy.properties +93 -1
  283. package/src/sap/m/messagebundle_da.properties +93 -1
  284. package/src/sap/m/messagebundle_de.properties +93 -1
  285. package/src/sap/m/messagebundle_el.properties +93 -1
  286. package/src/sap/m/messagebundle_en.properties +93 -1
  287. package/src/sap/m/messagebundle_en_GB.properties +93 -1
  288. package/src/sap/m/messagebundle_en_US_sappsd.properties +93 -1
  289. package/src/sap/m/messagebundle_en_US_saprigi.properties +93 -1
  290. package/src/sap/m/messagebundle_en_US_saptrc.properties +93 -1
  291. package/src/sap/m/messagebundle_es.properties +93 -1
  292. package/src/sap/m/messagebundle_es_MX.properties +93 -1
  293. package/src/sap/m/messagebundle_et.properties +93 -1
  294. package/src/sap/m/messagebundle_fi.properties +93 -1
  295. package/src/sap/m/messagebundle_fr.properties +94 -2
  296. package/src/sap/m/messagebundle_fr_CA.properties +93 -1
  297. package/src/sap/m/messagebundle_hi.properties +93 -1
  298. package/src/sap/m/messagebundle_hr.properties +93 -1
  299. package/src/sap/m/messagebundle_hu.properties +93 -1
  300. package/src/sap/m/messagebundle_id.properties +93 -1
  301. package/src/sap/m/messagebundle_it.properties +94 -2
  302. package/src/sap/m/messagebundle_iw.properties +93 -1
  303. package/src/sap/m/messagebundle_ja.properties +93 -1
  304. package/src/sap/m/messagebundle_kk.properties +93 -1
  305. package/src/sap/m/messagebundle_ko.properties +93 -1
  306. package/src/sap/m/messagebundle_lt.properties +93 -1
  307. package/src/sap/m/messagebundle_lv.properties +93 -1
  308. package/src/sap/m/messagebundle_ms.properties +93 -1
  309. package/src/sap/m/messagebundle_nl.properties +93 -1
  310. package/src/sap/m/messagebundle_no.properties +93 -1
  311. package/src/sap/m/messagebundle_pl.properties +93 -1
  312. package/src/sap/m/messagebundle_pt.properties +101 -9
  313. package/src/sap/m/messagebundle_pt_PT.properties +93 -1
  314. package/src/sap/m/messagebundle_ro.properties +93 -1
  315. package/src/sap/m/messagebundle_ru.properties +93 -1
  316. package/src/sap/m/messagebundle_sh.properties +93 -1
  317. package/src/sap/m/messagebundle_sk.properties +93 -1
  318. package/src/sap/m/messagebundle_sl.properties +93 -1
  319. package/src/sap/m/messagebundle_sv.properties +93 -1
  320. package/src/sap/m/messagebundle_th.properties +93 -1
  321. package/src/sap/m/messagebundle_tr.properties +93 -1
  322. package/src/sap/m/messagebundle_uk.properties +93 -1
  323. package/src/sap/m/messagebundle_vi.properties +93 -1
  324. package/src/sap/m/messagebundle_zh_CN.properties +93 -1
  325. package/src/sap/m/messagebundle_zh_TW.properties +93 -1
  326. package/src/sap/m/p13n/AbstractContainer.js +2 -2
  327. package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
  328. package/src/sap/m/p13n/BasePanel.js +1 -1
  329. package/src/sap/m/p13n/Container.js +1 -1
  330. package/src/sap/m/p13n/GroupPanel.js +16 -5
  331. package/src/sap/m/p13n/Popup.js +1 -1
  332. package/src/sap/m/p13n/QueryPanel.js +55 -33
  333. package/src/sap/m/p13n/SelectionPanel.js +31 -6
  334. package/src/sap/m/p13n/SortPanel.js +24 -13
  335. package/src/sap/m/plugins/ColumnResizer.js +12 -6
  336. package/src/sap/m/plugins/DataStateIndicator.js +3 -2
  337. package/src/sap/m/plugins/PasteProvider.js +1 -1
  338. package/src/sap/m/plugins/PluginBase.js +1 -1
  339. package/src/sap/m/rules/CheckBox.support.js +1 -1
  340. package/src/sap/m/rules/Image.support.js +1 -1
  341. package/src/sap/m/rules/Link.support.js +1 -1
  342. package/src/sap/m/rules/MessagePage.support.js +1 -1
  343. package/src/sap/m/rules/ObjectHeader.support.js +6 -6
  344. package/src/sap/m/rules/ObjectListItem.support.js +1 -1
  345. package/src/sap/m/rules/ObjectMarker.support.js +1 -1
  346. package/src/sap/m/rules/ObjectStatus.support.js +1 -1
  347. package/src/sap/m/rules/Select.support.js +1 -1
  348. package/src/sap/m/rules/Table.support.js +3 -3
  349. package/src/sap/m/semantic/AddAction.js +1 -1
  350. package/src/sap/m/semantic/CancelAction.js +1 -1
  351. package/src/sap/m/semantic/DeleteAction.js +1 -1
  352. package/src/sap/m/semantic/DetailPage.js +1 -1
  353. package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
  354. package/src/sap/m/semantic/EditAction.js +1 -1
  355. package/src/sap/m/semantic/FavoriteAction.js +1 -1
  356. package/src/sap/m/semantic/FilterAction.js +1 -1
  357. package/src/sap/m/semantic/FilterSelect.js +1 -1
  358. package/src/sap/m/semantic/FlagAction.js +1 -1
  359. package/src/sap/m/semantic/ForwardAction.js +1 -1
  360. package/src/sap/m/semantic/FullscreenPage.js +1 -1
  361. package/src/sap/m/semantic/GroupAction.js +1 -1
  362. package/src/sap/m/semantic/GroupSelect.js +1 -1
  363. package/src/sap/m/semantic/MainAction.js +1 -1
  364. package/src/sap/m/semantic/MasterPage.js +1 -1
  365. package/src/sap/m/semantic/MessagesIndicator.js +1 -1
  366. package/src/sap/m/semantic/MultiSelectAction.js +1 -1
  367. package/src/sap/m/semantic/NegativeAction.js +1 -1
  368. package/src/sap/m/semantic/OpenInAction.js +1 -1
  369. package/src/sap/m/semantic/PositiveAction.js +1 -1
  370. package/src/sap/m/semantic/PrintAction.js +1 -1
  371. package/src/sap/m/semantic/SaveAction.js +1 -1
  372. package/src/sap/m/semantic/Segment.js +1 -1
  373. package/src/sap/m/semantic/SegmentedContainer.js +1 -1
  374. package/src/sap/m/semantic/SemanticButton.js +1 -1
  375. package/src/sap/m/semantic/SemanticConfiguration.js +1 -1
  376. package/src/sap/m/semantic/SemanticControl.js +1 -1
  377. package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
  378. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
  379. package/src/sap/m/semantic/SemanticPage.js +1 -1
  380. package/src/sap/m/semantic/SemanticSelect.js +1 -1
  381. package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
  382. package/src/sap/m/semantic/SendEmailAction.js +1 -1
  383. package/src/sap/m/semantic/SendMessageAction.js +1 -1
  384. package/src/sap/m/semantic/ShareInJamAction.js +1 -1
  385. package/src/sap/m/semantic/ShareMenu.js +1 -1
  386. package/src/sap/m/semantic/ShareMenuPage.js +1 -1
  387. package/src/sap/m/semantic/SortAction.js +1 -1
  388. package/src/sap/m/semantic/SortSelect.js +1 -1
  389. package/src/sap/m/table/Util.js +17 -13
  390. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  391. package/src/sap/m/table/columnmenu/Entry.js +1 -11
  392. package/src/sap/m/table/columnmenu/Item.js +1 -1
  393. package/src/sap/m/table/columnmenu/ItemBase.js +11 -1
  394. package/src/sap/m/table/columnmenu/Menu.js +40 -26
  395. package/src/sap/m/table/columnmenu/MenuRenderer.js +4 -3
  396. package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
  397. package/src/sap/m/table/columnmenu/QuickActionBase.js +11 -1
  398. package/src/sap/m/table/columnmenu/QuickActionItem.js +5 -5
  399. package/src/sap/m/table/columnmenu/QuickGroup.js +2 -11
  400. package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -13
  401. package/src/sap/m/table/columnmenu/QuickSort.js +2 -1
  402. package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
  403. package/src/sap/m/table/columnmenu/QuickTotal.js +2 -22
  404. package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -13
  405. package/src/sap/m/themes/base/ActionListItem.less +1 -1
  406. package/src/sap/m/themes/base/Button.less +1 -6
  407. package/src/sap/m/themes/base/Carousel.less +72 -87
  408. package/src/sap/m/themes/base/ColumnListItem.less +0 -3
  409. package/src/sap/m/themes/base/Dialog.less +6 -0
  410. package/src/sap/m/themes/base/GenericTile.less +438 -148
  411. package/src/sap/m/themes/base/IconTabBarSelectList.less +5 -4
  412. package/src/sap/m/themes/base/InputBase.less +2 -1
  413. package/src/sap/m/themes/base/LightBox.less +9 -7
  414. package/src/sap/m/themes/base/ListItemBase.less +1 -12
  415. package/src/sap/m/themes/base/MenuButton.less +16 -0
  416. package/src/sap/m/themes/base/MessageBox.less +5 -5
  417. package/src/sap/m/themes/base/NewsContent.less +0 -9
  418. package/src/sap/m/themes/base/NotificationListBase.less +9 -14
  419. package/src/sap/m/themes/base/NotificationListGroup.less +30 -44
  420. package/src/sap/m/themes/base/NotificationListItem.less +14 -18
  421. package/src/sap/m/themes/base/ObjectListItem.less +3 -0
  422. package/src/sap/m/themes/base/ObjectStatus.less +3 -0
  423. package/src/sap/m/themes/base/Panel.less +1 -1
  424. package/src/sap/m/themes/base/Popover.less +1 -1
  425. package/src/sap/m/themes/base/QuickView.less +14 -2
  426. package/src/sap/m/themes/base/RatingIndicator.less +4 -0
  427. package/src/sap/m/themes/base/SinglePlanningCalendarGrid.less +3 -29
  428. package/src/sap/m/themes/base/SlideTile.less +34 -0
  429. package/src/sap/m/themes/base/Slider.less +18 -18
  430. package/src/sap/m/themes/base/StandardListItem.less +5 -9
  431. package/src/sap/m/themes/base/Table.less +22 -21
  432. package/src/sap/m/themes/base/TextArea.less +5 -0
  433. package/src/sap/m/themes/base/TileContent.less +17 -0
  434. package/src/sap/m/themes/base/Token.less +3 -2
  435. package/src/sap/m/themes/base/Toolbar.less +1 -1
  436. package/src/sap/m/themes/base/UploadCollection.less +2 -0
  437. package/src/sap/m/themes/base/VariantManagement.less +97 -0
  438. package/src/sap/m/themes/base/Wizard.less +5 -4
  439. package/src/sap/m/themes/base/WizardProgressNavigator.less +8 -0
  440. package/src/sap/m/themes/base/library.source.less +1 -0
  441. package/src/sap/m/themes/sap_hcb/Carousel.less +3 -7
  442. package/src/sap/m/themes/sap_hcb/Panel.less +4 -0
  443. package/src/sap/m/themes/sap_hcb/Slider.less +11 -0
  444. package/src/sap/m/themes/sap_hcb/Tokenizer.less +1 -0
  445. package/src/sap/m/upload/UploadSet.js +89 -13
  446. package/src/sap/m/upload/UploadSetItem.js +15 -2
  447. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +45 -0
@@ -0,0 +1,2492 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ // Provides control sap.m.VariantManagement.
8
+ sap.ui.define([
9
+ "sap/ui/model/Context",
10
+ "sap/ui/model/PropertyBinding",
11
+ "sap/ui/model/json/JSONModel",
12
+ "sap/ui/model/Filter",
13
+ "sap/ui/model/FilterOperator",
14
+ "sap/ui/Device",
15
+ "sap/ui/core/InvisibleText",
16
+ "sap/ui/core/Control",
17
+ "sap/ui/core/Icon",
18
+ "sap/ui/layout/HorizontalLayout",
19
+ "sap/ui/layout/Grid",
20
+ 'sap/base/Log',
21
+ "sap/m/SearchField",
22
+ "sap/m/RadioButton",
23
+ "sap/m/ColumnListItem",
24
+ "sap/m/Column",
25
+ "sap/m/Text",
26
+ "sap/m/Bar",
27
+ "sap/m/Table",
28
+ "sap/m/Page",
29
+ "sap/m/Toolbar",
30
+ "sap/m/ToolbarSpacer",
31
+ "sap/m/Button",
32
+ "sap/m/ToggleButton",
33
+ "sap/m/CheckBox",
34
+ "sap/m/Dialog",
35
+ "sap/m/Input",
36
+ "sap/m/Label",
37
+ "sap/m/Title",
38
+ "sap/m/ResponsivePopover",
39
+ "sap/m/SelectList",
40
+ "sap/m/ObjectIdentifier",
41
+ "sap/m/OverflowToolbar",
42
+ "sap/m/OverflowToolbarLayoutData",
43
+ "sap/m/VBox",
44
+ 'sap/m/HBox',
45
+ "sap/ui/events/KeyCodes",
46
+ "sap/ui/core/library",
47
+ "sap/m/library"
48
+ ], function(
49
+ Context,
50
+ PropertyBinding,
51
+ JSONModel,
52
+ Filter,
53
+ FilterOperator,
54
+ Device,
55
+ InvisibleText,
56
+ Control,
57
+ Icon,
58
+ HorizontalLayout,
59
+ Grid,
60
+ Log,
61
+ SearchField,
62
+ RadioButton,
63
+ ColumnListItem,
64
+ Column,
65
+ Text,
66
+ Bar,
67
+ Table,
68
+ Page,
69
+ Toolbar,
70
+ ToolbarSpacer,
71
+ Button,
72
+ ToggleButton,
73
+ CheckBox,
74
+ Dialog,
75
+ Input,
76
+ Label,
77
+ Title,
78
+ ResponsivePopover,
79
+ SelectList,
80
+ ObjectIdentifier,
81
+ OverflowToolbar,
82
+ OverflowToolbarLayoutData,
83
+ VBox,
84
+ HBox,
85
+ KeyCodes,
86
+ coreLibrary,
87
+ mobileLibrary
88
+ ) {
89
+ "use strict";
90
+
91
+ // shortcut for sap.m.OverflowToolbarPriority
92
+ var OverflowToolbarPriority = mobileLibrary.OverflowToolbarPriority;
93
+
94
+ // shortcut for sap.m.ButtonType
95
+ var ButtonType = mobileLibrary.ButtonType;
96
+
97
+ // shortcut for sap.m.PlacementType
98
+ var PlacementType = mobileLibrary.PlacementType;
99
+
100
+ // shortcut for sap.m.PopinDisplay
101
+ var PopinDisplay = mobileLibrary.PopinDisplay;
102
+
103
+ // shortcut for sap.m.ScreenSize
104
+ var ScreenSize = mobileLibrary.ScreenSize;
105
+
106
+ // shortcut for sap.ui.core.ValueState
107
+ var ValueState = coreLibrary.ValueState;
108
+
109
+ // shortcut for sap.ui.core.TextAlign
110
+ var TextAlign = coreLibrary.TextAlign;
111
+
112
+ /**
113
+ * Constructor for a new <code>VariantManagement</code>.
114
+ * @param {string} [sId] - ID for the new control, generated automatically if no ID is given
115
+ * @param {object} [mSettings] - Initial settings for the new control
116
+ * @class Can be used to manage variants. You can use this control in most controls that are enabled for <i>key user adaptation</i>.<br>
117
+ * <b>Note: </b>On the user interface, variants are generally referred to as "views".
118
+ * @extends sap.ui.core.Control
119
+ * @constructor
120
+ * @experimental As of version 1.103
121
+ * @private
122
+ * @ui5-restricted sap.ui.fl, sap.ui.rta, sap.ui.comp
123
+ * @since 1.103
124
+ * @alias sap.m.VariantManagement
125
+ */
126
+ var VariantManagement = Control.extend("sap.m.VariantManagement", /** @lends sap.m.VariantManagement.prototype */ {
127
+ metadata: {
128
+ interfaces: [
129
+ "sap.m.IOverflowToolbarContent"
130
+ ],
131
+ library: "sap.m",
132
+ designtime: "sap/m/designtime/VariantManagement.designtime",
133
+ properties: {
134
+ /**
135
+ * Indicates that <i>Set as Default</i> is visible in the <i>Save View</i> and the <i>Manage Views</i> dialogs.
136
+ */
137
+ showSetAsDefault: {
138
+ type: "boolean",
139
+ group: "Misc",
140
+ defaultValue: true
141
+ },
142
+
143
+ /**
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.
146
+ */
147
+ inErrorState: {
148
+ type: "boolean",
149
+ group: "Misc",
150
+ defaultValue: false
151
+ },
152
+
153
+ /**
154
+ * 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
+ */
156
+ editable: {
157
+ type: "boolean",
158
+ group: "Misc",
159
+ defaultValue: true
160
+ },
161
+
162
+ /**
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.
166
+ */
167
+ modelName: {
168
+ type: "string",
169
+ group: "Misc",
170
+ defaultValue: null
171
+ },
172
+
173
+ /**
174
+ * Determines the behavior for Apply Automatically if the standard variant is marked as the default variant.
175
+ *
176
+ */
177
+ executeOnSelectionForStandardDefault: {
178
+ type: "boolean",
179
+ group: "Misc",
180
+ defaultValue: false
181
+ },
182
+
183
+ /**
184
+ * 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
+ */
188
+ displayTextForExecuteOnSelectionForStandardVariant: {
189
+ type: "string",
190
+ group: "Misc",
191
+ defaultValue: ""
192
+ }
193
+ },
194
+ events: {
195
+
196
+ /**
197
+ * This event is fired when the <i>Save View</i> dialog or the <i>Save As</i> dialog is closed with the save button.
198
+ */
199
+ save: {
200
+ parameters: {
201
+ /**
202
+ * Variant title
203
+ */
204
+ name: {
205
+ type: "string"
206
+ },
207
+
208
+ /**
209
+ * Indicates if an existing variant is overwritten or if a new variant is created.
210
+ */
211
+ overwrite: {
212
+ type: "boolean"
213
+ },
214
+
215
+ /**
216
+ * Variant key
217
+ */
218
+ key: {
219
+ type: "string"
220
+ },
221
+
222
+ /**
223
+ * <i>Apply Automatically</i> indicator
224
+ */
225
+ execute: {
226
+ type: "boolean"
227
+ },
228
+
229
+ /**
230
+ * The default variant indicator
231
+ */
232
+ def: {
233
+ type: "boolean"
234
+ },
235
+
236
+ /**
237
+ * Indicates the check box state for 'Create Tile'.
238
+ * <br>Note:</br>This event parameter is used only internally.
239
+ */
240
+ tile: {
241
+ type: "boolean"
242
+ }
243
+ }
244
+ },
245
+
246
+ /**
247
+ * This event is fired when users presses the cancel button inside <i>Save As</i> dialog.
248
+ */
249
+ cancel: {},
250
+
251
+ /**
252
+ * This event is fired when users apply changes to variants in the <i>Manage Views</i> dialog.
253
+ */
254
+
255
+ manage: {
256
+ parameters: {
257
+ /**
258
+ * List of changed variants. Each entry contains a 'key' - the variant key and a 'name' - the new title of the variant
259
+ */
260
+ renamed: {
261
+ type: "object[]"
262
+ },
263
+
264
+ /**
265
+ * List of deleted variant keys
266
+ */
267
+ deleted: {
268
+ type: "string[]"
269
+ },
270
+
271
+ /**
272
+ * List of variant keys and the associated Execute on Selection indicator
273
+ */
274
+ exe: {
275
+ type: "object[]"
276
+ },
277
+
278
+ /**
279
+ * The default variant key
280
+ */
281
+ def: {
282
+ type: "string"
283
+ }
284
+ }
285
+ },
286
+
287
+ /**
288
+ * This event is fired when a new variant is selected.
289
+ */
290
+ select: {
291
+ parameters: {
292
+ /**
293
+ * Variant key
294
+ */
295
+ key: {
296
+ type: "string"
297
+ }
298
+ }
299
+ }
300
+ }
301
+ },
302
+
303
+ /**
304
+ * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
305
+ * @param {sap.ui.core.RenderManager} oRm - <code>RenderManager</code> that can be used for writing to the render output buffer
306
+ * @param {sap.ui.core.Control} oControl - Object representation of the control that should be rendered
307
+ */
308
+ renderer: {
309
+ apiVersion: 2,
310
+ render: function(oRm, oControl) {
311
+ oRm.openStart("div", oControl)
312
+ .class("sapMVarMngmt")
313
+ .openEnd();
314
+
315
+ oRm.renderControl(oControl.oVariantLayout);
316
+ oRm.close("div");
317
+ }
318
+ }
319
+ });
320
+
321
+ VariantManagement.INNER_MODEL_NAME = "$sapMInnerVariants";
322
+ VariantManagement.MAX_NAME_LEN = 100;
323
+ VariantManagement.COLUMN_FAV_IDX = 0;
324
+ VariantManagement.COLUMN_NAME_IDX = 1;
325
+
326
+ /*
327
+ * Constructs and initializes the <code>VariantManagement</code> control.
328
+ */
329
+ VariantManagement.prototype.init = function() {
330
+
331
+ this._oRb = sap.ui.getCore().getLibraryResourceBundle("sap.m");
332
+
333
+ this._createInnerModel();
334
+
335
+ this._fRegisteredApplyAutomaticallyOnStandardVariant = null;
336
+ };
337
+
338
+ VariantManagement.prototype._initializeControl = function() {
339
+ if (this.oVariantInvisibleText) {
340
+ return;
341
+ }
342
+
343
+ this.oVariantInvisibleText = new InvisibleText();
344
+
345
+ this.oVariantText = new Title(this.getId() + "-text", {
346
+ text: {
347
+ path: '/currentVariant',
348
+ model: this._sModelName,
349
+ formatter: function(sKey) {
350
+ var sText = "";
351
+ if (sKey) {
352
+ sText = this.getSelectedVariantText(sKey);
353
+ this._setInvisibleText(sText, this.getModified());
354
+ }
355
+
356
+ return sText;
357
+ }.bind(this)
358
+ }
359
+ });
360
+
361
+ this.oVariantText.addStyleClass("sapMVarMngmtClickable");
362
+ this.oVariantText.addStyleClass("sapMVarMngmtTitle");
363
+ this.oVariantText.addStyleClass("sapMTitleStyleH4");
364
+ if (Device.system.phone) {
365
+ this.oVariantText.addStyleClass("sapMVarMngmtTextPhoneMaxWidth");
366
+ } else {
367
+ this.oVariantText.addStyleClass("sapMVarMngmtTextMaxWidth");
368
+ }
369
+
370
+ var oVariantModifiedText = new Text(this.getId() + "-modified", {
371
+ text: "*",
372
+ visible: {
373
+ path: "/modified",
374
+ model: this._sModelName,
375
+ formatter: function(bValue) {
376
+ var sKey = this.getCurrentVariantKey();
377
+
378
+ if (sKey) {
379
+ this._setInvisibleText(this.getSelectedVariantText(sKey), bValue);
380
+ }
381
+
382
+ return ((bValue === null) || (bValue === undefined)) ? false : bValue;
383
+ }.bind(this)
384
+ }
385
+ });
386
+ oVariantModifiedText.setVisible(false);
387
+ oVariantModifiedText.addStyleClass("sapMVarMngmtModified");
388
+ oVariantModifiedText.addStyleClass("sapMVarMngmtClickable");
389
+
390
+ this.oVariantPopoverTrigger = new ToggleButton(this.getId() + "-trigger", {
391
+ icon: "sap-icon://slim-arrow-down",
392
+ type: ButtonType.Transparent,
393
+ tooltip: this._oRb.getText("VARIANT_MANAGEMENT_TRIGGER_TT")
394
+ });
395
+
396
+ this.oVariantPopoverTrigger.addAriaLabelledBy(this.oVariantInvisibleText);
397
+ this.oVariantPopoverTrigger.addStyleClass("sapMVarMngmtClickable");
398
+
399
+ this.oVariantLayout = new HorizontalLayout({
400
+ content: [
401
+ this.oVariantText, oVariantModifiedText, this.oVariantPopoverTrigger
402
+ ]
403
+ });
404
+ this.oVariantLayout.addStyleClass("sapMVarMngmtLayout");
405
+
406
+ oVariantModifiedText.setVisible(false);
407
+
408
+ this.oVariantModifiedText = oVariantModifiedText;
409
+
410
+ this.oVariantInvisibleText.toStatic();
411
+
412
+ this.addDependent(this.oVariantLayout);
413
+ };
414
+
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
+
465
+ /**
466
+ * Required by the {@link sap.m.IOverflowToolbarContent} interface.
467
+ * Registers invalidations event which is fired when width of the control is changed.
468
+ *
469
+ * @protected
470
+ * @returns {object} Configuration information for the <code>sap.m.IOverflowToolbarContent</code> interface.
471
+ */
472
+ VariantManagement.prototype.getOverflowToolbarConfig = function() {
473
+ return {
474
+ canOverflow: false,
475
+ invalidationEvents: ["save", "manage", "select"]
476
+ };
477
+ };
478
+
479
+ /**
480
+ * Returns the title control of the <code>VariantManagement</code>. This is used in the key user scenario.
481
+ * @protected
482
+ * @returns {sap.m.Title} Title part of the <code>VariantManagement</code> control.
483
+ */
484
+ VariantManagement.prototype.getTitle = function() {
485
+ return this.oVariantText;
486
+ };
487
+
488
+ VariantManagement.prototype._setInvisibleText = function(sText, bFlag) {
489
+ var sInvisibleTextKey;
490
+ if (sText) {
491
+ if (bFlag) {
492
+ sInvisibleTextKey = "VARIANT_MANAGEMENT_SEL_VARIANT_MOD";
493
+ } else {
494
+ sInvisibleTextKey = "VARIANT_MANAGEMENT_SEL_VARIANT";
495
+ }
496
+
497
+ this.oVariantInvisibleText.setText(this._oRb.getText(sInvisibleTextKey, [sText]));
498
+ }
499
+ };
500
+
501
+ VariantManagement.prototype._createInnerModel = function() {
502
+ var oModel = new JSONModel({
503
+ showExecuteOnSelection: false,
504
+ showSetAsDefault: true,
505
+ showSaveAs: true,
506
+ showPublic: false,
507
+ showContexts: false,
508
+ editable: true,
509
+ showManualVariantKey: false,
510
+ showCreateTile: false,
511
+ popoverTitle: this._oRb.getText("VARIANT_MANAGEMENT_VARIANTS")
512
+ });
513
+ 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
+ };
549
+
550
+
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
+ VariantManagement.prototype._getShowCreateTile = function() {
566
+ return this._getInnerModelProperty("/showCreateTile");
567
+ };
568
+ VariantManagement.prototype._setShowCreateTile = function(bValue) {
569
+ this._setInnerModelProperty("/showCreateTile", bValue);
570
+ };
571
+
572
+ VariantManagement.prototype._getShowManualVariantKey = function() {
573
+ return this._getInnerModelProperty("/showManualVariantKey");
574
+ };
575
+ VariantManagement.prototype._setShowManualVariantKey = function(bValue) {
576
+ this._setInnerModelProperty("/showManualVariantKey", bValue);
577
+ };
578
+
579
+
580
+ VariantManagement.prototype._setInnerModelProperty = function(sPropertyPath, vValue) {
581
+ var oInnerModel = this.getModel(VariantManagement.INNER_MODEL_NAME);
582
+ if (oInnerModel) {
583
+ oInnerModel.setProperty(sPropertyPath, vValue);
584
+ }
585
+ };
586
+
587
+ VariantManagement.prototype._getInnerModelProperty = function(sPropertyPath) {
588
+ var oInnerModel = this.getModel(VariantManagement.INNER_MODEL_NAME);
589
+ if (oInnerModel) {
590
+ return oInnerModel.getProperty(sPropertyPath);
591
+ }
592
+
593
+ return null;
594
+ };
595
+
596
+
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
+ /**
680
+ * Gets all the variants
681
+ * @private
682
+ * @abstract
683
+ * @returns {array} Of variants
684
+ */
685
+ VariantManagement.prototype._getItems = function() {
686
+ };
687
+
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
+
739
+ VariantManagement.prototype.getSelectedVariantText = function(sKey) {
740
+ var oItem = this._getItemByKey(sKey);
741
+
742
+ if (oItem) {
743
+ return oItem.title;
744
+ }
745
+
746
+ return "";
747
+ };
748
+
749
+ VariantManagement.prototype.getStandardVariantKey = function() {
750
+ var aItems = this._getItems();
751
+ if (aItems && aItems[0]) {
752
+ return aItems[0].key;
753
+ }
754
+
755
+ return null;
756
+ };
757
+
758
+
759
+ VariantManagement.prototype._clearDeletedItems = function() {
760
+ this._aDeletedItems = [];
761
+ };
762
+
763
+ VariantManagement.prototype._addDeletedItem = function(oItem) {
764
+ this._aDeletedItems.push(oItem);
765
+ };
766
+
767
+ VariantManagement.prototype._getDeletedItems = function() {
768
+ return this._aDeletedItems;
769
+ };
770
+
771
+
772
+ VariantManagement.prototype._getItemByKey = function(sKey) {
773
+ var oItem = null;
774
+ var aItems = this._getItems();
775
+ if (aItems) {
776
+ aItems.some(function(oEntry) {
777
+ if (oEntry.key === sKey) {
778
+ oItem = oEntry;
779
+ }
780
+
781
+ return (oItem !== null);
782
+ });
783
+ }
784
+
785
+ return oItem;
786
+ };
787
+
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
+
821
+ VariantManagement.prototype._obtainControl = function(oEvent) {
822
+ if (oEvent && oEvent.target && oEvent.target.id) {
823
+ var sId = oEvent.target.id;
824
+ var nPos = sId.indexOf("-inner");
825
+ if (nPos > 0) {
826
+ sId = sId.substring(0, nPos);
827
+ }
828
+ return sap.ui.getCore().byId(sId);
829
+ }
830
+
831
+ return null;
832
+ };
833
+
834
+ // clickable area
835
+ VariantManagement.prototype.handleOpenCloseVariantPopover = function(oEvent) {
836
+ if (!this.bPopoverOpen) {
837
+ this._oCtrlRef = this._obtainControl(oEvent);
838
+ this._openVariantList();
839
+ } else if (this.oVariantPopOver && this.oVariantPopOver.isOpen()) {
840
+ this.oVariantPopOver.close();
841
+ } else if (this.getInErrorState() && this.oErrorVariantPopOver && this.oErrorVariantPopOver.isOpen()) {
842
+ this.oErrorVariantPopOver.close();
843
+ }
844
+ };
845
+
846
+ VariantManagement.prototype.getFocusDomRef = function() {
847
+ return this.oVariantPopoverTrigger.getFocusDomRef();
848
+ };
849
+
850
+ VariantManagement.prototype.onclick = function(oEvent) {
851
+ if (this.oVariantPopoverTrigger && !this.bPopoverOpen) {
852
+ this.oVariantPopoverTrigger.focus();
853
+ }
854
+ this.handleOpenCloseVariantPopover(oEvent);
855
+ };
856
+
857
+ VariantManagement.prototype.onkeyup = function(oEvent) {
858
+ if (oEvent.which === KeyCodes.F4 || oEvent.which === KeyCodes.SPACE || oEvent.altKey === true && oEvent.which === KeyCodes.ARROW_UP || oEvent.altKey === true && oEvent.which === KeyCodes.ARROW_DOWN) {
859
+ this._oCtrlRef = this._obtainControl(oEvent);
860
+ this._openVariantList();
861
+ }
862
+ };
863
+
864
+ VariantManagement.prototype.onAfterRendering = function() {
865
+ if (this.oVariantText) {
866
+ this.oVariantText.$().off("mouseover").on("mouseover", function() {
867
+ this.oVariantPopoverTrigger.addStyleClass("sapMVarMngmtTriggerBtnHover");
868
+ }.bind(this));
869
+ this.oVariantText.$().off("mouseout").on("mouseout", function() {
870
+ this.oVariantPopoverTrigger.removeStyleClass("sapMVarMngmtTriggerBtnHover");
871
+ }.bind(this));
872
+ }
873
+ };
874
+
875
+ // ERROR LIST
876
+ VariantManagement.prototype._openInErrorState = function() {
877
+ var oVBox;
878
+
879
+ if (!this.oErrorVariantPopOver) {
880
+ oVBox = new VBox({
881
+ fitContainer: true,
882
+ alignItems: sap.m.FlexAlignItems.Center,
883
+ items: [
884
+ new Icon({
885
+ size: "4rem",
886
+ color: "lightgray",
887
+ src: "sap-icon://message-error"
888
+ }), new Title({
889
+ titleStyle: sap.ui.core.TitleLevel.H2,
890
+ text: this._oRb.getText("VARIANT_MANAGEMENT_ERROR_TEXT1")
891
+ }), new Text({
892
+ textAlign: sap.ui.core.TextAlign.Center,
893
+ text: this._oRb.getText("VARIANT_MANAGEMENT_ERROR_TEXT2")
894
+ })
895
+ ]
896
+ });
897
+
898
+ oVBox.addStyleClass("sapMVarMngmtErrorPopover");
899
+
900
+ this.oErrorVariantPopOver = new ResponsivePopover(this.getId() + "-errorpopover", {
901
+ title: {
902
+ path: "/popoverTitle",
903
+ model: VariantManagement.INNER_MODEL_NAME
904
+ },
905
+ contentWidth: "400px",
906
+ placement: PlacementType.VerticalPreferredBottom,
907
+ content: [
908
+ new Page(this.getId() + "-errorselpage", {
909
+ showSubHeader: false,
910
+ showNavButton: false,
911
+ showHeader: false,
912
+ content: [
913
+ oVBox
914
+ ]
915
+ })
916
+ ],
917
+ afterOpen: function() {
918
+ this.bPopoverOpen = true;
919
+ }.bind(this),
920
+ afterClose: function() {
921
+ if (this.bPopoverOpen) {
922
+ setTimeout(function() {
923
+ this.bPopoverOpen = false;
924
+ }.bind(this), 200);
925
+ }
926
+ }.bind(this),
927
+ contentHeight: "300px"
928
+ });
929
+
930
+ this.oErrorVariantPopOver.attachBrowserEvent("keyup", function(e) {
931
+ if (e.which === 32) { // UP
932
+ this.oErrorVariantPopOver.close();
933
+ }
934
+ }.bind(this));
935
+ }
936
+
937
+ if (this.bPopoverOpen) {
938
+ return;
939
+ }
940
+
941
+ this.oErrorVariantPopOver.openBy(this.oVariantLayout);
942
+ };
943
+
944
+ // My Views List
945
+ VariantManagement.prototype._createVariantList = function() {
946
+ if (this.oVariantPopOver) {
947
+ return;
948
+ }
949
+
950
+ this.oVariantManageBtn = new Button(this.getId() + "-manage", {
951
+ text: this._oRb.getText("VARIANT_MANAGEMENT_MANAGE"),
952
+ enabled: true,
953
+ press: function() {
954
+ this._openManagementDialog();
955
+ }.bind(this),
956
+ layoutData: new OverflowToolbarLayoutData({
957
+ priority: OverflowToolbarPriority.Low
958
+ })
959
+ });
960
+
961
+ this.oVariantSaveBtn = new Button(this.getId() + "-mainsave", {
962
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SAVE"),
963
+ press: function() {
964
+ this._handleVariantSave();
965
+ }.bind(this),
966
+ visible: {
967
+ path: "modified",
968
+ model: this._sModelName,
969
+ formatter: function(bValue) {
970
+ return bValue;
971
+ }
972
+ },
973
+ type: ButtonType.Emphasized,
974
+ layoutData: new OverflowToolbarLayoutData({
975
+ priority: OverflowToolbarPriority.Low
976
+ })
977
+ });
978
+
979
+ this.oVariantSaveAsBtn = new Button(this.getId() + "-saveas", {
980
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SAVEAS"),
981
+ press: function() {
982
+ this._openSaveAsDialog();
983
+ }.bind(this),
984
+ layoutData: new OverflowToolbarLayoutData({
985
+ priority: OverflowToolbarPriority.Low
986
+ }),
987
+ visible: {
988
+ path: "/showSaveAs",
989
+ model: VariantManagement.INNER_MODEL_NAME
990
+ }
991
+ });
992
+
993
+ this.oVariantList = new SelectList(this.getId() + "-list", {
994
+ selectedKey: {
995
+ path: this._checkForFinalBindingPath("currentVariant"),
996
+ model: this._sModelName
997
+ },
998
+ itemPress: function(oEvent) {
999
+ var sSelectionKey = null;
1000
+ if (oEvent && oEvent.getParameters()) {
1001
+ var oItemPressed = oEvent.getParameters().item;
1002
+ if (oItemPressed) {
1003
+ sSelectionKey = oItemPressed.getKey();
1004
+ }
1005
+ }
1006
+ if (sSelectionKey) {
1007
+ // this.setModified(false);
1008
+ this.setCurrentVariantKey(sSelectionKey);
1009
+
1010
+ this.fireSelect({
1011
+ key: sSelectionKey
1012
+ });
1013
+ this.oVariantPopOver.close();
1014
+ }
1015
+ }.bind(this)
1016
+ });
1017
+ this.oVariantList.setNoDataText(this._oRb.getText("VARIANT_MANAGEMENT_NODATA"));
1018
+
1019
+ var oItemTemplate = new sap.ui.core.Item({
1020
+ key: '{' + this._sModelName + ">key}",
1021
+ text: '{' + this._sModelName + ">title}"
1022
+ });
1023
+
1024
+ this.oVariantList.bindAggregation("items", {
1025
+ path: this._checkForFinalBindingPath("variants"),
1026
+ model: this._sModelName,
1027
+ template: oItemTemplate
1028
+ });
1029
+
1030
+ this._oSearchField = new SearchField(this.getId() + "-search");
1031
+ this._oSearchField.attachLiveChange(function(oEvent) {
1032
+ this._triggerSearch(oEvent, this.oVariantList);
1033
+ }.bind(this));
1034
+
1035
+ this.oVariantSelectionPage = new Page(this.getId() + "-selpage", {
1036
+ subHeader: new Toolbar({
1037
+ content: [
1038
+ this._oSearchField
1039
+ ]
1040
+ }),
1041
+ content: [
1042
+ this.oVariantList
1043
+ ],
1044
+ footer: new OverflowToolbar({
1045
+ content: [
1046
+ new ToolbarSpacer(this.getId() + "-spacer"), this.oVariantSaveBtn, this.oVariantSaveAsBtn, this.oVariantManageBtn
1047
+ ]
1048
+ }),
1049
+ showNavButton: false,
1050
+ showHeader: false
1051
+ // showFooter: {
1052
+ // path: "/editable",
1053
+ // model: VariantManagement.INNER_MODEL_NAME
1054
+ // }
1055
+ });
1056
+
1057
+ this.oVariantSelectionPage.bindProperty("showFooter", {
1058
+ path: "/editable",
1059
+ model: VariantManagement.INNER_MODEL_NAME
1060
+ });
1061
+
1062
+ this.oVariantPopOver = new ResponsivePopover(this.getId() + "-popover", {
1063
+ title: {
1064
+ path: "/popoverTitle",
1065
+ model: VariantManagement.INNER_MODEL_NAME
1066
+ },
1067
+ titleAlignment: "Auto",
1068
+ contentWidth: "400px",
1069
+ placement: PlacementType.VerticalPreferredBottom,
1070
+ content: [
1071
+ this.oVariantSelectionPage
1072
+ ],
1073
+ afterOpen: function() {
1074
+ this.bPopoverOpen = true;
1075
+ this.oVariantPopoverTrigger.setPressed(true);
1076
+ }.bind(this),
1077
+ afterClose: function() {
1078
+ this.oVariantPopoverTrigger.setPressed(false);
1079
+ if (this.bPopoverOpen) {
1080
+ setTimeout(function() {
1081
+ this.bPopoverOpen = false;
1082
+ }.bind(this), 200);
1083
+ }
1084
+ }.bind(this),
1085
+ contentHeight: "300px"
1086
+ });
1087
+
1088
+ this.oVariantPopOver.addStyleClass("sapMVarMngmtPopover");
1089
+ if (this.oVariantLayout.$().closest(".sapUiSizeCompact").length > 0) {
1090
+ this.oVariantPopOver.addStyleClass("sapUiSizeCompact");
1091
+ }
1092
+ this.addDependent(this.oVariantPopOver);
1093
+
1094
+ // this.oVariantList.getBinding("items").filter(this._getFilters());
1095
+ };
1096
+
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 {
1107
+ this.oVariantSaveAsBtn.setType(ButtonType.Default);
1108
+ this.oVariantSaveBtn.setVisible(true);
1109
+ }
1110
+ };
1111
+
1112
+
1113
+ VariantManagement.prototype._checkForFinalBindingPath = function(sPath) {
1114
+ return this._getBindingPath() ? sPath : ('/' + sPath);
1115
+ };
1116
+
1117
+ VariantManagement.prototype._openVariantList = function() {
1118
+ var oItem;
1119
+
1120
+ if (this.getInErrorState()) {
1121
+ this._openInErrorState();
1122
+ return;
1123
+ }
1124
+
1125
+ if (this.bPopoverOpen) {
1126
+ return;
1127
+ }
1128
+
1129
+ // proceed only if context is available
1130
+ // if (!this.oContext) {
1131
+ // return;
1132
+ // }
1133
+
1134
+ this._createVariantList();
1135
+ this._oSearchField.setValue("");
1136
+
1137
+ this.oVariantList.getBinding("items").filter(this._getFilters());
1138
+
1139
+ this.oVariantSelectionPage.setShowSubHeader(this.oVariantList.getItems().length > 9);
1140
+
1141
+ this.showSaveButton(false);
1142
+
1143
+ if (this.getModified()) {
1144
+ oItem = this._getItemByKey(this.getCurrentVariantKey());
1145
+ if (oItem && oItem.change) {
1146
+ this.showSaveButton(true);
1147
+ }
1148
+ }
1149
+
1150
+ var oControlRef = this._oCtrlRef ? this._oCtrlRef : this.oVariantLayout;
1151
+ this._oCtrlRef = null;
1152
+ this.oVariantPopOver.openBy(oControlRef);
1153
+ };
1154
+
1155
+ VariantManagement.prototype._triggerSearch = function(oEvent, oVariantList) {
1156
+ if (!oEvent) {
1157
+ return;
1158
+ }
1159
+
1160
+ var parameters = oEvent.getParameters();
1161
+ if (!parameters) {
1162
+ return;
1163
+ }
1164
+
1165
+ var sValue = parameters.newValue ? parameters.newValue : "";
1166
+
1167
+ var oFilter = new Filter({
1168
+ path: "title",
1169
+ operator: FilterOperator.Contains,
1170
+ value1: sValue
1171
+ });
1172
+
1173
+ oVariantList.getBinding("items").filter(this._getFilters(oFilter));
1174
+ };
1175
+
1176
+ // Save View dialog
1177
+
1178
+ VariantManagement.prototype._createSaveAsDialog = function() {
1179
+ if (!this.oSaveAsDialog) {
1180
+ this.oInputName = new Input(this.getId() + "-name", {
1181
+ liveChange: function() {
1182
+ this._checkVariantNameConstraints(this.oInputName);
1183
+ }.bind(this)
1184
+ });
1185
+
1186
+ var oLabelName = new Label(this.getId() + "-namelabel", {
1187
+ text: this._oRb.getText("VARIANT_MANAGEMENT_NAME")
1188
+ });
1189
+ oLabelName.setLabelFor(this.oInputName);
1190
+ oLabelName.addStyleClass("sapMVarMngmtSaveDialogLabel");
1191
+
1192
+ this.oDefault = new CheckBox(this.getId() + "-default", {
1193
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SETASDEFAULT"),
1194
+ visible: {
1195
+ path: "/showSetAsDefault",
1196
+ model: VariantManagement.INNER_MODEL_NAME
1197
+ },
1198
+ width: "100%"
1199
+ });
1200
+
1201
+ this.oPublic = new CheckBox(this.getId() + "-public", {
1202
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SETASPUBLIC"),
1203
+ visible: {
1204
+ path: "/showPublic",
1205
+ model: VariantManagement.INNER_MODEL_NAME
1206
+ },
1207
+ width: "100%"
1208
+ });
1209
+
1210
+ this.oExecuteOnSelect = new CheckBox(this.getId() + "-execute", {
1211
+ text: this._oRb.getText("VARIANT_MANAGEMENT_EXECUTEONSELECT"),
1212
+ visible: {
1213
+ path: "/showExecuteOnSelection",
1214
+ model: VariantManagement.INNER_MODEL_NAME
1215
+ },
1216
+ width: "100%"
1217
+ });
1218
+
1219
+ this.oCreateTile = new CheckBox(this.getId() + "-tile", {
1220
+ text: this._oRb.getText("VARIANT_MANAGEMENT_CREATETILE"),
1221
+ enabled: true,
1222
+ visible: {
1223
+ path: "/showCreateTile",
1224
+ model: VariantManagement.INNER_MODEL_NAME
1225
+ },
1226
+ width: "100%"
1227
+ });
1228
+
1229
+ this.oInputManualKey = new Input(this.getId() + "-key", {
1230
+ visible: {
1231
+ path: "/showManualVariantKey",
1232
+ model: VariantManagement.INNER_MODEL_NAME
1233
+ },
1234
+ liveChange: function() {
1235
+ this._checkVariantNameConstraints(this.oInputManualKey);
1236
+ }.bind(this)
1237
+ });
1238
+
1239
+ this.oLabelKey = new Label(this.getId() + "-keylabel", {
1240
+ text: this._oRb.getText("VARIANT_MANAGEMENT_KEY"),
1241
+ required: true,
1242
+ visible: {
1243
+ path: "/showManualVariantKey",
1244
+ model: VariantManagement.INNER_MODEL_NAME
1245
+ }
1246
+ });
1247
+ this.oLabelKey.setLabelFor(this.oInputManualKey);
1248
+
1249
+ this.oSaveSave = new Button(this.getId() + "-variantsave", {
1250
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SAVE"),
1251
+ type: ButtonType.Emphasized,
1252
+ press: function() {
1253
+ if (!this._bSaveOngoing) {
1254
+ this._checkVariantNameConstraints(this.oInputName);
1255
+
1256
+ if (this.oInputName.getValueState() === "Error") {
1257
+ this.oInputName.focus();
1258
+ return;
1259
+ }
1260
+
1261
+ this._bSaveOngoing = true;
1262
+ this._bSaveCanceled = false;
1263
+ var bReturn = this._handleVariantSaveAs(this.oInputName.getValue());
1264
+ if (!bReturn) {
1265
+ this._bSaveOngoing = false;
1266
+ }
1267
+ }
1268
+ }.bind(this),
1269
+ enabled: true
1270
+ });
1271
+ var oSaveAsDialogOptionsGrid = new Grid({
1272
+ defaultSpan: "L12 M12 S12"
1273
+ });
1274
+
1275
+ oSaveAsDialogOptionsGrid.addContent(this.oDefault);
1276
+ oSaveAsDialogOptionsGrid.addContent(this.oPublic);
1277
+ oSaveAsDialogOptionsGrid.addContent(this.oExecuteOnSelect);
1278
+ oSaveAsDialogOptionsGrid.addContent(this.oCreateTile);
1279
+
1280
+ this.oSaveAsDialog = new Dialog(this.getId() + "-savedialog", {
1281
+ title: this._oRb.getText("VARIANT_MANAGEMENT_SAVEDIALOG"),
1282
+ afterClose: function() {
1283
+ this._bSaveOngoing = false;
1284
+
1285
+ if (this._sStyleClass) {
1286
+ this._setShowPublic(this._bShowPublic);
1287
+ this.oSaveAsDialog.removeStyleClass(this._sStyleClass);
1288
+
1289
+ if (this._oRolesComponentContainer) {
1290
+ this.oSaveAsDialog.removeContent(this._oRolesComponentContainer);
1291
+ }
1292
+
1293
+ this._sStyleClass = undefined;
1294
+ this._oRolesComponentContainer = null;
1295
+ }
1296
+ }.bind(this),
1297
+ beginButton: this.oSaveSave,
1298
+ endButton: new Button(this.getId() + "-variantcancel", {
1299
+ text: this._oRb.getText("VARIANT_MANAGEMENT_CANCEL"),
1300
+ press: this._cancelPressed.bind(this)
1301
+ }),
1302
+ content: [
1303
+ oLabelName, this.oInputName, this.oLabelKey, this.oInputManualKey, oSaveAsDialogOptionsGrid
1304
+ ],
1305
+ stretch: Device.system.phone
1306
+ });
1307
+
1308
+ this.oSaveAsDialog.isPopupAdaptationAllowed = function() {
1309
+ return false;
1310
+ };
1311
+
1312
+ this.oSaveAsDialog.addStyleClass("sapUiContentPadding");
1313
+ this.oSaveAsDialog.addStyleClass("sapMVarMngmtSaveDialog");
1314
+
1315
+ if (this.oVariantLayout.$().closest(".sapUiSizeCompact").length > 0) {
1316
+ this.oSaveAsDialog.addStyleClass("sapUiSizeCompact");
1317
+ }
1318
+
1319
+ this.addDependent(this.oSaveAsDialog);
1320
+ }
1321
+ };
1322
+
1323
+ VariantManagement.prototype._cancelPressed = function() {
1324
+ this._bSaveCanceled = true;
1325
+
1326
+ this.fireCancel();
1327
+ this.oSaveAsDialog.close();
1328
+ };
1329
+
1330
+
1331
+ VariantManagement.prototype._getSelectedContexts = function() {
1332
+ return this._oRolesComponentContainer.getComponentInstance().getSelectedContexts();
1333
+ };
1334
+ VariantManagement.prototype._setSelectedContexts = function(mContexts) {
1335
+ if (!mContexts || (Object.keys(mContexts).length === 0)) {
1336
+ mContexts = { role: []};
1337
+ }
1338
+ this._oRolesComponentContainer.getComponentInstance().setSelectedContexts(mContexts);
1339
+ };
1340
+
1341
+ VariantManagement.prototype._isInErrorContexts = function() {
1342
+ return this._oRolesComponentContainer.getComponentInstance().hasErrorsAndShowErrorMessage();
1343
+ };
1344
+
1345
+ VariantManagement.prototype._determineRolesSpecificText = function(mContexts, oTextControl) {
1346
+ if (!mContexts) {
1347
+ mContexts = { role: []};
1348
+ }
1349
+ if (mContexts && oTextControl) {
1350
+ oTextControl.setText(this._oRb.getText((mContexts.role && mContexts.role.length > 0) ? "VARIANT_MANAGEMENT_VISIBILITY_RESTRICTED" : "VARIANT_MANAGEMENT_VISIBILITY_NON_RESTRICTED"));
1351
+ }
1352
+ };
1353
+
1354
+ VariantManagement.prototype._checkAndAddRolesContainerToManageDialog = function() {
1355
+ if (this._oRolesComponentContainer && this._oRolesDialog) {
1356
+ var oRolesComponentContainer = null;
1357
+ this._oRolesDialog.getContent().some(function(oContent) {
1358
+ if (oContent === this._oRolesComponentContainer) {
1359
+ oRolesComponentContainer = oContent;
1360
+ return true;
1361
+ }
1362
+
1363
+ return false;
1364
+ }.bind(this));
1365
+
1366
+ if (!oRolesComponentContainer) {
1367
+ this._oRolesDialog.addContent(this._oRolesComponentContainer);
1368
+ }
1369
+ }
1370
+ };
1371
+
1372
+ VariantManagement.prototype._createRolesDialog = function() {
1373
+ if (!this._oRolesDialog) {
1374
+ this._oRolesDialog = new Dialog(this.getId() + "-roledialog", {
1375
+ draggable: true,
1376
+ resizable: true,
1377
+ contentWidth: "40%",
1378
+ title: this._oRb.getText("VARIANT_MANAGEMENT_SELECTROLES_DIALOG"),
1379
+ beginButton: new Button(this.getId() + "-rolesave", {
1380
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SAVE"),
1381
+ type: ButtonType.Emphasized,
1382
+ press: function() {
1383
+ if (!this._checkAndCreateContextInfoChanges(this._oCurrentContextsKey, this._oTextControl)) {
1384
+ return;
1385
+ }
1386
+ this._oRolesDialog.close();
1387
+ }.bind(this)
1388
+ }),
1389
+ endButton: new Button(this.getId() + "-rolecancel", {
1390
+ text: this._oRb.getText("VARIANT_MANAGEMENT_CANCEL"),
1391
+ press: function() {
1392
+ this._oRolesDialog.close();
1393
+ }.bind(this)
1394
+ }),
1395
+ content: [this._oRolesComponentContainer],
1396
+ stretch: Device.system.phone
1397
+ });
1398
+
1399
+ this._oRolesDialog.setParent(this);
1400
+ this._oRolesDialog.addStyleClass("sapUiContentPadding");
1401
+ this._oRolesDialog.addStyleClass(this._sStyleClass);
1402
+
1403
+ this._oRolesDialog.isPopupAdaptationAllowed = function() {
1404
+ return false;
1405
+ };
1406
+ }
1407
+
1408
+ this._checkAndAddRolesContainerToManageDialog();
1409
+ };
1410
+
1411
+ VariantManagement.prototype._openRolesDialog = function(oItem, oTextControl) {
1412
+ this._createRolesDialog();
1413
+
1414
+ this._oCurrentContextsKey = oItem.key;
1415
+ this._oTextControl = oTextControl;
1416
+
1417
+ this._setSelectedContexts(oItem.contexts);
1418
+
1419
+ this._oRolesDialog.open();
1420
+ };
1421
+
1422
+ VariantManagement.prototype._checkAndCreateContextInfoChanges = function(sKey, oTextControl) {
1423
+ if (sKey) {
1424
+ if (this._oRolesComponentContainer) {
1425
+ try {
1426
+ if (!this._isInErrorContexts()) {
1427
+ var mContexts = this._getSelectedContexts();
1428
+
1429
+ var oItem = this._getItemByKey(sKey);
1430
+ if (oItem) {
1431
+ oItem.contexts = mContexts;
1432
+ this._determineRolesSpecificText(mContexts, oTextControl);
1433
+ }
1434
+ } else {
1435
+ return false;
1436
+ }
1437
+ } catch (ex) {
1438
+ return false;
1439
+ }
1440
+ }
1441
+ return true;
1442
+ }
1443
+ return false;
1444
+ };
1445
+
1446
+ VariantManagement.prototype._checkAndAddRolesContainerToSaveAsDialog = function() {
1447
+ if (this._oRolesComponentContainer && this.oSaveAsDialog) {
1448
+ var oRolesComponentContainer = null;
1449
+ this.oSaveAsDialog.getContent().some(function(oContent) {
1450
+ if (oContent === this._oRolesComponentContainer) {
1451
+ oRolesComponentContainer = oContent;
1452
+ return true;
1453
+ }
1454
+
1455
+ return false;
1456
+ }.bind(this));
1457
+
1458
+ this._setSelectedContexts({ role: []});
1459
+ if (!oRolesComponentContainer) {
1460
+ this.oSaveAsDialog.addContent(this._oRolesComponentContainer);
1461
+ }
1462
+ }
1463
+ };
1464
+
1465
+ /**
1466
+ * Opens the <i>Save As</i> dialog.
1467
+ * @param {string} sRtaStyleClassName - style-class to be used
1468
+ * @param {object} oRolesComponentContainer - component for roles handling
1469
+ */
1470
+ VariantManagement.prototype.openSaveAsDialogForKeyUser = function (sRtaStyleClassName, oRolesComponentContainer) {
1471
+ this._openSaveAsDialog(true);
1472
+ this.oSaveAsDialog.addStyleClass(sRtaStyleClassName);
1473
+ this._sStyleClass = sRtaStyleClassName; // indicates that dialog is running in key user scenario
1474
+
1475
+ this._bShowPublic = this._getShowPublic();
1476
+ this._setShowPublic(false);
1477
+
1478
+ if (oRolesComponentContainer) {
1479
+ Promise.all([oRolesComponentContainer]).then(function(vArgs) {
1480
+ this._oRolesComponentContainer = vArgs[0];
1481
+ this._checkAndAddRolesContainerToSaveAsDialog();
1482
+
1483
+ this.oSaveAsDialog.open();
1484
+ }.bind(this));
1485
+ } else {
1486
+ this.oSaveAsDialog.open();
1487
+ }
1488
+ };
1489
+
1490
+ VariantManagement.prototype._openSaveAsDialog = function(bDoNotOpen) {
1491
+ this._createSaveAsDialog();
1492
+
1493
+ this.oInputName.setValue(this.getSelectedVariantText(this.getCurrentVariantKey()));
1494
+ this.oInputName.setEnabled(true);
1495
+ this.oInputName.setValueState(ValueState.None);
1496
+ this.oInputName.setValueStateText(null);
1497
+
1498
+ this.oDefault.setSelected(false);
1499
+ this.oPublic.setSelected(false);
1500
+ this.oExecuteOnSelect.setSelected(false);
1501
+ this.oCreateTile.setSelected(false);
1502
+
1503
+ if (this.oVariantPopOver) {
1504
+ this.oVariantPopOver.close();
1505
+ }
1506
+
1507
+ // if (this.getManualVariantKey()) {
1508
+ // this.oInputManualKey.setVisible(true);
1509
+ // this.oInputManualKey.setEnabled(true);
1510
+ // this.oInputManualKey.setValueState(ValueState.None);
1511
+ // this.oInputManualKey.setValueStateText(null);
1512
+ // this.oLabelKey.setVisible(true);
1513
+ // } else {
1514
+ // this.oInputManualKey.setVisible(false);
1515
+ // this.oLabelKey.setVisible(false);
1516
+ // }
1517
+
1518
+ if (!bDoNotOpen) {
1519
+ this.oSaveAsDialog.open();
1520
+ }
1521
+ };
1522
+
1523
+ VariantManagement.prototype._handleVariantSaveAs = function(sNewVariantName, bKeyUser) {
1524
+ var sKey = null;
1525
+ var sName = sNewVariantName.trim();
1526
+ var sManualKey = this.oInputManualKey.getValue().trim();
1527
+
1528
+ if (sName === "") {
1529
+ this.oInputName.setValueState(ValueState.Error);
1530
+ this.oInputName.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_EMPTY"));
1531
+ return false;
1532
+ }
1533
+
1534
+ if (this._getShowManualVariantKey()) {
1535
+ if (sManualKey === "") {
1536
+ this.oInputManualKey.setValueState(ValueState.Error);
1537
+ this.oInputManualKey.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_EMPTY"));
1538
+ return false;
1539
+ }
1540
+ sKey = sManualKey;
1541
+ }
1542
+
1543
+ if (this.oSaveAsDialog) {
1544
+ this.oSaveAsDialog.close();
1545
+ }
1546
+
1547
+ // if (this.oDefault.getSelected()) {
1548
+ // this.setDefaultVariantKey(sKey);
1549
+ // }
1550
+
1551
+ this.setModified(false);
1552
+
1553
+ if (bKeyUser) {
1554
+ return true;
1555
+ }
1556
+
1557
+ var oObj = {
1558
+ key: sKey,
1559
+ name: sName,
1560
+ overwrite: false,
1561
+ def: this.oDefault.getSelected(),
1562
+ execute: this.oExecuteOnSelect.getSelected(),
1563
+ "public": this._sStyleClass ? undefined : this.oPublic.getSelected(),
1564
+ contexts: this._sStyleClass ? this._getContextInfoChanges() : undefined
1565
+ };
1566
+
1567
+ if (!this._sStyleClass && this._getShowCreateTile() && this.oCreateTile) {
1568
+ oObj.tile = this.oCreateTile.getSelected();
1569
+ }
1570
+
1571
+ this.fireSave(oObj);
1572
+
1573
+ return true;
1574
+ };
1575
+
1576
+ VariantManagement.prototype._getContextInfoChanges = function() {
1577
+ if (this._oRolesComponentContainer) {
1578
+ try {
1579
+ if (!this._isInErrorContexts()) {
1580
+ return this._getSelectedContexts();
1581
+ }
1582
+ } catch (ex) {
1583
+ return null;
1584
+ }
1585
+ }
1586
+
1587
+ return null;
1588
+ };
1589
+
1590
+ VariantManagement.prototype._handleVariantSave = function() {
1591
+ var oItem = this._getItemByKey(this.getCurrentVariantKey());
1592
+
1593
+ var bDefault = false;
1594
+ if (this.getDefaultVariantKey() === oItem.key) {
1595
+ bDefault = true;
1596
+ }
1597
+
1598
+ if (this.oVariantPopOver) {
1599
+ this.oVariantPopOver.close();
1600
+ }
1601
+
1602
+ this.fireSave({
1603
+ name: oItem.title,
1604
+ overwrite: true,
1605
+ key: oItem.key,
1606
+ def: bDefault
1607
+ });
1608
+
1609
+ this.setModified(false);
1610
+ };
1611
+
1612
+ // Manage Views dialog
1613
+
1614
+ /**
1615
+ * Opens the <i>Manage Views</i> dialog.
1616
+ * @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
1618
+ * @param {object} oRolesComponentContainer - component for roles handling
1619
+ */
1620
+ VariantManagement.prototype.openManagementDialog = function(bCreateAlways, sClass, oRolesComponentContainer) {
1621
+ if (bCreateAlways && this.oManagementDialog) {
1622
+ this.oManagementDialog.destroy();
1623
+ this.oManagementDialog = undefined;
1624
+ }
1625
+
1626
+ if (sClass) {
1627
+ this._sStyleClass = sClass;
1628
+ this._bShowPublic = this._getShowPublic();
1629
+ this._setShowPublic(false);
1630
+ }
1631
+
1632
+ if (oRolesComponentContainer) {
1633
+ Promise.all([oRolesComponentContainer]).then(function(vArgs) {
1634
+ this._oRolesComponentContainer = vArgs[0];
1635
+
1636
+ this._setShowContexts(!!this._oRolesComponentContainer);
1637
+ this._openManagementDialog();
1638
+
1639
+ if (this._sStyleClass) {
1640
+ this.oManagementDialog.addStyleClass(this._sStyleClass);
1641
+ }
1642
+ }.bind(this));
1643
+ } else {
1644
+ this._setShowContexts(false);
1645
+ this._openManagementDialog();
1646
+
1647
+ if (this._sStyleClass) {
1648
+ this.oManagementDialog.addStyleClass(this._sStyleClass);
1649
+ }
1650
+ }
1651
+ };
1652
+
1653
+ VariantManagement.prototype._triggerSearchInManageDialog = function(oEvent, oManagementTable) {
1654
+ if (!oEvent) {
1655
+ return;
1656
+ }
1657
+
1658
+ var parameters = oEvent.getParameters();
1659
+ if (!parameters) {
1660
+ return;
1661
+ }
1662
+
1663
+ var sValue = parameters.newValue ? parameters.newValue : "";
1664
+
1665
+ var aFilters = [
1666
+ this._getVisibleFilter(), new Filter({
1667
+ filters: [
1668
+ new Filter({
1669
+ path: "title",
1670
+ operator: FilterOperator.Contains,
1671
+ value1: sValue
1672
+ }), new Filter({
1673
+ path: "author",
1674
+ operator: FilterOperator.Contains,
1675
+ value1: sValue
1676
+ })
1677
+ ],
1678
+ and: false
1679
+ })
1680
+ ];
1681
+
1682
+ oManagementTable.getBinding("items").filter(aFilters);
1683
+
1684
+ this._bDeleteOccured = true;
1685
+ };
1686
+
1687
+ VariantManagement.prototype.getManageDialog = function() {
1688
+ return this.oManagementDialog;
1689
+ };
1690
+
1691
+ VariantManagement.prototype._createManagementDialog = function() {
1692
+ if (!this.oManagementDialog || this.oManagementDialog.bIsDestroyed) {
1693
+ this.oManagementTable = new Table(this.getId() + "-managementTable", {
1694
+ contextualWidth: "Auto",
1695
+ fixedLayout: false,
1696
+ growing: true,
1697
+ columns: [
1698
+ new Column({
1699
+ width: "3rem",
1700
+ visible: {
1701
+ path: this._checkForFinalBindingPath("showFavorites"),
1702
+ model: this._sModelName
1703
+ }
1704
+ }), new Column({
1705
+ header: new Text({
1706
+ text: this._oRb.getText("VARIANT_MANAGEMENT_NAME")
1707
+ }),
1708
+ width: "16rem"
1709
+ }), new Column({
1710
+ header: new Text({
1711
+ text: this._oRb.getText("VARIANT_MANAGEMENT_VARIANTTYPE"),
1712
+ wrappingType: "Hyphenated"
1713
+ }),
1714
+ visible: {
1715
+ path: "/showPublic",
1716
+ model: VariantManagement.INNER_MODEL_NAME
1717
+ },
1718
+ demandPopin: true,
1719
+ popinDisplay: PopinDisplay.Inline,
1720
+ minScreenWidth: ScreenSize.Tablet
1721
+ }), new Column({
1722
+ header: new Text({
1723
+ text: this._oRb.getText("VARIANT_MANAGEMENT_DEFAULT"),
1724
+ wrappingType: "Hyphenated"
1725
+ }),
1726
+ hAlign: TextAlign.Center,
1727
+ demandPopin: true,
1728
+ popinDisplay: PopinDisplay.Block,
1729
+ minScreenWidth: ScreenSize.Tablet,
1730
+ visible: {
1731
+ path: "/showSetAsDefault",
1732
+ model: VariantManagement.INNER_MODEL_NAME
1733
+ }
1734
+ }), new Column({
1735
+ header: new Text({
1736
+ text: this._oRb.getText("VARIANT_MANAGEMENT_EXECUTEONSELECT"),
1737
+ wrappingType: "Hyphenated"
1738
+ }),
1739
+ hAlign: this.getDisplayTextForExecuteOnSelectionForStandardVariant() ? TextAlign.Begin : TextAlign.Center,
1740
+ demandPopin: true,
1741
+ popinDisplay: PopinDisplay.Block,
1742
+ minScreenWidth: ScreenSize.Tablet,
1743
+ visible: {
1744
+ path: "/showExecuteOnSelection",
1745
+ model: VariantManagement.INNER_MODEL_NAME
1746
+ }
1747
+ }), new Column({
1748
+ header: new Text({
1749
+ text: this._oRb.getText("VARIANT_MANAGEMENT_VISIBILITY"),
1750
+ wrappingType: "Hyphenated"
1751
+ }),
1752
+ width: "8rem",
1753
+ demandPopin: true,
1754
+ popinDisplay: PopinDisplay.Inline,
1755
+ minScreenWidth: ScreenSize.Tablet,
1756
+ visible: {
1757
+ path: "/showContexts",
1758
+ model: VariantManagement.INNER_MODEL_NAME
1759
+ }
1760
+ }), new Column({
1761
+ header: new Text({
1762
+ text: this._oRb.getText("VARIANT_MANAGEMENT_AUTHOR")
1763
+ }),
1764
+ demandPopin: true,
1765
+ popinDisplay: PopinDisplay.Block,
1766
+ minScreenWidth: ScreenSize.Tablet
1767
+ }), new Column({
1768
+ hAlign: TextAlign.Center
1769
+ }), new Column({
1770
+ visible: false
1771
+ })
1772
+ ]
1773
+ });
1774
+
1775
+ this.oManagementSave = new Button(this.getId() + "-managementsave", {
1776
+ text: this._oRb.getText("VARIANT_MANAGEMENT_SAVE"),
1777
+ enabled: true,
1778
+ type: ButtonType.Emphasized,
1779
+ press: function() {
1780
+ this._handleManageSavePressed();
1781
+ }.bind(this)
1782
+ });
1783
+
1784
+ this.oManagementCancel = new Button(this.getId() + "-managementcancel", {
1785
+ text: this._oRb.getText("VARIANT_MANAGEMENT_CANCEL"),
1786
+ press: function() {
1787
+ this._resumeManagementTableBinding();
1788
+ this.oManagementDialog.close();
1789
+ this._handleManageCancelPressed();
1790
+ }.bind(this)
1791
+ });
1792
+
1793
+ this.oManagementDialog = new Dialog(this.getId() + "-managementdialog", {
1794
+ contentWidth: "64%",
1795
+ resizable: true,
1796
+ draggable: true,
1797
+ title: this._oRb.getText("VARIANT_MANAGEMENT_MANAGEDIALOG"),
1798
+ beginButton: this.oManagementSave,
1799
+ endButton: this.oManagementCancel,
1800
+ afterClose: function() {
1801
+ if (this._sStyleClass) {
1802
+ this._setShowPublic(this._bShowPublic);
1803
+ this.oManagementDialog.removeStyleClass(this._sStyleClass);
1804
+ this._sStyleClass = undefined;
1805
+ this._oRolesComponentContainer = null;
1806
+ }
1807
+ }.bind(this),
1808
+ content: [
1809
+ this.oManagementTable
1810
+ ],
1811
+ stretch: Device.system.phone
1812
+ });
1813
+
1814
+ // add marker
1815
+ this.oManagementDialog.isPopupAdaptationAllowed = function() {
1816
+ return false;
1817
+ };
1818
+
1819
+ this._oSearchFieldOnMgmtDialog = new SearchField();
1820
+ this._oSearchFieldOnMgmtDialog.attachLiveChange(function(oEvent) {
1821
+ this._triggerSearchInManageDialog(oEvent, this.oManagementTable);
1822
+ }.bind(this));
1823
+
1824
+ var oSubHeader = new Bar(this.getId() + "-mgmHeaderSearch", {
1825
+ contentMiddle: [
1826
+ this._oSearchFieldOnMgmtDialog
1827
+ ]
1828
+ });
1829
+ this.oManagementDialog.setSubHeader(oSubHeader);
1830
+
1831
+ if (this.oVariantLayout.$().closest(".sapUiSizeCompact").length > 0) {
1832
+ this.oManagementDialog.addStyleClass("sapUiSizeCompact");
1833
+ }
1834
+ this.addDependent(this.oManagementDialog);
1835
+
1836
+ this.oManagementTable.bindAggregation("items", {
1837
+ path: this._checkForFinalBindingPath("variants"),
1838
+ model: this._sModelName,
1839
+ factory: this._templateFactoryManagementDialog.bind(this),
1840
+ filters: this._getVisibleFilter()
1841
+ });
1842
+
1843
+ this._bDeleteOccured = false;
1844
+ }
1845
+ };
1846
+
1847
+ VariantManagement.prototype._setFavoriteIcon = function(oIcon, bFlagged) {
1848
+ if (oIcon) {
1849
+ oIcon.setSrc(bFlagged ? "sap-icon://favorite" : "sap-icon://unfavorite");
1850
+ oIcon.setTooltip(this._oRb.getText(bFlagged ? "VARIANT_MANAGEMENT_FAV_DEL_TOOLTIP" : "VARIANT_MANAGEMENT_FAV_ADD_TOOLTIP"));
1851
+ oIcon.setAlt(this._oRb.getText(bFlagged ? "VARIANT_MANAGEMENT_FAV_DEL_ACC" : "VARIANT_MANAGEMENT_FAV_ADD_ACC"));
1852
+ }
1853
+ };
1854
+
1855
+ VariantManagement.prototype._templateFactoryManagementDialog = function(sId, oContext) {
1856
+ var sTooltip = null;
1857
+ var oDeleteButton;
1858
+ var sBindingPath;
1859
+ var oNameControl;
1860
+ var oExecuteOnSelectCtrl;
1861
+ var oRolesCell;
1862
+ var oItem = oContext.getObject();
1863
+ if (!oItem) {
1864
+ return undefined;
1865
+ }
1866
+
1867
+ var fLiveChange = function(oEvent) {
1868
+ this._checkVariantNameConstraints(oEvent.oSource, oEvent.oSource.getBindingContext(this._sModelName).getObject().key);
1869
+ }.bind(this);
1870
+
1871
+ var fChange = function(oEvent) {
1872
+ this._handleManageTitleChanged(oEvent.oSource.getBindingContext(this._sModelName).getObject());
1873
+ }.bind(this);
1874
+
1875
+ 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());
1881
+ }.bind(this);
1882
+
1883
+ var fPress = function(oEvent) {
1884
+ this._handleManageDeletePressed(oEvent.oSource.getBindingContext(this._sModelName).getObject());
1885
+ var oListItem = oEvent.oSource.getParent();
1886
+ if (oListItem) {
1887
+ oListItem.setVisible(false);
1888
+ }
1889
+
1890
+ this._reCheckVariantNameConstraints();
1891
+ }.bind(this);
1892
+
1893
+ var fSelectFav = function(oEvent) {
1894
+ this._handleManageFavoriteChanged(oEvent.oSource, oEvent.oSource.getBindingContext(this._sModelName).getObject());
1895
+ }.bind(this);
1896
+
1897
+ var fRolesPressed = function(oEvent) {
1898
+ var oItem = oEvent.oSource.getBindingContext(this._sModelName).getObject();
1899
+ this._openRolesDialog(oItem, oEvent.oSource.getParent().getItems()[0]);
1900
+ }.bind(this);
1901
+
1902
+ var bRenameEnabled = this.isItemRenameAllowed(oItem);
1903
+ if (bRenameEnabled) {
1904
+ oNameControl = new Input({
1905
+ liveChange: fLiveChange,
1906
+ change: fChange,
1907
+ value: '{' + this._sModelName + ">title}"
1908
+ });
1909
+ } else {
1910
+ oNameControl = new ObjectIdentifier({
1911
+ title: '{' + this._sModelName + ">title}"
1912
+ });
1913
+ if (sTooltip) {
1914
+ oNameControl.setTooltip(sTooltip);
1915
+ }
1916
+ }
1917
+
1918
+ var bDeleteEnabled = this.isItemDeleteEnabled(oItem);
1919
+ var bDeleteVisible = this.isItemDeleteVisible(oItem);
1920
+
1921
+ oDeleteButton = new Button({
1922
+ icon: "sap-icon://decline",
1923
+ enabled: bDeleteEnabled,
1924
+ type: ButtonType.Transparent,
1925
+ press: fPress,
1926
+ tooltip: this._oRb.getText("VARIANT_MANAGEMENT_DELETE"),
1927
+ visible: bDeleteVisible
1928
+ });
1929
+
1930
+
1931
+
1932
+ this._assignColumnInfoForDeleteButton(oDeleteButton);
1933
+
1934
+ sBindingPath = this._getBindingPath();
1935
+
1936
+ var oFavoriteIcon = new Icon({
1937
+ src: {
1938
+ path: "favorite",
1939
+ model: this._sModelName,
1940
+ formatter: function(bFlagged) {
1941
+ return bFlagged ? "sap-icon://favorite" : "sap-icon://unfavorite";
1942
+ }
1943
+ },
1944
+ tooltip: {
1945
+ path: 'favorite',
1946
+ model: this._sModelName,
1947
+ formatter: function(bFlagged) {
1948
+ return this._oRb.getText(bFlagged ? "VARIANT_MANAGEMENT_FAV_DEL_TOOLTIP" : "VARIANT_MANAGEMENT_FAV_ADD_TOOLTIP");
1949
+ }.bind(this)
1950
+ },
1951
+ press: fSelectFav
1952
+ });
1953
+
1954
+ if ((this.getStandardVariantKey() === oItem.key) || (this.getDefaultVariantKey() === oItem.key)) {
1955
+ oFavoriteIcon.addStyleClass("sapMVarMngmtFavNonInteractiveColor");
1956
+ } else {
1957
+ oFavoriteIcon.addStyleClass("sapMVarMngmtFavColor");
1958
+ }
1959
+
1960
+ if (this.getDisplayTextForExecuteOnSelectionForStandardVariant() && (this.getStandardVariantKey() === oItem.key)) {
1961
+ oExecuteOnSelectCtrl = new CheckBox(this.getId() + "-manage-exe-0",{
1962
+ 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}"
1972
+ });
1973
+ } else {
1974
+ oExecuteOnSelectCtrl = new CheckBox({
1975
+ text: "",
1976
+ select: fSelectCB,
1977
+ selected: '{' + this._sModelName + ">executeOnSelect}"
1978
+ });
1979
+ }
1980
+
1981
+ // roles
1982
+ if (this._sStyleClass && (oItem.key !== this.getStandardVariantKey())) {
1983
+ var oText = new Text({ wrapping: false });
1984
+ this._determineRolesSpecificText(oItem.contexts, oText);
1985
+ var oIcon = new Icon({
1986
+ src: "sap-icon://edit",
1987
+ press: fRolesPressed
1988
+ });
1989
+ oIcon.addStyleClass("sapMVarMngmtRolesEdit");
1990
+ oIcon.setTooltip(this._oRb.getText("VARIANT_MANAGEMENT_VISIBILITY_ICON_TT"));
1991
+ oRolesCell = new HBox({
1992
+ items: [oText, oIcon]
1993
+ });
1994
+ } else {
1995
+ oRolesCell = new Text();
1996
+ }
1997
+
1998
+ return new ColumnListItem({
1999
+ cells: [
2000
+ oFavoriteIcon, oNameControl, new Text({
2001
+ text: {
2002
+ path: "sharing",
2003
+ model: this._sModelName,
2004
+ formatter: function(sValue) {
2005
+ return this._oRb.getText(sValue === "private" ? "VARIANT_MANAGEMENT_PRIVATE" : "VARIANT_MANAGEMENT_PUBLIC");
2006
+ }.bind(this)
2007
+ },
2008
+ textAlign: "Center"
2009
+ }), new RadioButton({
2010
+ groupName: this.getId(),
2011
+ select: fSelectRB,
2012
+ selected: {
2013
+ path: sBindingPath + "/defaultVariant",
2014
+ model: this._sModelName,
2015
+ formatter: function(sKey) {
2016
+ return oItem.key === sKey;
2017
+ }
2018
+ }
2019
+ }), oExecuteOnSelectCtrl, oRolesCell, new Text({
2020
+ text: '{' + this._sModelName + ">author}",
2021
+ textAlign: "Begin"
2022
+ }), oDeleteButton, new Text({
2023
+ text: '{' + this._sModelName + ">key}"
2024
+ })
2025
+ ]
2026
+ });
2027
+ };
2028
+
2029
+ VariantManagement.prototype._openManagementDialog = function() {
2030
+ this._createManagementDialog();
2031
+
2032
+ if (this.oVariantPopOver) {
2033
+ this.oVariantPopOver.close();
2034
+ }
2035
+
2036
+ this._suspendManagementTableBinding();
2037
+
2038
+ this._clearDeletedItems();
2039
+ // this.oManagementSave.setEnabled(false);
2040
+ this._oSearchFieldOnMgmtDialog.setValue("");
2041
+
2042
+ // Ideally, this should be done only once in <code>_createtManagementDialog</code>. However, the binding does not recognize a change if filtering is involved.
2043
+ // 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
+ // 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
+ // not invalidated....
2046
+ // WA: Always do the binding while opening the dialog.
2047
+ if (this._bDeleteOccured) {
2048
+ 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
+
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);
2067
+ }
2068
+
2069
+ if (this._oInvisibleDeleteColumnName) {
2070
+ oDeleteButton.addAriaLabelledBy(this._oInvisibleDeleteColumnName);
2071
+ }
2072
+ };
2073
+
2074
+ VariantManagement.prototype._toggleIconActivityState = function(oIcon, oItem, bToInActive) {
2075
+ if (!oIcon) {
2076
+ return;
2077
+ }
2078
+
2079
+ if (oItem.key === this.getStandardVariantKey()) {
2080
+ return;
2081
+ }
2082
+
2083
+ if (bToInActive && oIcon.hasStyleClass("sapMVarMngmtFavColor")) {
2084
+ oIcon.removeStyleClass("sapMVarMngmtFavColor");
2085
+ oIcon.addStyleClass("sapMVarMngmtFavNonInteractiveColor");
2086
+ } else if (oIcon.hasStyleClass("sapMVarMngmtFavNonInteractiveColor")) {
2087
+ oIcon.removeStyleClass("sapMVarMngmtFavNonInteractiveColor");
2088
+ oIcon.addStyleClass("sapMVarMngmtFavColor");
2089
+ }
2090
+ };
2091
+
2092
+ VariantManagement.prototype._handleManageDefaultVariantChange = function(oRadioButton, oItem, bSelected) {
2093
+ var sKey = oItem.key;
2094
+
2095
+ if (oRadioButton) {
2096
+ var oIcon = oRadioButton.getParent().getCells()[VariantManagement.COLUMN_FAV_IDX];
2097
+
2098
+ if (bSelected) {
2099
+ if (this.getShowFavorites() && !oItem.favorite) {
2100
+ oItem.favorite = true;
2101
+ this._setFavoriteIcon(oIcon, true);
2102
+ }
2103
+
2104
+ this.setDefaultVariantKey(sKey);
2105
+ }
2106
+
2107
+ this._toggleIconActivityState(oIcon, oItem, bSelected);
2108
+ }
2109
+ };
2110
+
2111
+ VariantManagement.prototype._handleManageCancelPressed = function() {
2112
+ var sDefaultVariantKey;
2113
+ var oModel;
2114
+ this._getDeletedItems().forEach(function(oItem) {
2115
+ oItem.visible = true;
2116
+ });
2117
+
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;
2123
+ });
2124
+
2125
+ sDefaultVariantKey = this.getOriginalDefaultVariantKey();
2126
+ if (sDefaultVariantKey !== this.getDefaultVariantKey()) {
2127
+ this.setDefaultVariantKey(sDefaultVariantKey);
2128
+ }
2129
+
2130
+ oModel = this.getModel(this._sModelName);
2131
+ if (oModel) {
2132
+ oModel.checkUpdate();
2133
+ }
2134
+ };
2135
+
2136
+ VariantManagement.prototype._handleManageFavoriteChanged = function(oIcon, oItem) {
2137
+ // if (!this._anyInErrorState(this.oManagementTable)) {
2138
+ // this.oManagementSave.setEnabled(true);
2139
+ // }
2140
+ if (this.getStandardVariantKey() === oItem.key) {
2141
+ return;
2142
+ }
2143
+
2144
+ if ((this.getDefaultVariantKey() === oItem.key) && oItem.favorite) {
2145
+ return;
2146
+ }
2147
+
2148
+ oItem.favorite = !oItem.favorite;
2149
+ this._setFavoriteIcon(oIcon, oItem.favorite);
2150
+ };
2151
+
2152
+ VariantManagement.prototype._getRowForKey = function(sKey) {
2153
+ var oRowForKey = null;
2154
+ if (this.oManagementTable) {
2155
+ this.oManagementTable.getItems().some(function(oRow) {
2156
+ if (sKey === oRow.getCells()[0].getBindingContext(this._sModelName).getObject().key) {
2157
+ oRowForKey = oRow;
2158
+ }
2159
+
2160
+ return oRowForKey !== null;
2161
+ }.bind(this));
2162
+ }
2163
+
2164
+ return oRowForKey;
2165
+ };
2166
+
2167
+ VariantManagement.prototype._handleManageDeletePressed = function(oItem) {
2168
+ var oModel;
2169
+ var sKey = oItem.key;
2170
+
2171
+ // do not allow the deletion of the standard
2172
+ if (this.getStandardVariantKey() === sKey) {
2173
+ return;
2174
+ }
2175
+
2176
+ oItem.visible = false;
2177
+ this._addDeletedItem(oItem);
2178
+
2179
+ if ((sKey === this.getDefaultVariantKey())) {
2180
+ this.setDefaultVariantKey(this.getStandardVariantKey());
2181
+ if (this.getShowFavorites()) {
2182
+ var oNewDefaultItem = this._getItemByKey(this.getStandardVariantKey());
2183
+ if (oNewDefaultItem && !oNewDefaultItem.favorite) {
2184
+ var oRow = this._getRowForKey(this.getStandardVariantKey());
2185
+ if (oRow) {
2186
+ oNewDefaultItem.favorite = true;
2187
+ this._setFavoriteIcon(oRow.getCells()[VariantManagement.COLUMN_FAV_IDX], true);
2188
+ }
2189
+ }
2190
+ }
2191
+ }
2192
+
2193
+ oModel = this.getModel(this._sModelName);
2194
+ if (oModel) {
2195
+ oModel.checkUpdate();
2196
+ }
2197
+
2198
+ this.oManagementCancel.focus();
2199
+ };
2200
+
2201
+ VariantManagement.prototype._handleManageExecuteOnSelectionChanged = function() {
2202
+ // if (!this._anyInErrorState(this.oManagementTable)) {
2203
+ // this.oManagementSave.setEnabled(true);
2204
+ // }
2205
+ };
2206
+
2207
+ VariantManagement.prototype._handleManageTitleChanged = function() {
2208
+ // if (!this._anyInErrorState(this.oManagementTable)) {
2209
+ // this.oManagementSave.setEnabled(true);
2210
+ // }
2211
+ };
2212
+
2213
+ VariantManagement.prototype._handleManageSavePressed = function() {
2214
+ if (this._anyInErrorState(this.oManagementTable)) {
2215
+ return;
2216
+ }
2217
+
2218
+ this._getDeletedItems().some(function(oItem) {
2219
+ if (oItem.key === this.getCurrentVariantKey()) {
2220
+ var sKey = this.getStandardVariantKey();
2221
+
2222
+ this.setModified(false);
2223
+ this.setCurrentVariantKey(sKey);
2224
+
2225
+ this.fireSelect({
2226
+ key: sKey
2227
+ });
2228
+ return true;
2229
+ }
2230
+
2231
+ return false;
2232
+ }.bind(this));
2233
+
2234
+ this.fireManage({
2235
+
2236
+ });
2237
+
2238
+ this._resumeManagementTableBinding();
2239
+ this.oManagementDialog.close();
2240
+ };
2241
+
2242
+ VariantManagement.prototype._resumeManagementTableBinding = function() {
2243
+ if (this.oManagementTable) {
2244
+ var oListBinding = this.oManagementTable.getBinding("items");
2245
+ if (oListBinding) {
2246
+ oListBinding.resume();
2247
+ }
2248
+ }
2249
+ };
2250
+
2251
+ VariantManagement.prototype._suspendManagementTableBinding = function() {
2252
+ if (this.oManagementTable) {
2253
+ var oListBinding = this.oManagementTable.getBinding("items");
2254
+ if (oListBinding) {
2255
+ oListBinding.suspend();
2256
+ }
2257
+ }
2258
+ };
2259
+
2260
+ VariantManagement.prototype._anyInErrorState = function(oManagementTable) {
2261
+ var aItems;
2262
+ var oInput;
2263
+ var bInError = false;
2264
+
2265
+ if (oManagementTable) {
2266
+ aItems = oManagementTable.getItems();
2267
+ aItems.some(function(oItem) {
2268
+ oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2269
+ if (oInput && oInput.getValueState && (oInput.getValueState() === ValueState.Error)) {
2270
+ bInError = true;
2271
+ }
2272
+ return bInError;
2273
+ });
2274
+ }
2275
+
2276
+ return bInError;
2277
+ };
2278
+
2279
+ // UTILS
2280
+
2281
+ VariantManagement.prototype._getFilters = function(oFilter) {
2282
+ var aFilters = [];
2283
+
2284
+ if (oFilter) {
2285
+ aFilters.push(oFilter);
2286
+ }
2287
+
2288
+ aFilters.push(this._getVisibleFilter());
2289
+
2290
+ if (this.getShowFavorites()) {
2291
+ aFilters.push(this._getFilterFavorites());
2292
+ }
2293
+
2294
+ return aFilters;
2295
+ };
2296
+
2297
+ VariantManagement.prototype._getVisibleFilter = function() {
2298
+ return new Filter({
2299
+ path: "visible",
2300
+ operator: FilterOperator.EQ,
2301
+ value1: true
2302
+ });
2303
+ };
2304
+
2305
+ VariantManagement.prototype._getFilterFavorites = function() {
2306
+ return new Filter({
2307
+ path: "favorite",
2308
+ operator: FilterOperator.EQ,
2309
+ value1: true
2310
+ });
2311
+ };
2312
+
2313
+
2314
+ VariantManagement.prototype._verifyVariantNameConstraints = function(oInputField, sKey) {
2315
+ if (!oInputField) {
2316
+ return;
2317
+ }
2318
+
2319
+ var sValue = oInputField.getValue();
2320
+ sValue = sValue.trim();
2321
+
2322
+ if (!this._checkIsDuplicate(sValue, sKey)) {
2323
+ if (sValue === "") {
2324
+ oInputField.setValueState(ValueState.Error);
2325
+ oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_EMPTY"));
2326
+ } else if (sValue.indexOf('{') > -1) {
2327
+ oInputField.setValueState(ValueState.Error);
2328
+ oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_NOT_ALLOWED_CHAR", [
2329
+ "{"
2330
+ ]));
2331
+ } else if (sValue.length > VariantManagement.MAX_NAME_LEN) {
2332
+ oInputField.setValueState(ValueState.Error);
2333
+ oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_MAX_LEN", [
2334
+ VariantManagement.MAX_NAME_LEN
2335
+ ]));
2336
+ } else {
2337
+ oInputField.setValueState(ValueState.None);
2338
+ oInputField.setValueStateText(null);
2339
+ }
2340
+ } else {
2341
+ oInputField.setValueState(ValueState.Error);
2342
+ oInputField.setValueStateText(this._oRb.getText("VARIANT_MANAGEMENT_ERROR_DUPLICATE"));
2343
+ }
2344
+ };
2345
+
2346
+ VariantManagement.prototype._checkVariantNameConstraints = function(oInputField, sKey) {
2347
+ this._verifyVariantNameConstraints(oInputField, sKey);
2348
+
2349
+ if (this.oManagementDialog && this.oManagementDialog.isOpen()) {
2350
+ this._reCheckVariantNameConstraints();
2351
+ }
2352
+ };
2353
+
2354
+ VariantManagement.prototype._reCheckVariantNameConstraints = function() {
2355
+ var aItems;
2356
+ var bInError = false;
2357
+
2358
+ if (this.oManagementTable) {
2359
+ aItems = this.oManagementTable.getItems();
2360
+ aItems.some(function(oItem) {
2361
+ var oObject = oItem.getBindingContext(this._sModelName).getObject();
2362
+ if (oObject && oObject.visible) {
2363
+ var oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2364
+ if (oInput && oInput.getValueState && (oInput.getValueState() === ValueState.Error)) {
2365
+ this._verifyVariantNameConstraints(oInput, oObject.key);
2366
+ if (oInput.getValueState() === ValueState.Error) {
2367
+ bInError = true;
2368
+ }
2369
+ }
2370
+ }
2371
+
2372
+ return bInError;
2373
+ }.bind(this));
2374
+ }
2375
+
2376
+ return bInError;
2377
+ };
2378
+
2379
+ VariantManagement.prototype._checkIsDuplicate = function(sValue, sKey) {
2380
+ if (this.oManagementDialog && this.oManagementDialog.isOpen()) {
2381
+ return this._checkIsDuplicateInManageTable(sValue, sKey);
2382
+ }
2383
+
2384
+ return this._checkIsDuplicateInModel(sValue, sKey);
2385
+ };
2386
+
2387
+ VariantManagement.prototype._checkIsDuplicateInModel = function(sValue, sKey) {
2388
+ var bDublicate = false;
2389
+ var aItems = this._getItems();
2390
+ var sLowerCaseValue = sValue.toLowerCase();
2391
+ aItems.some(function(oItem) {
2392
+ if (oItem.title.toLowerCase() === sLowerCaseValue) {
2393
+ if (sKey && (sKey === oItem.key)) {
2394
+ return false;
2395
+ }
2396
+ bDublicate = true;
2397
+ }
2398
+
2399
+ return bDublicate;
2400
+ });
2401
+
2402
+ return bDublicate;
2403
+ };
2404
+
2405
+ VariantManagement.prototype._checkIsDuplicateInManageTable = function(sValue, sKey) {
2406
+ var aItems;
2407
+ var bInError = false;
2408
+ var sLowerCaseValue = sValue.toLowerCase();
2409
+
2410
+ if (this.oManagementTable) {
2411
+ aItems = this.oManagementTable.getItems();
2412
+ aItems.some(function(oItem) {
2413
+ var sTitleLowerCase;
2414
+ var oObject = oItem.getBindingContext(this._sModelName).getObject();
2415
+ if (oObject && oObject.visible) {
2416
+ var oInput = oItem.getCells()[VariantManagement.COLUMN_NAME_IDX];
2417
+
2418
+ if (oInput && (oObject.key !== sKey)) {
2419
+ if (oInput.isA("sap.m.Input")) {
2420
+ sTitleLowerCase = oInput.getValue().toLowerCase();
2421
+ } else {
2422
+ sTitleLowerCase = oInput.getTitle().toLowerCase();
2423
+ }
2424
+ if (sTitleLowerCase === sLowerCaseValue) {
2425
+ bInError = true;
2426
+ }
2427
+ }
2428
+ }
2429
+ return bInError;
2430
+ }.bind(this));
2431
+ }
2432
+
2433
+ return bInError;
2434
+ };
2435
+
2436
+ // exit destroy all controls created in init
2437
+ VariantManagement.prototype.exit = function() {
2438
+ var oModel;
2439
+
2440
+ if (this.oVariantInvisibleText) {
2441
+ this.oVariantInvisibleText.destroy(true);
2442
+ this.oVariantInvisibleText = undefined;
2443
+ }
2444
+
2445
+ if (this.oDefault && !this.oDefault._bIsBeingDestroyed) {
2446
+ this.oDefault.destroy();
2447
+ }
2448
+ this.oDefault = undefined;
2449
+
2450
+ if (this.oPublic && !this.oPublic._bIsBeingDestroyed) {
2451
+ this.oPublic.destroy();
2452
+ }
2453
+ this.oPublic = undefined;
2454
+
2455
+ if (this.oExecuteOnSelect && !this.oExecuteOnSelect._bIsBeingDestroyed) {
2456
+ this.oExecuteOnSelect.destroy();
2457
+ }
2458
+ this.oExecuteOnSelect = undefined;
2459
+
2460
+ if (this.oCreateTile && !this.oCreateTile._bIsBeingDestroyed) {
2461
+ this.oCreateTile.destroy();
2462
+ }
2463
+ this.oCreateTile = undefined;
2464
+ this._oRb = undefined;
2465
+
2466
+ this.oVariantList = undefined;
2467
+ this.oVariantSelectionPage = undefined;
2468
+ this.oVariantLayout = undefined;
2469
+ this.oVariantText = undefined;
2470
+ this.oVariantModifiedText = undefined;
2471
+ this.oVariantPopoverTrigger = undefined;
2472
+ this._oSearchField = undefined;
2473
+ this._oSearchFieldOnMgmtDialog = undefined;
2474
+
2475
+ oModel = this.getModel(VariantManagement.INNER_MODEL_NAME);
2476
+ if (oModel) {
2477
+ oModel.destroy();
2478
+ }
2479
+
2480
+ this._oRolesComponentContainer = null;
2481
+ this._sStyleClass = null;
2482
+
2483
+ this._fRegisteredApplyAutomaticallyOnStandardVariant = null;
2484
+
2485
+ if (this._oRolesDialog) {
2486
+ this._oRolesDialog.destroy();
2487
+ this._oRolesDialog = null;
2488
+ }
2489
+ };
2490
+
2491
+ return VariantManagement;
2492
+ });