@openui5/sap.m 1.102.1 → 1.103.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/package.json +4 -4
  2. package/src/sap/m/.library +1 -1
  3. package/src/sap/m/AccButton.js +1 -1
  4. package/src/sap/m/ActionListItem.js +1 -1
  5. package/src/sap/m/ActionSelect.js +4 -4
  6. package/src/sap/m/ActionSheet.js +1 -1
  7. package/src/sap/m/App.js +1 -1
  8. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  9. package/src/sap/m/Avatar.js +1 -1
  10. package/src/sap/m/Bar.js +1 -1
  11. package/src/sap/m/BarInPageEnabler.js +1 -1
  12. package/src/sap/m/Breadcrumbs.js +27 -2
  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 +4 -4
  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 +1 -1
  20. package/src/sap/m/ColorPalettePopover.js +1 -1
  21. package/src/sap/m/Column.js +1 -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 +1 -1
  31. package/src/sap/m/ComboBoxBase.js +7 -7
  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 +2 -2
  38. package/src/sap/m/DateRangeSelection.js +5 -5
  39. package/src/sap/m/DateTimeField.js +18 -9
  40. package/src/sap/m/DateTimeInput.js +1 -1
  41. package/src/sap/m/DateTimePicker.js +15 -4
  42. package/src/sap/m/DateTimePickerRenderer.js +1 -1
  43. package/src/sap/m/Dialog.js +3 -10
  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 +67 -14
  48. package/src/sap/m/DynamicDateOption.js +1 -1
  49. package/src/sap/m/DynamicDateRange.js +51 -22
  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 +29 -28
  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 +2 -2
  62. package/src/sap/m/FormattedText.js +1 -1
  63. package/src/sap/m/GenericTag.js +5 -5
  64. package/src/sap/m/GenericTile.js +12 -6
  65. package/src/sap/m/GenericTileLineModeRenderer.js +0 -1
  66. package/src/sap/m/GenericTileRenderer.js +3 -3
  67. package/src/sap/m/GroupHeaderListItem.js +1 -1
  68. package/src/sap/m/GrowingEnablement.js +48 -6
  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 +3 -22
  72. package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
  73. package/src/sap/m/IconTabBar.js +2 -1
  74. package/src/sap/m/IconTabBarSelectList.js +1 -1
  75. package/src/sap/m/IconTabFilter.js +4 -4
  76. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  77. package/src/sap/m/IconTabHeader.js +8 -2
  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 +2 -14
  84. package/src/sap/m/InputBase.js +12 -5
  85. package/src/sap/m/InputListItem.js +1 -1
  86. package/src/sap/m/InstanceManager.js +14 -19
  87. package/src/sap/m/Label.js +1 -1
  88. package/src/sap/m/LightBox.js +1 -1
  89. package/src/sap/m/LightBoxItem.js +1 -1
  90. package/src/sap/m/Link.js +1 -1
  91. package/src/sap/m/List.js +1 -1
  92. package/src/sap/m/ListBase.js +1 -1
  93. package/src/sap/m/ListItemBase.js +1 -1
  94. package/src/sap/m/MaskEnabler.js +1 -1
  95. package/src/sap/m/MaskInput.js +1 -1
  96. package/src/sap/m/MaskInputRenderer.js +10 -0
  97. package/src/sap/m/MaskInputRule.js +1 -1
  98. package/src/sap/m/Menu.js +1 -1
  99. package/src/sap/m/MenuButton.js +2 -1
  100. package/src/sap/m/MenuItem.js +1 -1
  101. package/src/sap/m/MenuListItem.js +3 -3
  102. package/src/sap/m/MessageBox.js +1020 -908
  103. package/src/sap/m/MessageItem.js +1 -1
  104. package/src/sap/m/MessageListItem.js +1 -1
  105. package/src/sap/m/MessagePage.js +1 -1
  106. package/src/sap/m/MessagePopover.js +1 -1
  107. package/src/sap/m/MessagePopoverItem.js +1 -1
  108. package/src/sap/m/MessageStrip.js +1 -1
  109. package/src/sap/m/MessageToast.js +1 -1
  110. package/src/sap/m/MessageView.js +1 -1
  111. package/src/sap/m/MultiComboBox.js +4 -4
  112. package/src/sap/m/MultiEditField.js +1 -1
  113. package/src/sap/m/MultiInput.js +8 -8
  114. package/src/sap/m/NavContainer.js +4 -4
  115. package/src/sap/m/NewsContent.js +1 -1
  116. package/src/sap/m/NotificationList.js +1 -1
  117. package/src/sap/m/NotificationListBase.js +1 -1
  118. package/src/sap/m/NotificationListGroup.js +1 -1
  119. package/src/sap/m/NotificationListItem.js +1 -1
  120. package/src/sap/m/NumericContent.js +1 -1
  121. package/src/sap/m/NumericInput.js +1 -1
  122. package/src/sap/m/ObjectAttribute.js +14 -1
  123. package/src/sap/m/ObjectAttributeRenderer.js +5 -4
  124. package/src/sap/m/ObjectHeader.js +4 -4
  125. package/src/sap/m/ObjectHeaderRenderer.js +11 -11
  126. package/src/sap/m/ObjectIdentifier.js +3 -3
  127. package/src/sap/m/ObjectListItem.js +1 -1
  128. package/src/sap/m/ObjectMarker.js +7 -4
  129. package/src/sap/m/ObjectNumber.js +1 -1
  130. package/src/sap/m/ObjectStatus.js +1 -1
  131. package/src/sap/m/OverflowToolbar.js +35 -12
  132. package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
  133. package/src/sap/m/OverflowToolbarAssociativePopoverControls.js +5 -0
  134. package/src/sap/m/OverflowToolbarButton.js +1 -1
  135. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  136. package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
  137. package/src/sap/m/P13nAnyFilterItem.js +1 -1
  138. package/src/sap/m/P13nColumnsItem.js +1 -1
  139. package/src/sap/m/P13nColumnsPanel.js +1 -1
  140. package/src/sap/m/P13nConditionPanel.js +24 -24
  141. package/src/sap/m/P13nDialog.js +3 -1
  142. package/src/sap/m/P13nDimMeasureItem.js +1 -1
  143. package/src/sap/m/P13nDimMeasurePanel.js +1 -1
  144. package/src/sap/m/P13nFilterItem.js +1 -1
  145. package/src/sap/m/P13nFilterPanel.js +1 -1
  146. package/src/sap/m/P13nGroupItem.js +1 -1
  147. package/src/sap/m/P13nGroupPanel.js +1 -1
  148. package/src/sap/m/P13nItem.js +1 -1
  149. package/src/sap/m/P13nPanel.js +1 -1
  150. package/src/sap/m/P13nSelectionItem.js +1 -1
  151. package/src/sap/m/P13nSelectionPanel.js +1 -1
  152. package/src/sap/m/P13nSortItem.js +1 -1
  153. package/src/sap/m/P13nSortPanel.js +1 -1
  154. package/src/sap/m/PDFViewer.js +1 -1
  155. package/src/sap/m/Page.js +1 -1
  156. package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
  157. package/src/sap/m/PagingButton.js +1 -1
  158. package/src/sap/m/Panel.js +1 -1
  159. package/src/sap/m/PlanningCalendar.js +1 -1
  160. package/src/sap/m/PlanningCalendarHeader.js +2 -2
  161. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  162. package/src/sap/m/PlanningCalendarRow.js +1 -1
  163. package/src/sap/m/PlanningCalendarView.js +1 -1
  164. package/src/sap/m/Popover.js +2 -2
  165. package/src/sap/m/PopoverRenderer.js +2 -2
  166. package/src/sap/m/ProgressIndicator.js +15 -29
  167. package/src/sap/m/ProgressIndicatorRenderer.js +7 -1
  168. package/src/sap/m/PullToRefresh.js +1 -1
  169. package/src/sap/m/QuickView.js +2 -2
  170. package/src/sap/m/QuickViewBase.js +1 -1
  171. package/src/sap/m/QuickViewCard.js +1 -1
  172. package/src/sap/m/QuickViewGroup.js +1 -1
  173. package/src/sap/m/QuickViewGroupElement.js +2 -1
  174. package/src/sap/m/QuickViewPage.js +1 -1
  175. package/src/sap/m/RadioButton.js +1 -1
  176. package/src/sap/m/RadioButtonGroup.js +2 -2
  177. package/src/sap/m/RangeSlider.js +75 -55
  178. package/src/sap/m/RangeSliderRenderer.js +34 -2
  179. package/src/sap/m/RatingIndicator.js +1 -1
  180. package/src/sap/m/ResponsivePopover.js +7 -6
  181. package/src/sap/m/ResponsiveScale.js +1 -1
  182. package/src/sap/m/ScrollBar.js +1 -1
  183. package/src/sap/m/ScrollContainer.js +1 -1
  184. package/src/sap/m/SearchField.js +1 -1
  185. package/src/sap/m/SegmentedButton.js +1 -1
  186. package/src/sap/m/SegmentedButtonItem.js +1 -1
  187. package/src/sap/m/Select.js +12 -7
  188. package/src/sap/m/SelectDialog.js +2 -2
  189. package/src/sap/m/SelectDialogBase.js +1 -1
  190. package/src/sap/m/SelectList.js +8 -8
  191. package/src/sap/m/SelectListRenderer.js +2 -2
  192. package/src/sap/m/SelectRenderer.js +37 -13
  193. package/src/sap/m/SelectionDetails.js +1 -1
  194. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  195. package/src/sap/m/SelectionDetailsItem.js +1 -1
  196. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  197. package/src/sap/m/Shell.js +1 -1
  198. package/src/sap/m/SimpleFixFlex.js +5 -6
  199. package/src/sap/m/SimpleFixFlexRenderer.js +1 -0
  200. package/src/sap/m/SinglePlanningCalendar.js +1 -1
  201. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  202. package/src/sap/m/SinglePlanningCalendarGrid.js +1 -1
  203. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
  204. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  205. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  206. package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
  207. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  208. package/src/sap/m/SlideTile.js +1 -1
  209. package/src/sap/m/Slider.js +14 -5
  210. package/src/sap/m/SliderRenderer.js +27 -2
  211. package/src/sap/m/SliderTooltip.js +1 -1
  212. package/src/sap/m/SliderTooltipBase.js +1 -1
  213. package/src/sap/m/SliderTooltipContainer.js +3 -3
  214. package/src/sap/m/SplitApp.js +1 -1
  215. package/src/sap/m/SplitButton.js +1 -1
  216. package/src/sap/m/SplitContainer.js +3 -11
  217. package/src/sap/m/StandardDynamicDateOption.js +1 -1
  218. package/src/sap/m/StandardListItem.js +1 -1
  219. package/src/sap/m/StandardTile.js +1 -1
  220. package/src/sap/m/StandardTreeItem.js +1 -1
  221. package/src/sap/m/StepInput.js +1 -1
  222. package/src/sap/m/SuggestionItem.js +1 -1
  223. package/src/sap/m/SuggestionsPopover.js +1 -1
  224. package/src/sap/m/Switch.js +1 -1
  225. package/src/sap/m/TabContainer.js +3 -2
  226. package/src/sap/m/TabContainerItem.js +1 -1
  227. package/src/sap/m/TabStrip.js +2 -2
  228. package/src/sap/m/TabStripItem.js +1 -1
  229. package/src/sap/m/Table.js +7 -1
  230. package/src/sap/m/TablePersoController.js +2 -2
  231. package/src/sap/m/TablePersoDialog.js +2 -2
  232. package/src/sap/m/TablePersoProvider.js +2 -2
  233. package/src/sap/m/TableRenderer.js +27 -0
  234. package/src/sap/m/TableSelectDialog.js +2 -2
  235. package/src/sap/m/Text.js +2 -2
  236. package/src/sap/m/TextArea.js +4 -3
  237. package/src/sap/m/TextRenderer.js +2 -0
  238. package/src/sap/m/Tile.js +1 -1
  239. package/src/sap/m/TileContainer.js +6 -6
  240. package/src/sap/m/TileContent.js +19 -1
  241. package/src/sap/m/TimePicker.js +32 -14
  242. package/src/sap/m/TimePickerClock.js +1 -1
  243. package/src/sap/m/TimePickerClocks.js +1 -1
  244. package/src/sap/m/TimePickerClocksRenderer.js +1 -0
  245. package/src/sap/m/TimePickerInputs.js +1 -1
  246. package/src/sap/m/TimePickerInternals.js +1 -1
  247. package/src/sap/m/TimePickerSlider.js +1 -1
  248. package/src/sap/m/TimePickerSliders.js +1 -1
  249. package/src/sap/m/Title.js +2 -2
  250. package/src/sap/m/TitlePropagationSupport.js +1 -1
  251. package/src/sap/m/ToggleButton.js +1 -1
  252. package/src/sap/m/Token.js +1 -1
  253. package/src/sap/m/Tokenizer.js +1 -1
  254. package/src/sap/m/Toolbar.js +1 -1
  255. package/src/sap/m/ToolbarLayoutData.js +6 -2
  256. package/src/sap/m/ToolbarSeparator.js +1 -1
  257. package/src/sap/m/ToolbarSpacer.js +1 -1
  258. package/src/sap/m/Tree.js +1 -1
  259. package/src/sap/m/TreeItemBase.js +1 -1
  260. package/src/sap/m/UploadCollection.js +5 -5
  261. package/src/sap/m/UploadCollectionItem.js +1 -1
  262. package/src/sap/m/UploadCollectionParameter.js +1 -1
  263. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
  264. package/src/sap/m/VBox.js +1 -1
  265. package/src/sap/m/ValueStateHeader.js +1 -1
  266. package/src/sap/m/ViewSettingsCustomItem.js +1 -1
  267. package/src/sap/m/ViewSettingsCustomTab.js +1 -1
  268. package/src/sap/m/ViewSettingsDialog.js +3 -3
  269. package/src/sap/m/ViewSettingsFilterItem.js +1 -1
  270. package/src/sap/m/ViewSettingsItem.js +1 -1
  271. package/src/sap/m/VisibleItem.js +1 -1
  272. package/src/sap/m/WheelSlider.js +1 -1
  273. package/src/sap/m/WheelSliderContainer.js +1 -1
  274. package/src/sap/m/Wizard.js +1 -1
  275. package/src/sap/m/WizardProgressNavigator.js +1 -2
  276. package/src/sap/m/WizardStep.js +1 -1
  277. package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
  278. package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
  279. package/src/sap/m/changeHandler/CombineButtons.js +1 -1
  280. package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
  281. package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
  282. package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
  283. package/src/sap/m/designtime/messagebundle_de.properties +2 -2
  284. package/src/sap/m/inputUtils/forwardItemProperties.js +4 -0
  285. package/src/sap/m/library.js +5 -5
  286. package/src/sap/m/messagebundle.properties +13 -1
  287. package/src/sap/m/messagebundle_ar.properties +11 -7
  288. package/src/sap/m/messagebundle_bg.properties +11 -7
  289. package/src/sap/m/messagebundle_ca.properties +11 -7
  290. package/src/sap/m/messagebundle_cs.properties +13 -9
  291. package/src/sap/m/messagebundle_cy.properties +11 -7
  292. package/src/sap/m/messagebundle_da.properties +11 -7
  293. package/src/sap/m/messagebundle_de.properties +12 -8
  294. package/src/sap/m/messagebundle_el.properties +11 -7
  295. package/src/sap/m/messagebundle_en.properties +11 -7
  296. package/src/sap/m/messagebundle_en_GB.properties +11 -7
  297. package/src/sap/m/messagebundle_en_US_sappsd.properties +11 -7
  298. package/src/sap/m/messagebundle_en_US_saprigi.properties +13 -7
  299. package/src/sap/m/messagebundle_en_US_saptrc.properties +11 -7
  300. package/src/sap/m/messagebundle_es.properties +11 -7
  301. package/src/sap/m/messagebundle_es_MX.properties +11 -7
  302. package/src/sap/m/messagebundle_et.properties +11 -7
  303. package/src/sap/m/messagebundle_fi.properties +11 -7
  304. package/src/sap/m/messagebundle_fr.properties +24 -20
  305. package/src/sap/m/messagebundle_fr_CA.properties +11 -7
  306. package/src/sap/m/messagebundle_hi.properties +11 -7
  307. package/src/sap/m/messagebundle_hr.properties +11 -7
  308. package/src/sap/m/messagebundle_hu.properties +11 -7
  309. package/src/sap/m/messagebundle_id.properties +11 -7
  310. package/src/sap/m/messagebundle_it.properties +17 -13
  311. package/src/sap/m/messagebundle_iw.properties +11 -7
  312. package/src/sap/m/messagebundle_ja.properties +11 -7
  313. package/src/sap/m/messagebundle_kk.properties +11 -7
  314. package/src/sap/m/messagebundle_ko.properties +22 -18
  315. package/src/sap/m/messagebundle_lt.properties +11 -7
  316. package/src/sap/m/messagebundle_lv.properties +11 -7
  317. package/src/sap/m/messagebundle_ms.properties +11 -7
  318. package/src/sap/m/messagebundle_nl.properties +11 -7
  319. package/src/sap/m/messagebundle_no.properties +15 -11
  320. package/src/sap/m/messagebundle_pl.properties +11 -7
  321. package/src/sap/m/messagebundle_pt.properties +12 -8
  322. package/src/sap/m/messagebundle_pt_PT.properties +11 -7
  323. package/src/sap/m/messagebundle_ro.properties +12 -8
  324. package/src/sap/m/messagebundle_ru.properties +11 -7
  325. package/src/sap/m/messagebundle_sh.properties +12 -8
  326. package/src/sap/m/messagebundle_sk.properties +11 -7
  327. package/src/sap/m/messagebundle_sl.properties +13 -9
  328. package/src/sap/m/messagebundle_sv.properties +11 -7
  329. package/src/sap/m/messagebundle_th.properties +11 -7
  330. package/src/sap/m/messagebundle_tr.properties +12 -8
  331. package/src/sap/m/messagebundle_uk.properties +12 -8
  332. package/src/sap/m/messagebundle_vi.properties +11 -7
  333. package/src/sap/m/messagebundle_zh_CN.properties +13 -9
  334. package/src/sap/m/messagebundle_zh_TW.properties +15 -11
  335. package/src/sap/m/p13n/AbstractContainer.js +2 -2
  336. package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
  337. package/src/sap/m/p13n/BasePanel.js +1 -1
  338. package/src/sap/m/p13n/Container.js +1 -1
  339. package/src/sap/m/p13n/GroupPanel.js +1 -1
  340. package/src/sap/m/p13n/Popup.js +1 -1
  341. package/src/sap/m/p13n/QueryPanel.js +1 -1
  342. package/src/sap/m/p13n/SelectionPanel.js +2 -2
  343. package/src/sap/m/p13n/SortPanel.js +1 -1
  344. package/src/sap/m/plugins/ColumnResizer.js +1 -1
  345. package/src/sap/m/plugins/DataStateIndicator.js +11 -3
  346. package/src/sap/m/plugins/PasteProvider.js +1 -1
  347. package/src/sap/m/plugins/PluginBase.js +2 -2
  348. package/src/sap/m/rules/DatePicker.support.js +4 -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 +3 -3
  378. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +3 -3
  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 +1 -1
  390. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  391. package/src/sap/m/table/columnmenu/Entry.js +1 -1
  392. package/src/sap/m/table/columnmenu/Item.js +1 -1
  393. package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
  394. package/src/sap/m/table/columnmenu/Menu.js +2 -2
  395. package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
  396. package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
  397. package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
  398. package/src/sap/m/table/columnmenu/QuickGroup.js +1 -1
  399. package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
  400. package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
  401. package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
  402. package/src/sap/m/table/columnmenu/QuickTotal.js +1 -1
  403. package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
  404. package/src/sap/m/themes/base/ActionListItem.less +1 -1
  405. package/src/sap/m/themes/base/Breadcrumbs.less +11 -0
  406. package/src/sap/m/themes/base/CheckBox.less +1 -0
  407. package/src/sap/m/themes/base/Dialog.less +0 -2
  408. package/src/sap/m/themes/base/GenericTag.less +5 -3
  409. package/src/sap/m/themes/base/LightBox.less +0 -12
  410. package/src/sap/m/themes/base/MessageBox.less +4 -3
  411. package/src/sap/m/themes/base/ObjectNumber.less +5 -0
  412. package/src/sap/m/themes/base/ProgressIndicator.less +0 -4
  413. package/src/sap/m/themes/base/Select.less +1 -3
  414. package/src/sap/m/themes/base/SlideTile.less +1 -0
  415. package/src/sap/m/themes/base/StandardListItem.less +1 -0
  416. package/src/sap/m/themes/base/Table.less +4 -0
  417. package/src/sap/m/themes/base/TimePickerClock.less +7 -0
  418. package/src/sap/m/themes/base/Title.less +1 -1
  419. package/src/sap/m/upload/UploadSet.js +3 -2
  420. package/src/sap/m/upload/UploadSetItem.js +4 -4
  421. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +2 -1
@@ -11,6 +11,7 @@ sap.ui.define([
11
11
  './Text',
12
12
  './FormattedText',
13
13
  './Link',
14
+ './MessageStrip',
14
15
  './VBox',
15
16
  'sap/ui/core/IconPool',
16
17
  'sap/ui/core/ElementMetadata',
@@ -18,922 +19,1033 @@ sap.ui.define([
18
19
  'sap/ui/core/Control',
19
20
  'sap/m/library',
20
21
  "sap/ui/thirdparty/jquery"
21
- ],
22
- function(
23
- Button,
24
- Dialog,
25
- Text,
26
- FormattedText,
27
- Link,
28
- VBox,
29
- IconPool,
30
- ElementMetadata,
31
- coreLibrary,
32
- Control,
33
- library,
34
- jQuery
35
- ) {
36
- "use strict";
37
-
38
- // shortcut for sap.m.DialogType
39
- var DialogType = library.DialogType;
40
-
41
- // shortcut for sap.m.DialogRoleType
42
- var DialogRoleType = library.DialogRoleType;
43
-
44
- // shortcut for sap.ui.core.TextDirection
45
- var TextDirection = coreLibrary.TextDirection;
46
-
47
- // shortcut for sap.m.ButtonType
48
- var ButtonType = library.ButtonType;
49
-
50
- // shortcut for sap.m.TitleAlignment
51
- var TitleAlignment = library.TitleAlignment;
52
-
53
- /**
54
- * Provides easier methods to create sap.m.Dialog with type sap.m.DialogType.Message, such as standard alerts,
55
- * confirmation dialogs, or arbitrary message dialogs.
56
- *
57
- * Because the <code>MessageBox</code> is a static class, a <code>sap.ui.require("sap/m/MessageBox");</code> statement
58
- * must be explicitly executed prior using the class.
59
- * MessageBox provides several functions:
60
- * <ul>
61
- * <li><code>show()</code> - This is the generic way to open a message dialog. You can customize its contents through the <code>mOptions</code> parameter described below.</li>
62
- * <li><code>alert()</code>, <code>confirm()</code>, <code>error()</code>, <code>information()</code>, <code>success()</code> and <code>warning()</code> - predefined templates of message dialogs. Each value type is coming with action buttons and an icon that are corresponding to its semantic. Although the full set of <code>mOptions</code> (applicable to <code>show()</code>) are available to them, it is recommended to only use the documented options.</li>
63
- * </ul>
64
- *
65
- * <b>NOTE:</b> All options of show() are available for the other template functions as well, but it is recommended to use show() only in more specific scenarios.<br />
66
- * <b>NOTE:</b> Due to the static nature of the <code>MessageBox</code> class, you cannot expect data binding support from its helper functions. If this is required you can use the <code>sap.m.Dialog</code> instead.<br />
67
- * <b>NOTE:</b> When using the <code>MessageBox.Error</code> method, there is no emphasized action by design.
68
- *
69
- * Example:
70
- * <pre>
71
- * sap.ui.define(["sap/m/MessageBox"], function (MessageBox) {
72
- * MessageBox.show(
73
- * "This message should appear in the message box.", {
74
- * icon: MessageBox.Icon.INFORMATION,
75
- * title: "My message box title",
76
- * actions: [MessageBox.Action.YES, MessageBox.Action.NO],
77
- * emphasizedAction: MessageBox.Action.YES,
78
- * onClose: function (oAction) { / * do something * / }
79
- * }
80
- * );
81
- * });
82
-
83
- * </pre>
84
- *
85
- * When using the <code>sap.m.MessageBox</code> in SAP Quartz and Horizon themes, the breakpoints and layout paddings could be determined by the MessageBox' width. To enable this concept and add responsive paddings to an element of the MessageBox control, you have to add the following classes depending on your use case: <code>sapUiResponsivePadding--header</code>, <code>sapUiResponsivePadding--content</code>, <code>sapUiResponsivePadding--footer</code>.
86
- *
87
- * @namespace
88
- * @alias sap.m.MessageBox
89
- * @public
90
- * @since 1.21.2
91
- * @see {@link fiori:https://experience.sap.com/fiori-design-web/message-box/ Message Box}
92
- */
93
- var MessageBox = {};
94
-
95
- /**
96
- * Enumeration of supported actions in a MessageBox.
97
- *
98
- * Each action is represented as a button in the message box. The values of this enumeration are used for both,
99
- * specifying the set of allowed actions as well as reporting back the user choice.
100
- * @enum {string}
101
- * @public
102
- */
103
- MessageBox.Action = {
104
-
105
- /**
106
- * Adds an "OK" button to the message box.
107
- * @public
108
- */
109
- OK: "OK",
110
-
111
- /**
112
- * Adds a "Cancel" button to the message box.
113
- * @public
114
- */
115
- CANCEL: "CANCEL",
116
-
117
- /**
118
- * Adds a "Yes" button to the message box.
119
- * @public
120
- */
121
- YES: "YES",
122
-
123
- /**
124
- * Adds a "No" button to the message box.
125
- * @public
126
- */
127
- NO: "NO",
128
-
129
- /**
130
- * Adds an "Abort" button to the message box.
131
- * @public
132
- */
133
- ABORT: "ABORT",
134
-
135
- /**
136
- * Adds a "Retry" button to the message box.
137
- * @public
138
- */
139
- RETRY: "RETRY",
140
-
141
- /**
142
- * Adds an "Ignore" button to the message box.
143
- * @public
144
- */
145
- IGNORE: "IGNORE",
146
-
147
- /**
148
- * Adds a "Close" button to the message box.
149
- * @public
150
- */
151
- CLOSE: "CLOSE",
152
-
153
- /**
154
- * Adds a "Delete" button to the message box.
155
- * @public
156
- */
157
- DELETE: "DELETE"
158
- };
159
-
160
- /**
161
- * Enumeration of the pre-defined icons that can be used in a MessageBox.
162
- * @enum {string}
163
- * @public
164
- */
165
- MessageBox.Icon = {
166
-
167
- /**
168
- * Shows no icon in the message box.
169
- * @public
170
- */
171
- NONE: undefined,
172
-
173
- /**
174
- * Shows the information icon in the message box.
175
- * @public
176
- */
177
- INFORMATION: "INFORMATION",
178
-
179
- /**
180
- * Shows the warning icon in the message box.
181
- * @public
182
- */
183
- WARNING: "WARNING",
184
-
185
- /**
186
- * Shows the error icon in the message box.
187
- * @public
188
- */
189
- ERROR: "ERROR",
190
-
191
- /**
192
- * Shows the success icon in the message box.
193
- * @public
194
- */
195
- SUCCESS: "SUCCESS",
196
-
197
- /**
198
- * Shows the question icon in the message box.
199
- * @public
200
- */
201
- QUESTION: "QUESTION"
202
- };
203
-
204
- (function () {
205
- var Action = MessageBox.Action,
206
- Icon = MessageBox.Icon;
207
-
208
- var _verifyBundle = function () {
209
- if (MessageBox._rb !== sap.ui.getCore().getLibraryResourceBundle("sap.m")) {
210
- MessageBox._rb = sap.ui.getCore().getLibraryResourceBundle("sap.m");
211
- }
212
- };
213
-
214
- /**
215
- * Creates and displays an sap.m.Dialog with type sap.m.DialogType.Message with the given text and buttons, and optionally other parts.
216
- * After the user has tapped a button, the <code>onClose</code> function is invoked when given.
217
- *
218
- * The only mandatory parameter is <code>vMessage</code>. Either a string with the corresponding text or even
219
- * a layout control could be provided.
220
- *
221
- * <pre>
222
- * sap.m.MessageBox.show("This message should appear in the message box", {
223
- * icon: sap.m.MessageBox.Icon.NONE, // default
224
- * title: "", // default
225
- * actions: sap.m.MessageBox.Action.OK, // default
226
- * emphasizedAction: sap.m.MessageBox.Action.OK, // default
227
- * onClose: null, // default
228
- * styleClass: "", // default
229
- * initialFocus: null, // default
230
- * textDirection: sap.ui.core.TextDirection.Inherit // default
231
- * });
232
- * </pre>
233
- *
234
- * The created dialog is executed asynchronously. When it has been created and registered for rendering,
235
- * this function returns without waiting for a user reaction.
236
- *
237
- * When applications have to react on the users choice, they have to provide a callback function and
238
- * postpone any reaction on the user choice until that callback is triggered.
239
- *
240
- * The signature of the callback is
241
- *
242
- * function (oAction);
243
- *
244
- * where <code>oAction</code> is the button that the user has tapped. For example, when the user has pressed the close button,
245
- * an sap.m.MessageBox.Action.CLOSE is returned.
246
- *
247
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
248
- * @param {object} [mOptions] Other options (optional)
249
- * @param {sap.m.MessageBox.Icon} [mOptions.icon] The icon to be displayed.
250
- * @param {string} [mOptions.title] The title of the message box.
251
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
252
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
253
- * Custom action(s) string or an array can be provided, and then the translation
254
- * of custom actions needs to be done by the application.
255
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
256
- * @param {function} [mOptions.onClose] Function to be called when the user taps a button or closes the message box.
257
- * @param {string} [mOptions.id] ID to be used for the dialog. Intended for test scenarios, not recommended for productive apps
258
- * @param {string} [mOptions.styleClass] Added since version 1.21.2. CSS style class which is added to the dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
259
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] Added since version 1.28.0. initialFocus, this option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
260
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
261
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Added since version 1.28. Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
262
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
263
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
264
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
265
- * @param {sap.ui.core.CSSSize} [mOptions.contentWidth] The width of the MessageBox
266
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
267
- * @public
268
- * @static
269
- */
270
- MessageBox.show = function (vMessage, mOptions) {
271
- var oDialog, oMessageText, vMessageContent, oResult = null, aButtons = [], i,
272
- sIcon, sTitle, vActions, fnCallback, sDialogId, sClass,
273
- mDefaults = {
274
- id: ElementMetadata.uid("mbox"),
275
- initialFocus: null,
276
- textDirection: TextDirection.Inherit,
277
- verticalScrolling: true,
278
- horizontalScrolling: true,
279
- details: "",
280
- contentWidth: null
281
- },
282
- mClasses = {
283
- "INFORMATION": "sapMMessageBoxInfo",
284
- "WARNING": "sapMMessageBoxWarning",
285
- "ERROR": "sapMMessageBoxError",
286
- "SUCCESS": "sapMMessageBoxSuccess",
287
- "QUESTION": "sapMMessageBoxQuestion",
288
- "STANDARD": "sapMMessageBoxStandard"
289
- },
290
- mIcons = {
291
- "INFORMATION": IconPool.getIconURI("information"),
292
- "WARNING": IconPool.getIconURI("alert"),
293
- "ERROR": IconPool.getIconURI("error"),
294
- "SUCCESS": IconPool.getIconURI("sys-enter-2"),
295
- "QUESTION": IconPool.getIconURI("sys-help-2")
296
- };
297
-
298
- _verifyBundle();
299
-
300
- if (typeof mOptions === "string" || arguments.length > 2) {
301
- // Old API compatibility
302
- // oIcon, sTitle, vActions, fnCallback, sDialogId, sStyleClass
303
- sIcon = arguments[1];
304
- sTitle = arguments[2];
305
- vActions = arguments[3];
306
- fnCallback = arguments[4];
307
- sDialogId = arguments[5];
308
- sClass = arguments[6];
309
- mOptions = {
310
- icon: sIcon,
311
- title: sTitle,
312
- actions: vActions,
313
- onClose: fnCallback,
314
- id: sDialogId,
315
- styleClass: sClass
316
- };
22
+ ], function (
23
+ Button,
24
+ Dialog,
25
+ Text,
26
+ FormattedText,
27
+ Link,
28
+ MessageStrip,
29
+ VBox,
30
+ IconPool,
31
+ ElementMetadata,
32
+ coreLibrary,
33
+ Control,
34
+ library,
35
+ jQuery
36
+ ) {
37
+ "use strict";
38
+
39
+ // shortcut for sap.m.DialogType
40
+ var DialogType = library.DialogType;
41
+
42
+ // shortcut for sap.m.DialogRoleType
43
+ var DialogRoleType = library.DialogRoleType;
44
+
45
+ // shortcut for sap.m.ButtonType
46
+ var ButtonType = library.ButtonType;
47
+
48
+ // shortcut for sap.m.TitleAlignment
49
+ var TitleAlignment = library.TitleAlignment;
50
+
51
+ // shortcut for sap.m.FlexRendertype
52
+ var FlexRendertype = library.FlexRendertype;
53
+
54
+ // shortcut for sap.m.FlexAlignItems
55
+ var FlexAlignItems = library.FlexAlignItems;
56
+
57
+ // shortcut for sap.ui.core.MessageType
58
+ var MessageType = coreLibrary.MessageType;
59
+
60
+ // shortcut for sap.ui.core.TextDirection
61
+ var TextDirection = coreLibrary.TextDirection;
62
+
63
+ /**
64
+ * Provides easier methods to create sap.m.Dialog with type sap.m.DialogType.Message, such as standard alerts,
65
+ * confirmation dialogs, or arbitrary message dialogs.
66
+ *
67
+ * Because the <code>MessageBox</code> is a static class, a <code>sap.ui.require("sap/m/MessageBox");</code> statement
68
+ * must be explicitly executed prior using the class.
69
+ * MessageBox provides several functions:
70
+ * <ul>
71
+ * <li><code>show()</code> - This is the generic way to open a message dialog. You can customize its contents through the <code>mOptions</code> parameter described below.</li>
72
+ * <li><code>alert()</code>, <code>confirm()</code>, <code>error()</code>, <code>information()</code>, <code>success()</code> and <code>warning()</code> - predefined templates of message dialogs. Each value type is coming with action buttons and an icon that are corresponding to its semantic. Although the full set of <code>mOptions</code> (applicable to <code>show()</code>) are available to them, it is recommended to only use the documented options.</li>
73
+ * </ul>
74
+ *
75
+ * <b>NOTE:</b> All options of show() are available for the other template functions as well, but it is recommended to use show() only in more specific scenarios.<br />
76
+ * <b>NOTE:</b> Due to the static nature of the <code>MessageBox</code> class, you cannot expect data binding support from its helper functions. If this is required you can use the <code>sap.m.Dialog</code> instead.<br />
77
+ * <b>NOTE:</b> When using the <code>MessageBox.Error</code> method, there is no emphasized action by design.
78
+ *
79
+ * Example:
80
+ * <pre>
81
+ *sap.ui.define(["sap/m/MessageBox"], function (MessageBox) {
82
+ * MessageBox.show(
83
+ * "This message should appear in the message box.", {
84
+ * icon: MessageBox.Icon.INFORMATION,
85
+ * title: "My message box title",
86
+ * actions: [MessageBox.Action.YES, MessageBox.Action.NO],
87
+ * emphasizedAction: MessageBox.Action.YES,
88
+ * onClose: function (oAction) { / * do something * / }
89
+ * }
90
+ * );
91
+ *});
92
+ * </pre>
93
+ *
94
+ * When using the <code>sap.m.MessageBox</code> in SAP Quartz and Horizon themes, the breakpoints and layout paddings could be determined by the MessageBox' width. To enable this concept and add responsive paddings to an element of the MessageBox control, you have to add the following classes depending on your use case: <code>sapUiResponsivePadding--header</code>, <code>sapUiResponsivePadding--content</code>, <code>sapUiResponsivePadding--footer</code>.
95
+ *
96
+ * @namespace
97
+ * @alias sap.m.MessageBox
98
+ * @public
99
+ * @since 1.21.2
100
+ * @see {@link fiori:https://experience.sap.com/fiori-design-web/message-box/ Message Box}
101
+ */
102
+ var MessageBox = {};
103
+
104
+ /**
105
+ * Enumeration of supported actions in a MessageBox.
106
+ *
107
+ * Each action is represented as a button in the message box. The values of this enumeration are used for both,
108
+ * specifying the set of allowed actions as well as reporting back the user choice.
109
+ * @enum {string}
110
+ * @public
111
+ */
112
+ MessageBox.Action = {
113
+
114
+ /**
115
+ * Adds an "OK" button to the message box.
116
+ * @public
117
+ */
118
+ OK: "OK",
119
+
120
+ /**
121
+ * Adds a "Cancel" button to the message box.
122
+ * @public
123
+ */
124
+ CANCEL: "CANCEL",
125
+
126
+ /**
127
+ * Adds a "Yes" button to the message box.
128
+ * @public
129
+ */
130
+ YES: "YES",
131
+
132
+ /**
133
+ * Adds a "No" button to the message box.
134
+ * @public
135
+ */
136
+ NO: "NO",
137
+
138
+ /**
139
+ * Adds an "Abort" button to the message box.
140
+ * @public
141
+ */
142
+ ABORT: "ABORT",
143
+
144
+ /**
145
+ * Adds a "Retry" button to the message box.
146
+ * @public
147
+ */
148
+ RETRY: "RETRY",
149
+
150
+ /**
151
+ * Adds an "Ignore" button to the message box.
152
+ * @public
153
+ */
154
+ IGNORE: "IGNORE",
155
+
156
+ /**
157
+ * Adds a "Close" button to the message box.
158
+ * @public
159
+ */
160
+ CLOSE: "CLOSE",
161
+
162
+ /**
163
+ * Adds a "Delete" button to the message box.
164
+ * @public
165
+ */
166
+ DELETE: "DELETE"
167
+ };
168
+
169
+ /**
170
+ * Enumeration of the pre-defined icons that can be used in a MessageBox.
171
+ * @enum {string}
172
+ * @public
173
+ */
174
+ MessageBox.Icon = {
175
+
176
+ /**
177
+ * Shows no icon in the message box.
178
+ * @public
179
+ */
180
+ NONE: undefined,
181
+
182
+ /**
183
+ * Shows the information icon in the message box.
184
+ * @public
185
+ */
186
+ INFORMATION: "INFORMATION",
187
+
188
+ /**
189
+ * Shows the warning icon in the message box.
190
+ * @public
191
+ */
192
+ WARNING: "WARNING",
193
+
194
+ /**
195
+ * Shows the error icon in the message box.
196
+ * @public
197
+ */
198
+ ERROR: "ERROR",
199
+
200
+ /**
201
+ * Shows the success icon in the message box.
202
+ * @public
203
+ */
204
+ SUCCESS: "SUCCESS",
205
+
206
+ /**
207
+ * Shows the question icon in the message box.
208
+ * @public
209
+ */
210
+ QUESTION: "QUESTION"
211
+ };
212
+
213
+ var Action = MessageBox.Action,
214
+ Icon = MessageBox.Icon;
215
+
216
+ function _verifyBundle() {
217
+ if (MessageBox._rb !== sap.ui.getCore().getLibraryResourceBundle("sap.m")) {
218
+ MessageBox._rb = sap.ui.getCore().getLibraryResourceBundle("sap.m");
219
+ }
220
+ }
221
+
222
+ function _formatDetails(vDetails) {
223
+ if (typeof vDetails === "object") {
224
+ // Using stringify() with "tab" as space argument and escaping the JSON to prevent binding
225
+ return "<pre>" + JSON.stringify(vDetails, null, "\t").replace(/{/gi, "&#x007B;") + "</pre>";
226
+ }
227
+
228
+ return vDetails;
229
+ }
230
+
231
+ function _getDetailsLayout(mOptions, oMessageText, oDialog, oInitialFocusFallback) {
232
+ var oDetails, oViewDetails, oErrorMessage, oTryAgain, bFocusTryAgain = false,
233
+ oVBox = new VBox({
234
+ renderType: FlexRendertype.Bare,
235
+ alignItems: FlexAlignItems.Start,
236
+ items: [
237
+ oMessageText
238
+ ]
239
+ });
240
+
241
+ if (!mOptions.details) {
242
+ return oVBox;
243
+ }
244
+
245
+ function showDetails(vDetails) {
246
+ // html text is set by purpose with setter. If it's set in the constructor, there would be issues with binding
247
+ oDetails.setHtmlText(_formatDetails(vDetails));
248
+
249
+ var oInitialFocus = oDialog.getInitialFocus();
250
+ oDialog.addAriaLabelledBy(oDetails);
251
+
252
+ oDetails.setVisible(true);
253
+ oViewDetails.setVisible(false);
254
+
255
+ // focus the dialog, so the screen readers can read the details text
256
+ oDialog._setInitialFocus();
257
+
258
+ if (!oInitialFocus || oInitialFocus === oViewDetails.getId()) {
259
+ // if the initialFocus is not set or is set to the "Show details" link
260
+ // focus the first action button
261
+ oInitialFocusFallback.focus();
262
+ }
263
+ }
264
+
265
+ function showDetailsAsync() {
266
+ oViewDetails.setBusyIndicatorDelay(0).setBusy(true);
267
+ oViewDetails.getDomRef("busyIndicator").focus();
268
+
269
+ mOptions.details()
270
+ .then(function (sData) {
271
+ if (oDialog.isDestroyed()) {
272
+ return;
317
273
  }
318
274
 
319
- if (mOptions && mOptions.hasOwnProperty("details")) {
320
- mDefaults.icon = Icon.INFORMATION;
321
- mDefaults.emphasizedAction = Action.OK;
322
- mDefaults.actions = [Action.OK, Action.CANCEL];
323
- mOptions = jQuery.extend({}, mDefaults, mOptions);
275
+ showDetails(sData);
276
+ })
277
+ .catch(function () {
278
+ if (oDialog.isDestroyed()) {
279
+ return;
324
280
  }
325
281
 
326
- mOptions = jQuery.extend({}, mDefaults, mOptions);
327
-
328
- // normalize the vActions array
329
- if (typeof mOptions.actions !== "undefined" && !Array.isArray(mOptions.actions)) {
330
- if (mOptions.emphasizedAction !== null) {
331
- mOptions.emphasizedAction = mOptions.actions;
332
- }
333
- mOptions.actions = [mOptions.actions];
282
+ if (document.activeElement === oViewDetails.getDomRef("busyIndicator")) {
283
+ bFocusTryAgain = true;
334
284
  }
335
-
336
- if (!mOptions.actions || mOptions.actions.length === 0) {
337
- mOptions.emphasizedAction = Action.OK;
338
- mOptions.actions = [Action.OK];
285
+ oViewDetails.setVisible(false);
286
+ oErrorMessage.setVisible(true);
287
+ });
288
+ }
289
+
290
+ oDetails = new FormattedText({
291
+ visible: false
292
+ });
293
+
294
+ oViewDetails = new Link({
295
+ text: MessageBox._rb.getText("MSGBOX_LINK_TITLE"),
296
+ press: function () {
297
+ if (typeof mOptions.details === "function") {
298
+ showDetailsAsync();
299
+ } else {
300
+ showDetails(mOptions.details);
301
+ }
302
+ }
303
+ });
304
+
305
+ oTryAgain = new Link({
306
+ text: MessageBox._rb.getText("MSGBOX_DETAILS_RETRY_LOADING"),
307
+ press: function () {
308
+ oViewDetails.setVisible(true);
309
+ oErrorMessage.setVisible(false);
310
+ var oDelegate = {
311
+ onAfterRendering: function () {
312
+ oViewDetails.removeEventDelegate(oDelegate);
313
+ showDetailsAsync();
339
314
  }
315
+ };
316
+ oViewDetails.addEventDelegate(oDelegate);
317
+ }
318
+ });
319
+
320
+ oTryAgain.addEventDelegate({
321
+ onAfterRendering: function () {
322
+ if (bFocusTryAgain) {
323
+ oTryAgain.focus();
324
+ }
325
+ bFocusTryAgain = false;
326
+ }
327
+ });
328
+
329
+ oErrorMessage = new MessageStrip({
330
+ text: MessageBox._rb.getText("MSGBOX_DETAILS_LOAD_ERROR"),
331
+ type: MessageType.Error,
332
+ visible: false,
333
+ link: oTryAgain
334
+ });
335
+
336
+ oViewDetails.addStyleClass("sapMMessageBoxLinkText");
337
+ oErrorMessage.addStyleClass("sapMMessageBoxErrorText");
338
+ oDetails.addStyleClass("sapMMessageBoxDetails");
339
+
340
+ oVBox.addItem(oViewDetails);
341
+ oVBox.addItem(oErrorMessage);
342
+ oVBox.addItem(oDetails);
343
+
344
+ return oVBox;
345
+ }
346
+
347
+ /**
348
+ * Creates and displays an sap.m.Dialog with type sap.m.DialogType.Message with the given text and buttons, and optionally other parts.
349
+ * After the user has tapped a button, the <code>onClose</code> function is invoked when given.
350
+ *
351
+ * The only mandatory parameter is <code>vMessage</code>. Either a string with the corresponding text or even
352
+ * a layout control could be provided.
353
+ *
354
+ * <pre>
355
+ * sap.m.MessageBox.show("This message should appear in the message box", {
356
+ * icon: sap.m.MessageBox.Icon.NONE, // default
357
+ * title: "", // default
358
+ * actions: sap.m.MessageBox.Action.OK, // default
359
+ * emphasizedAction: sap.m.MessageBox.Action.OK, // default
360
+ * onClose: null, // default
361
+ * styleClass: "", // default
362
+ * initialFocus: null, // default
363
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
364
+ * });
365
+ * </pre>
366
+ *
367
+ * The created dialog is executed asynchronously. When it has been created and registered for rendering,
368
+ * this function returns without waiting for a user reaction.
369
+ *
370
+ * When applications have to react on the users choice, they have to provide a callback function and
371
+ * postpone any reaction on the user choice until that callback is triggered.
372
+ *
373
+ * The signature of the callback is
374
+ *
375
+ * function (oAction);
376
+ *
377
+ * where <code>oAction</code> is the button that the user has tapped. For example, when the user has pressed the close button,
378
+ * an sap.m.MessageBox.Action.CLOSE is returned.
379
+ *
380
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
381
+ * @param {object} [mOptions] Other options (optional)
382
+ * @param {sap.m.MessageBox.Icon} [mOptions.icon] The icon to be displayed.
383
+ * @param {string} [mOptions.title] The title of the message box.
384
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
385
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
386
+ * Custom action(s) string or an array can be provided, and then the translation
387
+ * of custom actions needs to be done by the application.
388
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
389
+ * @param {function} [mOptions.onClose] Function to be called when the user taps a button or closes the message box.
390
+ * @param {string} [mOptions.id] ID to be used for the dialog. Intended for test scenarios, not recommended for productive apps
391
+ * @param {string} [mOptions.styleClass] Added since version 1.21.2. CSS style class which is added to the dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
392
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] Added since version 1.28.0. initialFocus, this option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
393
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
394
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Added since version 1.28. Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
395
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
396
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
397
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
398
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
399
+ * The initial visibility is not configurable and the details are hidden by default.<br>
400
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
401
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
402
+ * or rejects - in this case a default error message will be displayed.
403
+ * @param {sap.ui.core.CSSSize} [mOptions.contentWidth] The width of the MessageBox
404
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
405
+ * @public
406
+ * @static
407
+ */
408
+ MessageBox.show = function (vMessage, mOptions) {
409
+ var oDialog, oMessageText, vMessageContent, oResult = null, aButtons = [], i,
410
+ sIcon, sTitle, vActions, fnCallback, sDialogId, sClass,
411
+ mDefaults = {
412
+ id: ElementMetadata.uid("mbox"),
413
+ initialFocus: null,
414
+ textDirection: TextDirection.Inherit,
415
+ verticalScrolling: true,
416
+ horizontalScrolling: true,
417
+ details: "",
418
+ contentWidth: null
419
+ },
420
+ mClasses = {
421
+ "INFORMATION": "sapMMessageBoxInfo",
422
+ "WARNING": "sapMMessageBoxWarning",
423
+ "ERROR": "sapMMessageBoxError",
424
+ "SUCCESS": "sapMMessageBoxSuccess",
425
+ "QUESTION": "sapMMessageBoxQuestion",
426
+ "STANDARD": "sapMMessageBoxStandard"
427
+ },
428
+ mIcons = {
429
+ "INFORMATION": IconPool.getIconURI("information"),
430
+ "WARNING": IconPool.getIconURI("alert"),
431
+ "ERROR": IconPool.getIconURI("error"),
432
+ "SUCCESS": IconPool.getIconURI("sys-enter-2"),
433
+ "QUESTION": IconPool.getIconURI("sys-help-2")
434
+ };
340
435
 
341
- /** creates a button for the given action */
342
- function button(sAction, sButtonType) {
343
- var sText;
344
-
345
- // Don't check in ResourceBundle library if the button is with custom text
346
- if (MessageBox.Action.hasOwnProperty(sAction)) {
347
- sText = MessageBox._rb.getText("MSGBOX_" + sAction);
348
- }
349
-
350
- var oButton = new Button({
351
- id: ElementMetadata.uid("mbox-btn-"),
352
- text: sText || sAction,
353
- type: sButtonType,
354
- press: function () {
355
- oResult = sAction;
356
- oDialog.close();
436
+ _verifyBundle();
437
+
438
+ if (typeof mOptions === "string" || arguments.length > 2) {
439
+ // Old API compatibility
440
+ // oIcon, sTitle, vActions, fnCallback, sDialogId, sStyleClass
441
+ sIcon = arguments[1];
442
+ sTitle = arguments[2];
443
+ vActions = arguments[3];
444
+ fnCallback = arguments[4];
445
+ sDialogId = arguments[5];
446
+ sClass = arguments[6];
447
+ mOptions = {
448
+ icon: sIcon,
449
+ title: sTitle,
450
+ actions: vActions,
451
+ onClose: fnCallback,
452
+ id: sDialogId,
453
+ styleClass: sClass
454
+ };
455
+ }
456
+
457
+ if (mOptions && mOptions.hasOwnProperty("details")) {
458
+ mDefaults.icon = Icon.INFORMATION;
459
+ mDefaults.emphasizedAction = Action.OK;
460
+ mDefaults.actions = [Action.OK, Action.CANCEL];
461
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
462
+ }
463
+
464
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
465
+
466
+ // normalize the vActions array
467
+ if (typeof mOptions.actions !== "undefined" && !Array.isArray(mOptions.actions)) {
468
+ if (mOptions.emphasizedAction !== null) {
469
+ mOptions.emphasizedAction = mOptions.actions;
470
+ }
471
+ mOptions.actions = [mOptions.actions];
472
+ }
473
+
474
+ if (!mOptions.actions || mOptions.actions.length === 0) {
475
+ mOptions.emphasizedAction = Action.OK;
476
+ mOptions.actions = [Action.OK];
477
+ }
478
+
479
+ /** creates a button for the given action */
480
+ function button(sAction, sButtonType) {
481
+ var sText;
482
+
483
+ // Don't check in ResourceBundle library if the button is with custom text
484
+ if (MessageBox.Action.hasOwnProperty(sAction)) {
485
+ sText = MessageBox._rb.getText("MSGBOX_" + sAction);
486
+ }
487
+
488
+ var oButton = new Button({
489
+ id: ElementMetadata.uid("mbox-btn-"),
490
+ text: sText || sAction,
491
+ type: sButtonType,
492
+ press: function () {
493
+ oResult = sAction;
494
+ oDialog.close();
495
+ }
496
+ });
497
+ return oButton;
498
+ }
499
+
500
+ var sButtonType;
501
+
502
+ for (i = 0; i < mOptions.actions.length; i++) {
503
+ sButtonType = mOptions.emphasizedAction === mOptions.actions[i] ? ButtonType.Emphasized : ButtonType.Default;
504
+ aButtons.push(button(mOptions.actions[i], sButtonType));
505
+ }
506
+
507
+ function onclose() {
508
+ if (typeof mOptions.onClose === "function") {
509
+ mOptions.onClose(oResult);
510
+ }
511
+ oDialog.detachAfterClose(onclose);
512
+ oDialog.destroy();
513
+ }
514
+
515
+ function getInitialFocusControl() {
516
+ var i = 0;
517
+ var oInitialFocusControl = null;
518
+ if (mOptions.initialFocus) {
519
+ if (mOptions.initialFocus instanceof Control) {//covers sap.m.Control cases
520
+ oInitialFocusControl = mOptions.initialFocus;
521
+ }
522
+
523
+ if (typeof mOptions.initialFocus === "string") {//covers string and MessageBox.Action cases
524
+ for (i = 0; i < aButtons.length; i++) {
525
+ if (MessageBox.Action.hasOwnProperty(mOptions.initialFocus)) {
526
+ if (MessageBox._rb.getText("MSGBOX_" + mOptions.initialFocus).toLowerCase() === aButtons[i].getText().toLowerCase()) {
527
+ oInitialFocusControl = aButtons[i];
528
+ break;
357
529
  }
358
- });
359
- return oButton;
360
- }
361
-
362
- var sButtonType;
363
-
364
- for (i = 0; i < mOptions.actions.length; i++) {
365
- sButtonType = mOptions.emphasizedAction === mOptions.actions[i] ? ButtonType.Emphasized : ButtonType.Default;
366
- aButtons.push(button(mOptions.actions[i], sButtonType));
367
- }
368
-
369
- function getInformationLayout(mOptions, oMessageText) {
370
- //Generate MessageBox Layout
371
- var oFT, oShowLink,
372
- oVBox = new VBox({
373
- items: [
374
- oMessageText
375
- ]
376
- });
377
-
378
- if (!mOptions.details) {
379
- return oVBox;
380
- }
381
-
382
- if (typeof mOptions.details == 'object') {
383
- //covers JSON case
384
- //Using stringify() with "tab" as space argument and escaping the JSON to prevent binding
385
- mOptions.details = "<pre>" + JSON.stringify(mOptions.details, null, '\t')
386
- .replace(/{/gi, "&#x007B;") + "</pre>";
387
- }
388
- // html text is set by purpose with setter. If is set in the constructor there are issues with binding
389
- oFT = new FormattedText().setVisible(false).setHtmlText(mOptions.details);
390
-
391
- oShowLink = new Link({
392
- text: MessageBox._rb.getText("MSGBOX_LINK_TITLE"),
393
- press: function () {
394
- var oInitialFocus = oDialog.getInitialFocus();
395
- oDialog.addAriaLabelledBy(oFT);
396
-
397
- oFT.setVisible(true);
398
- oShowLink.setVisible(false);
399
-
400
- // focus the dialog, so the screen readers can read the details text
401
- oDialog._setInitialFocus();
402
-
403
- if (!oInitialFocus || oInitialFocus === oShowLink.getId()) {
404
- // if the initialFocus is not set or is set to the "Show details" link
405
- // focus the first action button
406
- aButtons[0].focus();
407
- }
530
+ } else {
531
+ if (mOptions.initialFocus.toLowerCase() === aButtons[i].getText().toLowerCase()) {
532
+ oInitialFocusControl = aButtons[i];
533
+ break;
408
534
  }
409
- });
410
-
411
- oShowLink.addStyleClass("sapMMessageBoxLinkText");
412
- oFT.addStyleClass("sapMMessageBoxDetails");
413
-
414
- oVBox.addItem(oShowLink);
415
- oVBox.addItem(oFT);
416
-
417
- return oVBox;
418
- }
419
-
420
- function onclose() {
421
- if (typeof mOptions.onClose === "function") {
422
- mOptions.onClose(oResult);
423
535
  }
424
- oDialog.detachAfterClose(onclose);
425
- oDialog.destroy();
426
536
  }
427
-
428
- function getInitialFocusControl() {
429
- var i = 0;
430
- var oInitialFocusControl = null;
431
- if (mOptions.initialFocus) {
432
- if (mOptions.initialFocus instanceof Control) {//covers sap.m.Control cases
433
- oInitialFocusControl = mOptions.initialFocus;
434
- }
435
-
436
- if (typeof mOptions.initialFocus === "string") {//covers string and MessageBox.Action cases
437
- for (i = 0; i < aButtons.length; i++) {
438
- if (MessageBox.Action.hasOwnProperty(mOptions.initialFocus)) {
439
- if (MessageBox._rb.getText("MSGBOX_" + mOptions.initialFocus).toLowerCase() === aButtons[i].getText().toLowerCase()) {
440
- oInitialFocusControl = aButtons[i];
441
- break;
442
- }
443
- } else {
444
- if (mOptions.initialFocus.toLowerCase() === aButtons[i].getText().toLowerCase()) {
445
- oInitialFocusControl = aButtons[i];
446
- break;
447
- }
448
- }
449
- }
450
- }
451
- }
452
-
453
- return oInitialFocusControl;
454
- }
455
-
456
- if (typeof (vMessage) === "string") {
457
- vMessageContent = new Text({
458
- textDirection: mOptions.textDirection
459
- }).setText(vMessage).addStyleClass("sapMMsgBoxText");
460
-
461
- // If we have only text we need to keep a reference to it and add it to the aria-labelledby attribute of the dialog.
462
- oMessageText = vMessageContent;
463
- } else if (vMessage instanceof Control) {
464
- vMessageContent = vMessage.addStyleClass("sapMMsgBoxText");
465
- }
466
-
467
- // If we have additional details, we should wrap the content in a details layout.
468
- if (mOptions && mOptions.hasOwnProperty("details") && mOptions.details !== "") {
469
- vMessageContent = getInformationLayout(mOptions, vMessageContent);
470
- }
471
-
472
- oDialog = new Dialog({
473
- id: mOptions.id,
474
- type: DialogType.Message,
475
- title: mOptions.title,
476
- titleAlignment: TitleAlignment.Auto,
477
- content: vMessageContent,
478
- icon: mIcons[mOptions.icon],
479
- initialFocus: getInitialFocusControl(),
480
- verticalScrolling: mOptions.verticalScrolling,
481
- horizontalScrolling: mOptions.horizontalScrolling,
482
- afterClose: onclose,
483
- buttons: aButtons,
484
- ariaLabelledBy: oMessageText ? oMessageText.getId() : undefined,
485
- contentWidth: mOptions.contentWidth,
486
- closeOnNavigation: mOptions.closeOnNavigation
487
- }).addStyleClass("sapMMessageBox");
488
-
489
- oDialog.setProperty("role", DialogRoleType.AlertDialog);
490
-
491
- if (mClasses[mOptions.icon]) {
492
- oDialog.addStyleClass(mClasses[mOptions.icon]);
493
- } else {
494
- oDialog.addStyleClass(mClasses.STANDARD);
495
- }
496
-
497
- if (mOptions.styleClass) {
498
- oDialog.addStyleClass(mOptions.styleClass);
499
- }
500
-
501
- oDialog.open();
502
- };
503
-
504
- /**
505
- * Displays an alert dialog with the given message and an OK button (no icons).
506
- *
507
- * <pre>
508
- * sap.m.MessageBox.alert("This message should appear in the alert", {
509
- * title: "Alert", // default
510
- * onClose: null, // default
511
- * styleClass: "", // default
512
- * actions: sap.m.MessageBox.Action.OK, // default
513
- * emphasizedAction: sap.m.MessageBox.Action.OK, // default
514
- * initialFocus: null, // default
515
- * textDirection: sap.ui.core.TextDirection.Inherit // default
516
- * });
517
- * </pre>
518
- *
519
- * If a callback is given, it is called after the alert dialog has been closed
520
- * by the user via the OK button. The callback is called with the following signature:
521
- *
522
- * <pre>
523
- * function (oAction)
524
- * </pre>
525
- *
526
- * where <code>oAction</code> can be either sap.m.MessageBox.Action.OK when the alert dialog is closed by tapping on the OK button
527
- * or null when the alert dialog is closed by calling <code>sap.m.InstanceManager.closeAllDialogs()</code>.
528
- *
529
- * The alert dialog opened by this method is processed asynchronously.
530
- * Applications have to use <code>fnCallback</code> to continue work after the
531
- * user closed the alert dialog.
532
- *
533
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
534
- * @param {object} [mOptions] Other options (optional)
535
- * @param {function} [mOptions.onClose] callback function to be called when the user closes the dialog
536
- * @param {string} [mOptions.title='Alert'] Title to be displayed in the alert dialog
537
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
538
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
539
- * Custom action(s) string or an array can be provided, and then the translation
540
- * of custom actions needs to be done by the application.
541
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
542
- * @param {string} [mOptions.id] ID to be used for the alert dialog. Intended for test scenarios, not recommended for productive apps
543
- * @param {string} [mOptions.styleClass] Added since version 1.21.2. CSS style class which is added to the alert dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
544
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] Added since version 1.28.0. initialFocus, this option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
545
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
546
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Added since version 1.28. Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
547
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
548
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
549
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
550
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
551
- * @public
552
- * @static
553
- */
554
- MessageBox.alert = function (vMessage, mOptions) {
555
- _verifyBundle();
556
-
557
- var mDefaults = {
558
- icon: Icon.NONE,
559
- title: MessageBox._rb.getText("MSGBOX_TITLE_ALERT"),
560
- emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
561
- actions: Action.OK,
562
- id: ElementMetadata.uid("alert"),
563
- initialFocus: null
564
- }, fnCallback, sTitle, sDialogId, sStyleClass;
565
-
566
- if (typeof mOptions === "function" || arguments.length > 2) {
567
- // Old API Compatibility
568
- // fnCallback, sTitle, sDialogId, sStyleClass
569
- fnCallback = arguments[1];
570
- sTitle = arguments[2];
571
- sDialogId = arguments[3];
572
- sStyleClass = arguments[4];
573
- mOptions = {
574
- onClose: fnCallback,
575
- title: sTitle,
576
- id: sDialogId,
577
- styleClass: sStyleClass
578
- };
579
- }
580
-
581
- mOptions = jQuery.extend({}, mDefaults, mOptions);
582
-
583
- return MessageBox.show(vMessage, mOptions);
584
- };
585
-
586
- /**
587
- * Displays a confirmation dialog with the given message, a QUESTION icon, an OK button
588
- * and a Cancel button. If a callback is given, it is called after the confirmation box
589
- * has been closed by the user with one of the buttons.
590
- *
591
- * <pre>
592
- * sap.m.MessageBox.confirm("This message should appear in the confirmation", {
593
- * title: "Confirm", // default
594
- * onClose: null, // default
595
- * styleClass: "", // default
596
- * actions: [ sap.m.MessageBox.Action.OK,
597
- * sap.m.MessageBox.Action.CANCEL ], // default
598
- * emphasizedAction: sap.m.MessageBox.Action.OK, // default
599
- * initialFocus: null, // default
600
- * textDirection: sap.ui.core.TextDirection.Inherit // default
601
- * });
602
- * </pre>
603
- *
604
- * The callback is called with the following signature
605
- *
606
- * <pre>
607
- * function(oAction)
608
- * </pre>
609
- *
610
- * where oAction is set by one of the following three values:
611
- * 1. sap.m.MessageBox.Action.OK: OK (confirmed) button is tapped.
612
- * 2. sap.m.MessageBox.Action.CANCEL: Cancel (unconfirmed) button is tapped.
613
- * 3. null: Confirm dialog is closed by calling <code>sap.m.InstanceManager.closeAllDialogs()</code>
614
- *
615
- * The confirmation dialog opened by this method is processed asynchronously.
616
- * Applications have to use <code>fnCallback</code> to continue work after the
617
- * user closed the confirmation dialog
618
- *
619
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
620
- * @param {object} [mOptions] Other options (optional)
621
- * @param {function} [mOptions.onClose] Callback to be called when the user closes the dialog
622
- * @param {string} [mOptions.title='Confirmation'] Title to display in the confirmation dialog
623
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
624
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
625
- * Custom action(s) string or an array can be provided, and then the translation
626
- * of custom actions needs to be done by the application.
627
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
628
- * @param {string} [mOptions.id] ID to be used for the confirmation dialog. Intended for test scenarios, not recommended for productive apps
629
- * @param {string} [mOptions.styleClass] Added since version 1.21.2. CSS style class which is added to the confirmation dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
630
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] Added since version 1.28.0. initialFocus, this option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
631
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
632
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Added since version 1.28. Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
633
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
634
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
635
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
636
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
637
- * @public
638
- * @static
639
- */
640
- MessageBox.confirm = function (vMessage, mOptions) {
641
- _verifyBundle();
642
-
643
- var mDefaults = {
644
- icon: Icon.QUESTION,
645
- title: MessageBox._rb.getText("MSGBOX_TITLE_CONFIRM"),
646
- emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
647
- actions: [Action.OK, Action.CANCEL],
648
- id: ElementMetadata.uid("confirm"),
649
- initialFocus: null
650
- }, fnCallback, sTitle, sDialogId, sStyleClass;
651
-
652
- if (typeof mOptions === "function" || arguments.length > 2) {
653
- // Old API Compatibility
654
- // fnCallback, sTitle, sDialogId
655
- fnCallback = arguments[1];
656
- sTitle = arguments[2];
657
- sDialogId = arguments[3];
658
- sStyleClass = arguments[4];
659
- mOptions = {
660
- onClose: fnCallback,
661
- title: sTitle,
662
- id: sDialogId,
663
- styleClass: sStyleClass
664
- };
665
- }
666
-
667
- mOptions = jQuery.extend({}, mDefaults, mOptions);
668
-
669
- return MessageBox.show(vMessage, mOptions);
670
- };
671
-
672
- /**
673
- * Displays an error dialog with the given message, an ERROR icon, a CLOSE button..
674
- * If a callback is given, it is called after the error box
675
- * has been closed by the user with one of the buttons.
676
- *
677
- * <pre>
678
- * sap.m.MessageBox.error("This message should appear in the error message box", {
679
- * title: "Error", // default
680
- * onClose: null, // default
681
- * styleClass: "", // default
682
- * actions: sap.m.MessageBox.Action.CLOSE, // default
683
- * emphasizedAction: null, // default
684
- * initialFocus: null, // default
685
- * textDirection: sap.ui.core.TextDirection.Inherit // default
686
- * });
687
- * </pre>
688
- *
689
- * The callback is called with the following signature
690
- *
691
- *
692
- * <pre>
693
- * function (oAction)
694
- * </pre>
695
- *
696
- * The error dialog opened by this method is processed asynchronously.
697
- * Applications have to use <code>fnCallback</code> to continue work after the
698
- * user closed the error dialog.
699
- *
700
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
701
- * @param {object} [mOptions] Other options (optional)
702
- * @param {function} [mOptions.onClose] Callback when the user closes the dialog
703
- * @param {string} [mOptions.title='Error'] Title of the error dialog
704
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
705
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
706
- * Custom action(s) string or an array can be provided, and then the translation
707
- * of custom actions needs to be done by the application.
708
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
709
- * @param {string} [mOptions.id] ID for the error dialog. Intended for test scenarios, not recommended for productive apps
710
- * @param {string} [mOptions.styleClass] CSS style class which is added to the error dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
711
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
712
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
713
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
714
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
715
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
716
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
717
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
718
- * @public
719
- * @since 1.30
720
- * @static
721
- */
722
- MessageBox.error = function (vMessage, mOptions) {
723
- _verifyBundle();
724
-
725
- var mDefaults = {
726
- icon: Icon.ERROR,
727
- title: MessageBox._rb.getText("MSGBOX_TITLE_ERROR"),
728
- emphasizedAction: null, // null: no emphasized action by default
729
- actions: Action.CLOSE,
730
- id: ElementMetadata.uid("error"),
731
- initialFocus: null
732
- };
733
-
734
- mOptions = jQuery.extend({}, mDefaults, mOptions);
735
-
736
- return MessageBox.show(vMessage, mOptions);
737
- };
738
-
739
- /**
740
- * Displays an information dialog with the given message, an INFO icon, an OK button.
741
- * If a callback is given, it is called after the info box
742
- * has been closed by the user with one of the buttons.
743
- *
744
- * <pre>
745
- * sap.m.MessageBox.information("This message should appear in the information message box", {
746
- * title: "Information", // default
747
- * onClose: null, // default
748
- * styleClass: "", // default
749
- * actions: sap.m.MessageBox.Action.OK, // default
750
- * emphasizedAction: sap.m.MessageBox.Action.OK, // default
751
- * initialFocus: null, // default
752
- * textDirection: sap.ui.core.TextDirection.Inherit // default
753
- * });
754
- * </pre>
755
- *
756
- * The callback is called with the following signature
757
- * *
758
- * <pre>
759
- * function (oAction)
760
- * </pre>
761
- *
762
- * The information dialog opened by this method is processed asynchronously.
763
- * Applications have to use <code>fnCallback</code> to continue work after the
764
- * user closed the information dialog
765
- *
766
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
767
- * @param {object} [mOptions] Other options (optional)
768
- * @param {function} [mOptions.onClose] Callback when the user closes the dialog
769
- * @param {string} [mOptions.title='Information'] Title of the information dialog
770
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
771
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
772
- * Custom action(s) string or an array can be provided, and then the translation
773
- * of custom actions needs to be done by the application.
774
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
775
- * @param {string} [mOptions.id] ID for the information dialog. Intended for test scenarios, not recommended for productive apps
776
- * @param {string} [mOptions.styleClass] CSS style class which is added to the information dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
777
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
778
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
779
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
780
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
781
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
782
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
783
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
784
- * @public
785
- * @since 1.30
786
- * @static
787
- */
788
- MessageBox.information = function (vMessage, mOptions) {
789
- _verifyBundle();
790
-
791
- var mDefaults = {
792
- icon: Icon.INFORMATION,
793
- title: MessageBox._rb.getText("MSGBOX_TITLE_INFO"),
794
- emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
795
- actions: Action.OK,
796
- id: ElementMetadata.uid("info"),
797
- initialFocus: null
798
- };
799
-
800
- mOptions = jQuery.extend({}, mDefaults, mOptions);
801
-
802
- return MessageBox.show(vMessage, mOptions);
803
- };
804
-
805
- /**
806
- * Displays a warning dialog with the given message, a WARNING icon, an OK button.
807
- * If a callback is given, it is called after the warning box
808
- * has been closed by the user with one of the buttons.
809
- *
810
- * <pre>
811
- * sap.m.MessageBox.warning("This message should appear in the warning message box", {
812
- * title: "Warning", // default
813
- * onClose: null, // default
814
- * styleClass: "", // default
815
- * actions: sap.m.MessageBox.Action.OK, // default
816
- * emphasizedAction: sap.m.MessageBox.Action.OK, // default
817
- * initialFocus: null, // default
818
- * textDirection: sap.ui.core.TextDirection.Inherit // default
819
- * });
820
- * </pre>
821
- *
822
- * The callback is called with the following signature
823
- * *
824
- * <pre>
825
- * function (oAction)
826
- * </pre>
827
- *
828
- * The warning dialog opened by this method is processed asynchronously.
829
- * Applications have to use <code>fnCallback</code> to continue work after the
830
- * user closed the warning dialog
831
- *
832
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
833
- * @param {object} [mOptions] Other options (optional)
834
- * @param {function} [mOptions.onClose] Callback when the user closes the dialog
835
- * @param {string} [mOptions.title='Warning'] Title of the warning dialog
836
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
837
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
838
- * Custom action(s) string or an array can be provided, and then the translation
839
- * of custom actions needs to be done by the application.
840
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
841
- * @param {string} [mOptions.id] ID to for the warning dialog. Intended for test scenarios, not recommended for productive apps
842
- * @param {string} [mOptions.styleClass] CSS style class which is added to the warning dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
843
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
844
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
845
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
846
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
847
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
848
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
849
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
850
- * @public
851
- * @since 1.30
852
- * @static
853
- */
854
- MessageBox.warning = function (vMessage, mOptions) {
855
- _verifyBundle();
856
-
857
- var mDefaults = {
858
- icon: Icon.WARNING ,
859
- title: MessageBox._rb.getText("MSGBOX_TITLE_WARNING"),
860
- emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
861
- actions: Action.OK,
862
- id: ElementMetadata.uid("warning"),
863
- initialFocus: null
864
- };
865
-
866
- mOptions = jQuery.extend({}, mDefaults, mOptions);
867
-
868
- return MessageBox.show(vMessage, mOptions);
869
- };
870
-
871
- /**
872
- * Displays a success dialog with the given message, a SUCCESS icon, an OK button.
873
- * If a callback is given, it is called after the success box
874
- * has been closed by the user with one of the buttons.
875
- *
876
- * <pre>
877
- * sap.m.MessageBox.success("This message should appear in the success message box", {
878
- * title: "Success", // default
879
- * onClose: null, // default
880
- * styleClass: "", // default
881
- * actions: sap.m.MessageBox.Action.OK, // default
882
- * emphasizedAction: sap.m.MessageBox.Action.OK, // default
883
- * initialFocus: null, // default
884
- * textDirection: sap.ui.core.TextDirection.Inherit // default
885
- * });
886
- * </pre>
887
- *
888
- * The callback is called with the following signature
889
- *
890
- * <pre>
891
- * function(oAction)
892
- * </pre>
893
- *
894
- * The success dialog opened by this method is processed asynchronously.
895
- * Applications have to use <code>fnCallback</code> to continue work after the
896
- * user closed the success dialog
897
- *
898
- * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
899
- * @param {object} [mOptions] Other options (optional)
900
- * @param {function} [mOptions.onClose] Callback when the user closes the dialog
901
- * @param {string} [mOptions.title='Success'] Title of the success dialog
902
- * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
903
- * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
904
- * Custom action(s) string or an array can be provided, and then the translation
905
- * of custom actions needs to be done by the application.
906
- * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
907
- * @param {string} [mOptions.id] ID for the success dialog. Intended for test scenarios, not recommended for productive apps
908
- * @param {string} [mOptions.styleClass] CSS style class which is added to the success dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
909
- * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
910
- * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
911
- * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
912
- * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
913
- * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
914
- * @param {string} [mOptions.details] Added since version 1.28.0. If 'details' is set in the MessageBox, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed. The initial visibility is not configurable and the details are hidden by default.
915
- * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
916
- * @public
917
- * @since 1.30
918
- * @static
919
- */
920
- MessageBox.success = function (vMessage, mOptions) {
921
- _verifyBundle();
922
-
923
- var mDefaults = {
924
- icon: Icon.SUCCESS ,
925
- title: MessageBox._rb.getText("MSGBOX_TITLE_SUCCESS"),
926
- emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
927
- actions: Action.OK,
928
- id: ElementMetadata.uid("success"),
929
- initialFocus: null
930
- };
931
-
932
- mOptions = jQuery.extend({}, mDefaults, mOptions);
933
-
934
- return MessageBox.show(vMessage, mOptions);
935
- };
936
- }());
937
-
938
- return MessageBox;
939
- }, /* bExport= */ true);
537
+ }
538
+ }
539
+
540
+ return oInitialFocusControl;
541
+ }
542
+
543
+ if (typeof (vMessage) === "string") {
544
+ vMessageContent = new Text({
545
+ textDirection: mOptions.textDirection
546
+ }).setText(vMessage).addStyleClass("sapMMsgBoxText");
547
+
548
+ // If we have only text we need to keep a reference to it and add it to the aria-labelledby attribute of the dialog.
549
+ oMessageText = vMessageContent;
550
+ } else if (vMessage instanceof Control) {
551
+ vMessageContent = vMessage.addStyleClass("sapMMsgBoxText");
552
+ }
553
+
554
+ oDialog = new Dialog({
555
+ id: mOptions.id,
556
+ type: DialogType.Message,
557
+ title: mOptions.title,
558
+ titleAlignment: TitleAlignment.Auto,
559
+ icon: mIcons[mOptions.icon],
560
+ initialFocus: getInitialFocusControl(),
561
+ verticalScrolling: mOptions.verticalScrolling,
562
+ horizontalScrolling: mOptions.horizontalScrolling,
563
+ afterClose: onclose,
564
+ buttons: aButtons,
565
+ ariaLabelledBy: oMessageText ? oMessageText.getId() : undefined,
566
+ contentWidth: mOptions.contentWidth,
567
+ closeOnNavigation: mOptions.closeOnNavigation
568
+ }).addStyleClass("sapMMessageBox");
569
+
570
+ // If we have additional details, we should wrap the content in a details layout.
571
+ if (mOptions.hasOwnProperty("details") && mOptions.details !== "") {
572
+ vMessageContent = _getDetailsLayout(mOptions, vMessageContent, oDialog, aButtons[0]);
573
+ }
574
+
575
+ oDialog.addContent(vMessageContent);
576
+ oDialog.setProperty("role", DialogRoleType.AlertDialog);
577
+
578
+ if (mClasses[mOptions.icon]) {
579
+ oDialog.addStyleClass(mClasses[mOptions.icon]);
580
+ } else {
581
+ oDialog.addStyleClass(mClasses.STANDARD);
582
+ }
583
+
584
+ if (mOptions.styleClass) {
585
+ oDialog.addStyleClass(mOptions.styleClass);
586
+ }
587
+
588
+ oDialog.open();
589
+ };
590
+
591
+ /**
592
+ * Displays an alert dialog with the given message and an OK button (no icons).
593
+ *
594
+ * <pre>
595
+ * sap.m.MessageBox.alert("This message should appear in the alert", {
596
+ * title: "Alert", // default
597
+ * onClose: null, // default
598
+ * styleClass: "", // default
599
+ * actions: sap.m.MessageBox.Action.OK, // default
600
+ * emphasizedAction: sap.m.MessageBox.Action.OK, // default
601
+ * initialFocus: null, // default
602
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
603
+ * });
604
+ * </pre>
605
+ *
606
+ * If a callback is given, it is called after the alert dialog has been closed
607
+ * by the user via the OK button. The callback is called with the following signature:
608
+ *
609
+ * <pre>
610
+ * function (oAction)
611
+ * </pre>
612
+ *
613
+ * where <code>oAction</code> can be either sap.m.MessageBox.Action.OK when the alert dialog is closed by tapping on the OK button
614
+ * or null when the alert dialog is closed by calling <code>sap.m.InstanceManager.closeAllDialogs()</code>.
615
+ *
616
+ * The alert dialog opened by this method is processed asynchronously.
617
+ * Applications have to use <code>fnCallback</code> to continue work after the
618
+ * user closed the alert dialog.
619
+ *
620
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
621
+ * @param {object} [mOptions] Other options (optional)
622
+ * @param {function} [mOptions.onClose] callback function to be called when the user closes the dialog
623
+ * @param {string} [mOptions.title='Alert'] Title to be displayed in the alert dialog
624
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
625
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
626
+ * Custom action(s) string or an array can be provided, and then the translation
627
+ * of custom actions needs to be done by the application.
628
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
629
+ * @param {string} [mOptions.id] ID to be used for the alert dialog. Intended for test scenarios, not recommended for productive apps
630
+ * @param {string} [mOptions.styleClass] Added since version 1.21.2. CSS style class which is added to the alert dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
631
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] Added since version 1.28.0. initialFocus, this option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
632
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
633
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Added since version 1.28. Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
634
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
635
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
636
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
637
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
638
+ * The initial visibility is not configurable and the details are hidden by default.<br>
639
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
640
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
641
+ * or rejects - in this case a default error message will be displayed.
642
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
643
+ * @public
644
+ * @static
645
+ */
646
+ MessageBox.alert = function (vMessage, mOptions) {
647
+ _verifyBundle();
648
+
649
+ var mDefaults = {
650
+ icon: Icon.NONE,
651
+ title: MessageBox._rb.getText("MSGBOX_TITLE_ALERT"),
652
+ emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
653
+ actions: Action.OK,
654
+ id: ElementMetadata.uid("alert"),
655
+ initialFocus: null
656
+ }, fnCallback, sTitle, sDialogId, sStyleClass;
657
+
658
+ if (typeof mOptions === "function" || arguments.length > 2) {
659
+ // Old API Compatibility
660
+ // fnCallback, sTitle, sDialogId, sStyleClass
661
+ fnCallback = arguments[1];
662
+ sTitle = arguments[2];
663
+ sDialogId = arguments[3];
664
+ sStyleClass = arguments[4];
665
+ mOptions = {
666
+ onClose: fnCallback,
667
+ title: sTitle,
668
+ id: sDialogId,
669
+ styleClass: sStyleClass
670
+ };
671
+ }
672
+
673
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
674
+
675
+ MessageBox.show(vMessage, mOptions);
676
+ };
677
+
678
+ /**
679
+ * Displays a confirmation dialog with the given message, a QUESTION icon, an OK button
680
+ * and a Cancel button. If a callback is given, it is called after the confirmation box
681
+ * has been closed by the user with one of the buttons.
682
+ *
683
+ * <pre>
684
+ * sap.m.MessageBox.confirm("This message should appear in the confirmation", {
685
+ * title: "Confirm", // default
686
+ * onClose: null, // default
687
+ * styleClass: "", // default
688
+ * actions: [ sap.m.MessageBox.Action.OK,
689
+ * sap.m.MessageBox.Action.CANCEL ], // default
690
+ * emphasizedAction: sap.m.MessageBox.Action.OK, // default
691
+ * initialFocus: null, // default
692
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
693
+ * });
694
+ * </pre>
695
+ *
696
+ * The callback is called with the following signature
697
+ *
698
+ * <pre>
699
+ * function(oAction)
700
+ * </pre>
701
+ *
702
+ * where oAction is set by one of the following three values:
703
+ * 1. sap.m.MessageBox.Action.OK: OK (confirmed) button is tapped.
704
+ * 2. sap.m.MessageBox.Action.CANCEL: Cancel (unconfirmed) button is tapped.
705
+ * 3. null: Confirm dialog is closed by calling <code>sap.m.InstanceManager.closeAllDialogs()</code>
706
+ *
707
+ * The confirmation dialog opened by this method is processed asynchronously.
708
+ * Applications have to use <code>fnCallback</code> to continue work after the
709
+ * user closed the confirmation dialog
710
+ *
711
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
712
+ * @param {object} [mOptions] Other options (optional)
713
+ * @param {function} [mOptions.onClose] Callback to be called when the user closes the dialog
714
+ * @param {string} [mOptions.title='Confirmation'] Title to display in the confirmation dialog
715
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
716
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
717
+ * Custom action(s) string or an array can be provided, and then the translation
718
+ * of custom actions needs to be done by the application.
719
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
720
+ * @param {string} [mOptions.id] ID to be used for the confirmation dialog. Intended for test scenarios, not recommended for productive apps
721
+ * @param {string} [mOptions.styleClass] Added since version 1.21.2. CSS style class which is added to the confirmation dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
722
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] Added since version 1.28.0. initialFocus, this option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
723
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
724
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Added since version 1.28. Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
725
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
726
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
727
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
728
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
729
+ * The initial visibility is not configurable and the details are hidden by default.<br>
730
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
731
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
732
+ * or rejects - in this case a default error message will be displayed.
733
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
734
+ * @public
735
+ * @static
736
+ */
737
+ MessageBox.confirm = function (vMessage, mOptions) {
738
+ _verifyBundle();
739
+
740
+ var mDefaults = {
741
+ icon: Icon.QUESTION,
742
+ title: MessageBox._rb.getText("MSGBOX_TITLE_CONFIRM"),
743
+ emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
744
+ actions: [Action.OK, Action.CANCEL],
745
+ id: ElementMetadata.uid("confirm"),
746
+ initialFocus: null
747
+ }, fnCallback, sTitle, sDialogId, sStyleClass;
748
+
749
+ if (typeof mOptions === "function" || arguments.length > 2) {
750
+ // Old API Compatibility
751
+ // fnCallback, sTitle, sDialogId
752
+ fnCallback = arguments[1];
753
+ sTitle = arguments[2];
754
+ sDialogId = arguments[3];
755
+ sStyleClass = arguments[4];
756
+ mOptions = {
757
+ onClose: fnCallback,
758
+ title: sTitle,
759
+ id: sDialogId,
760
+ styleClass: sStyleClass
761
+ };
762
+ }
763
+
764
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
765
+
766
+ MessageBox.show(vMessage, mOptions);
767
+ };
768
+
769
+ /**
770
+ * Displays an error dialog with the given message, an ERROR icon, a CLOSE button..
771
+ * If a callback is given, it is called after the error box
772
+ * has been closed by the user with one of the buttons.
773
+ *
774
+ * <pre>
775
+ * sap.m.MessageBox.error("This message should appear in the error message box", {
776
+ * title: "Error", // default
777
+ * onClose: null, // default
778
+ * styleClass: "", // default
779
+ * actions: sap.m.MessageBox.Action.CLOSE, // default
780
+ * emphasizedAction: null, // default
781
+ * initialFocus: null, // default
782
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
783
+ * });
784
+ * </pre>
785
+ *
786
+ * The callback is called with the following signature
787
+ *
788
+ * <pre>
789
+ * function (oAction)
790
+ * </pre>
791
+ *
792
+ * The error dialog opened by this method is processed asynchronously.
793
+ * Applications have to use <code>fnCallback</code> to continue work after the
794
+ * user closed the error dialog.
795
+ *
796
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
797
+ * @param {object} [mOptions] Other options (optional)
798
+ * @param {function} [mOptions.onClose] Callback when the user closes the dialog
799
+ * @param {string} [mOptions.title='Error'] Title of the error dialog
800
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
801
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
802
+ * Custom action(s) string or an array can be provided, and then the translation
803
+ * of custom actions needs to be done by the application.
804
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
805
+ * @param {string} [mOptions.id] ID for the error dialog. Intended for test scenarios, not recommended for productive apps
806
+ * @param {string} [mOptions.styleClass] CSS style class which is added to the error dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
807
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
808
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
809
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
810
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
811
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
812
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
813
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
814
+ * The initial visibility is not configurable and the details are hidden by default.<br>
815
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
816
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
817
+ * or rejects - in this case a default error message will be displayed.
818
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
819
+ * @public
820
+ * @since 1.30
821
+ * @static
822
+ */
823
+ MessageBox.error = function (vMessage, mOptions) {
824
+ _verifyBundle();
825
+
826
+ var mDefaults = {
827
+ icon: Icon.ERROR,
828
+ title: MessageBox._rb.getText("MSGBOX_TITLE_ERROR"),
829
+ emphasizedAction: null, // null: no emphasized action by default
830
+ actions: Action.CLOSE,
831
+ id: ElementMetadata.uid("error"),
832
+ initialFocus: null
833
+ };
834
+
835
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
836
+
837
+ MessageBox.show(vMessage, mOptions);
838
+ };
839
+
840
+ /**
841
+ * Displays an information dialog with the given message, an INFO icon, an OK button.
842
+ * If a callback is given, it is called after the info box
843
+ * has been closed by the user with one of the buttons.
844
+ *
845
+ * <pre>
846
+ * sap.m.MessageBox.information("This message should appear in the information message box", {
847
+ * title: "Information", // default
848
+ * onClose: null, // default
849
+ * styleClass: "", // default
850
+ * actions: sap.m.MessageBox.Action.OK, // default
851
+ * emphasizedAction: sap.m.MessageBox.Action.OK, // default
852
+ * initialFocus: null, // default
853
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
854
+ * });
855
+ * </pre>
856
+ *
857
+ * The callback is called with the following signature
858
+ * <pre>
859
+ * function (oAction)
860
+ * </pre>
861
+ *
862
+ * The information dialog opened by this method is processed asynchronously.
863
+ * Applications have to use <code>fnCallback</code> to continue work after the
864
+ * user closed the information dialog
865
+ *
866
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
867
+ * @param {object} [mOptions] Other options (optional)
868
+ * @param {function} [mOptions.onClose] Callback when the user closes the dialog
869
+ * @param {string} [mOptions.title='Information'] Title of the information dialog
870
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
871
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
872
+ * Custom action(s) string or an array can be provided, and then the translation
873
+ * of custom actions needs to be done by the application.
874
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
875
+ * @param {string} [mOptions.id] ID for the information dialog. Intended for test scenarios, not recommended for productive apps
876
+ * @param {string} [mOptions.styleClass] CSS style class which is added to the information dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
877
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
878
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
879
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
880
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
881
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
882
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
883
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
884
+ * The initial visibility is not configurable and the details are hidden by default.<br>
885
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
886
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
887
+ * or rejects - in this case a default error message will be displayed.
888
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
889
+ * @public
890
+ * @since 1.30
891
+ * @static
892
+ */
893
+ MessageBox.information = function (vMessage, mOptions) {
894
+ _verifyBundle();
895
+
896
+ var mDefaults = {
897
+ icon: Icon.INFORMATION,
898
+ title: MessageBox._rb.getText("MSGBOX_TITLE_INFO"),
899
+ emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
900
+ actions: Action.OK,
901
+ id: ElementMetadata.uid("info"),
902
+ initialFocus: null
903
+ };
904
+
905
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
906
+
907
+ MessageBox.show(vMessage, mOptions);
908
+ };
909
+
910
+ /**
911
+ * Displays a warning dialog with the given message, a WARNING icon, an OK button.
912
+ * If a callback is given, it is called after the warning box
913
+ * has been closed by the user with one of the buttons.
914
+ *
915
+ * <pre>
916
+ * sap.m.MessageBox.warning("This message should appear in the warning message box", {
917
+ * title: "Warning", // default
918
+ * onClose: null, // default
919
+ * styleClass: "", // default
920
+ * actions: sap.m.MessageBox.Action.OK, // default
921
+ * emphasizedAction: sap.m.MessageBox.Action.OK, // default
922
+ * initialFocus: null, // default
923
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
924
+ * });
925
+ * </pre>
926
+ *
927
+ * The callback is called with the following signature
928
+ * <pre>
929
+ * function (oAction)
930
+ * </pre>
931
+ *
932
+ * The warning dialog opened by this method is processed asynchronously.
933
+ * Applications have to use <code>fnCallback</code> to continue work after the
934
+ * user closed the warning dialog
935
+ *
936
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
937
+ * @param {object} [mOptions] Other options (optional)
938
+ * @param {function} [mOptions.onClose] Callback when the user closes the dialog
939
+ * @param {string} [mOptions.title='Warning'] Title of the warning dialog
940
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
941
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
942
+ * Custom action(s) string or an array can be provided, and then the translation
943
+ * of custom actions needs to be done by the application.
944
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
945
+ * @param {string} [mOptions.id] ID to for the warning dialog. Intended for test scenarios, not recommended for productive apps
946
+ * @param {string} [mOptions.styleClass] CSS style class which is added to the warning dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
947
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
948
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
949
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
950
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
951
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
952
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
953
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
954
+ * The initial visibility is not configurable and the details are hidden by default.<br>
955
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
956
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
957
+ * or rejects - in this case a default error message will be displayed.
958
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
959
+ * @public
960
+ * @since 1.30
961
+ * @static
962
+ */
963
+ MessageBox.warning = function (vMessage, mOptions) {
964
+ _verifyBundle();
965
+
966
+ var mDefaults = {
967
+ icon: Icon.WARNING ,
968
+ title: MessageBox._rb.getText("MSGBOX_TITLE_WARNING"),
969
+ emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
970
+ actions: Action.OK,
971
+ id: ElementMetadata.uid("warning"),
972
+ initialFocus: null
973
+ };
974
+
975
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
976
+
977
+ MessageBox.show(vMessage, mOptions);
978
+ };
979
+
980
+ /**
981
+ * Displays a success dialog with the given message, a SUCCESS icon, an OK button.
982
+ * If a callback is given, it is called after the success box
983
+ * has been closed by the user with one of the buttons.
984
+ *
985
+ * <pre>
986
+ * sap.m.MessageBox.success("This message should appear in the success message box", {
987
+ * title: "Success", // default
988
+ * onClose: null, // default
989
+ * styleClass: "", // default
990
+ * actions: sap.m.MessageBox.Action.OK, // default
991
+ * emphasizedAction: sap.m.MessageBox.Action.OK, // default
992
+ * initialFocus: null, // default
993
+ * textDirection: sap.ui.core.TextDirection.Inherit // default
994
+ * });
995
+ * </pre>
996
+ *
997
+ * The callback is called with the following signature
998
+ * <pre>
999
+ * function(oAction)
1000
+ * </pre>
1001
+ *
1002
+ * The success dialog opened by this method is processed asynchronously.
1003
+ * Applications have to use <code>fnCallback</code> to continue work after the
1004
+ * user closed the success dialog
1005
+ *
1006
+ * @param {string} vMessage Message to be displayed in the alert dialog. The usage of sap.core.Control as vMessage is deprecated since version 1.30.4.
1007
+ * @param {object} [mOptions] Other options (optional)
1008
+ * @param {function} [mOptions.onClose] Callback when the user closes the dialog
1009
+ * @param {string} [mOptions.title='Success'] Title of the success dialog
1010
+ * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [mOptions.actions=sap.m.MessageBox.Action.OK] Either a single action, or an array of actions.
1011
+ * If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter.
1012
+ * Custom action(s) string or an array can be provided, and then the translation
1013
+ * of custom actions needs to be done by the application.
1014
+ * @param {sap.m.MessageBox.Action|string} [mOptions.emphasizedAction=sap.m.MessageBox.Action.OK] Added since version 1.75.0. Specifies which action of the created dialog will be emphasized. EmphasizedAction will apply only if the property <code>actions</code> is provided.
1015
+ * @param {string} [mOptions.id] ID for the success dialog. Intended for test scenarios, not recommended for productive apps
1016
+ * @param {string} [mOptions.styleClass] CSS style class which is added to the success dialog's root DOM node. The compact design can be activated by setting this to "sapUiSizeCompact"
1017
+ * @param {string|sap.m.MessageBox.Action} [mOptions.initialFocus] This option sets the action name, the text of the button or the control that gets the focus as first focusable element after the MessageBox is opened.
1018
+ * The usage of sap.ui.core.Control to set initialFocus is deprecated since version 1.30.4.
1019
+ * @param {sap.ui.core.TextDirection} [mOptions.textDirection] Specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.
1020
+ * @param {boolean} [mOptions.verticalScrolling] verticalScrolling is deprecated since version 1.30.4. VerticalScrolling, this option indicates if the user can scroll vertically inside the MessageBox when the content is larger than the content area.
1021
+ * @param {boolean} [mOptions.horizontalScrolling] horizontalScrolling is deprecated since version 1.30.4. HorizontalScrolling, this option indicates if the user can scroll horizontally inside the MessageBox when the content is larger than the content area.
1022
+ * @param {string|object|function():Promise<string|object>} [mOptions.details]
1023
+ * Added since version 1.28.0. If 'details' is set, a link to view details is added. When the user clicks the link, the text area containing 'details' information is displayed.
1024
+ * The initial visibility is not configurable and the details are hidden by default.<br>
1025
+ * If object is given, it will be serialized using <code>JSON.stringify</code>.<br>
1026
+ * Since version 1.103, a callback function can be used. It should return a promise, that resolves with a <code>string</code> value or a JSON object, which will be stringified,
1027
+ * or rejects - in this case a default error message will be displayed.
1028
+ * @param {boolean} [mOptions.closeOnNavigation=true] Added since version 1.72.0. Whether the MessageBox will be closed automatically when a routing navigation occurs.
1029
+ * @public
1030
+ * @since 1.30
1031
+ * @static
1032
+ */
1033
+ MessageBox.success = function (vMessage, mOptions) {
1034
+ _verifyBundle();
1035
+
1036
+ var mDefaults = {
1037
+ icon: Icon.SUCCESS ,
1038
+ title: MessageBox._rb.getText("MSGBOX_TITLE_SUCCESS"),
1039
+ emphasizedAction: mOptions && mOptions.actions ? null : Action.OK,
1040
+ actions: Action.OK,
1041
+ id: ElementMetadata.uid("success"),
1042
+ initialFocus: null
1043
+ };
1044
+
1045
+ mOptions = jQuery.extend({}, mDefaults, mOptions);
1046
+
1047
+ MessageBox.show(vMessage, mOptions);
1048
+ };
1049
+
1050
+ return MessageBox;
1051
+ }, /* bExport= */ true);