@openui5/sap.m 1.71.44 → 1.71.47
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.
- package/LICENSE.txt +1 -1
- package/package.json +4 -4
- package/src/sap/m/.library +1 -1
- package/src/sap/m/AccButton.js +1 -1
- package/src/sap/m/ActionListItem.js +1 -1
- package/src/sap/m/ActionSelect.js +1 -1
- package/src/sap/m/ActionSheet.js +1 -1
- package/src/sap/m/App.js +1 -1
- package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
- package/src/sap/m/Bar.js +1 -1
- package/src/sap/m/Breadcrumbs.js +1 -1
- package/src/sap/m/BusyDialog.js +1 -1
- package/src/sap/m/BusyIndicator.js +1 -1
- package/src/sap/m/Button.js +1 -1
- package/src/sap/m/Carousel.js +1 -1
- package/src/sap/m/CarouselLayout.js +1 -1
- package/src/sap/m/CheckBox.js +1 -1
- package/src/sap/m/ColorPalette.js +1 -1
- package/src/sap/m/ColorPalettePopover.js +1 -1
- package/src/sap/m/Column.js +1 -1
- package/src/sap/m/ColumnHeaderPopover.js +1 -1
- package/src/sap/m/ColumnListItem.js +1 -1
- package/src/sap/m/ColumnPopoverActionItem.js +1 -1
- package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
- package/src/sap/m/ColumnPopoverItem.js +1 -1
- package/src/sap/m/ColumnPopoverSortItem.js +1 -1
- package/src/sap/m/ComboBox.js +1 -1
- package/src/sap/m/ComboBoxBase.js +1 -1
- package/src/sap/m/ComboBoxTextField.js +1 -1
- package/src/sap/m/CustomListItem.js +1 -1
- package/src/sap/m/CustomTile.js +1 -1
- package/src/sap/m/CustomTreeItem.js +1 -1
- package/src/sap/m/DatePicker.js +1 -1
- package/src/sap/m/DateRangeSelection.js +2 -2
- package/src/sap/m/DateTimeField.js +1 -1
- package/src/sap/m/DateTimeInput.js +1 -1
- package/src/sap/m/DateTimePicker.js +1 -1
- package/src/sap/m/Dialog.js +161 -44
- package/src/sap/m/DialogRenderer.js +3 -2
- package/src/sap/m/DisplayListItem.js +1 -1
- package/src/sap/m/DraftIndicator.js +1 -1
- package/src/sap/m/FacetFilter.js +1 -1
- package/src/sap/m/FacetFilterItem.js +1 -1
- package/src/sap/m/FacetFilterList.js +1 -1
- package/src/sap/m/FeedContent.js +1 -1
- package/src/sap/m/FeedInput.js +1 -1
- package/src/sap/m/FeedListItem.js +1 -1
- package/src/sap/m/FeedListItemAction.js +1 -1
- package/src/sap/m/Fiori20Adapter.js +2 -2
- package/src/sap/m/FlexBox.js +1 -1
- package/src/sap/m/FlexItemData.js +1 -1
- package/src/sap/m/FormattedText.js +13 -9
- package/src/sap/m/GenericTag.js +1 -1
- package/src/sap/m/GenericTile.js +1 -1
- package/src/sap/m/GroupHeaderListItem.js +1 -1
- package/src/sap/m/GrowingList.js +1 -1
- package/src/sap/m/HBox.js +1 -1
- package/src/sap/m/HeaderContainer.js +1 -1
- package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
- package/src/sap/m/IconTabBar.js +1 -1
- package/src/sap/m/IconTabBarSelectList.js +1 -1
- package/src/sap/m/IconTabFilter.js +1 -1
- package/src/sap/m/IconTabHeader.js +1 -1
- package/src/sap/m/IconTabSeparator.js +1 -1
- package/src/sap/m/Image.js +1 -1
- package/src/sap/m/ImageContent.js +1 -1
- package/src/sap/m/Input.js +1 -1
- package/src/sap/m/InputBase.js +1 -1
- package/src/sap/m/InputListItem.js +1 -1
- package/src/sap/m/Label.js +1 -1
- package/src/sap/m/LightBox.js +1 -1
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +2 -2
- package/src/sap/m/LinkRenderer.js +1 -2
- package/src/sap/m/List.js +1 -1
- package/src/sap/m/ListBase.js +1 -1
- package/src/sap/m/ListItemBase.js +1 -1
- package/src/sap/m/MaskEnabler.js +1 -1
- package/src/sap/m/MaskInput.js +1 -1
- package/src/sap/m/MaskInputRule.js +1 -1
- package/src/sap/m/Menu.js +1 -1
- package/src/sap/m/MenuButton.js +1 -1
- package/src/sap/m/MenuItem.js +1 -1
- package/src/sap/m/MenuListItem.js +1 -1
- package/src/sap/m/MessageItem.js +1 -1
- package/src/sap/m/MessageListItem.js +1 -1
- package/src/sap/m/MessagePage.js +1 -1
- package/src/sap/m/MessagePopover.js +1 -1
- package/src/sap/m/MessagePopoverItem.js +1 -1
- package/src/sap/m/MessageStrip.js +2 -2
- package/src/sap/m/MessageToast.js +1 -1
- package/src/sap/m/MessageView.js +1 -1
- package/src/sap/m/MultiComboBox.js +1 -1
- package/src/sap/m/MultiEditField.js +1 -1
- package/src/sap/m/MultiInput.js +35 -2
- package/src/sap/m/NavContainer.js +1 -1
- package/src/sap/m/NewsContent.js +1 -1
- package/src/sap/m/NotificationListBase.js +1 -1
- package/src/sap/m/NotificationListGroup.js +1 -1
- package/src/sap/m/NotificationListItem.js +1 -1
- package/src/sap/m/NumericContent.js +1 -1
- package/src/sap/m/ObjectAttribute.js +1 -1
- package/src/sap/m/ObjectHeader.js +17 -7
- package/src/sap/m/ObjectIdentifier.js +1 -1
- package/src/sap/m/ObjectListItem.js +1 -1
- package/src/sap/m/ObjectMarker.js +1 -1
- package/src/sap/m/ObjectNumber.js +1 -1
- package/src/sap/m/ObjectStatus.js +1 -1
- package/src/sap/m/OverflowToolbar.js +7 -3
- package/src/sap/m/OverflowToolbarAssociativePopover.js +4 -2
- package/src/sap/m/OverflowToolbarButton.js +1 -1
- package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
- package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/P13nAnyFilterItem.js +1 -1
- package/src/sap/m/P13nColumnsItem.js +1 -1
- package/src/sap/m/P13nColumnsPanel.js +1 -1
- package/src/sap/m/P13nConditionPanel.js +6 -1
- package/src/sap/m/P13nDialog.js +1 -1
- package/src/sap/m/P13nDimMeasureItem.js +1 -1
- package/src/sap/m/P13nDimMeasurePanel.js +1 -1
- package/src/sap/m/P13nFilterItem.js +1 -1
- package/src/sap/m/P13nFilterPanel.js +1 -1
- package/src/sap/m/P13nGroupItem.js +1 -1
- package/src/sap/m/P13nGroupPanel.js +1 -1
- package/src/sap/m/P13nItem.js +1 -1
- package/src/sap/m/P13nPanel.js +1 -1
- package/src/sap/m/P13nSelectionItem.js +1 -1
- package/src/sap/m/P13nSelectionPanel.js +1 -1
- package/src/sap/m/P13nSortItem.js +1 -1
- package/src/sap/m/P13nSortPanel.js +1 -1
- package/src/sap/m/PDFViewer.js +2 -1
- package/src/sap/m/PDFViewerRenderer.js +15 -7
- package/src/sap/m/Page.js +1 -1
- package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/m/PagingButton.js +1 -1
- package/src/sap/m/Panel.js +1 -1
- package/src/sap/m/PlanningCalendar.js +1 -1
- package/src/sap/m/PlanningCalendarHeader.js +1 -1
- package/src/sap/m/PlanningCalendarLegend.js +1 -1
- package/src/sap/m/PlanningCalendarRow.js +1 -1
- package/src/sap/m/PlanningCalendarView.js +1 -1
- package/src/sap/m/Popover.js +112 -70
- package/src/sap/m/ProgressIndicator.js +1 -1
- package/src/sap/m/PullToRefresh.js +1 -1
- package/src/sap/m/QuickView.js +1 -1
- package/src/sap/m/QuickViewBase.js +1 -1
- package/src/sap/m/QuickViewCard.js +1 -1
- package/src/sap/m/QuickViewGroup.js +1 -1
- package/src/sap/m/QuickViewGroupElement.js +1 -1
- package/src/sap/m/QuickViewPage.js +1 -1
- package/src/sap/m/RadioButton.js +148 -212
- package/src/sap/m/RadioButtonGroup.js +66 -64
- package/src/sap/m/RadioButtonGroupRenderer.js +31 -38
- package/src/sap/m/RadioButtonRenderer.js +94 -108
- package/src/sap/m/RangeSlider.js +1 -1
- package/src/sap/m/RangeSliderRenderer.js +8 -8
- package/src/sap/m/RatingIndicator.js +1 -1
- package/src/sap/m/ResponsivePopover.js +1 -1
- package/src/sap/m/ResponsiveScale.js +1 -1
- package/src/sap/m/ScrollBar.js +1 -1
- package/src/sap/m/ScrollContainer.js +1 -1
- package/src/sap/m/SearchField.js +1 -1
- package/src/sap/m/SegmentedButton.js +1 -1
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/Select.js +20 -2
- package/src/sap/m/SelectDialog.js +1 -1
- package/src/sap/m/SelectList.js +1 -1
- package/src/sap/m/SelectionDetails.js +1 -1
- package/src/sap/m/SelectionDetailsFacade.js +2 -2
- package/src/sap/m/SelectionDetailsItem.js +1 -1
- package/src/sap/m/SelectionDetailsItemLine.js +1 -1
- package/src/sap/m/Shell.js +1 -1
- package/src/sap/m/SimpleFixFlex.js +1 -1
- package/src/sap/m/SinglePlanningCalendar.js +1 -1
- package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthView.js +3 -2
- package/src/sap/m/SinglePlanningCalendarView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
- package/src/sap/m/SlideTile.js +1 -1
- package/src/sap/m/Slider.js +1 -1
- package/src/sap/m/SliderRenderer.js +0 -1
- package/src/sap/m/SliderTooltip.js +1 -1
- package/src/sap/m/SliderTooltipBase.js +1 -1
- package/src/sap/m/SliderTooltipContainer.js +1 -1
- package/src/sap/m/SplitApp.js +1 -1
- package/src/sap/m/SplitButton.js +1 -1
- package/src/sap/m/SplitContainer.js +1 -1
- package/src/sap/m/StandardListItem.js +1 -1
- package/src/sap/m/StandardTile.js +1 -1
- package/src/sap/m/StandardTreeItem.js +1 -1
- package/src/sap/m/StepInput.js +1 -1
- package/src/sap/m/StepInputRenderer.js +0 -3
- package/src/sap/m/SuggestionItem.js +1 -1
- package/src/sap/m/SuggestionsPopover.js +3 -2
- package/src/sap/m/Switch.js +2 -2
- package/src/sap/m/SwitchRenderer.js +1 -1
- package/src/sap/m/TabContainer.js +1 -1
- package/src/sap/m/TabContainerItem.js +1 -1
- package/src/sap/m/TabStrip.js +1 -1
- package/src/sap/m/TabStripItem.js +1 -1
- package/src/sap/m/Table.js +1 -1
- package/src/sap/m/TablePersoController.js +1 -1
- package/src/sap/m/TablePersoDialog.js +1 -1
- package/src/sap/m/TablePersoProvider.js +1 -1
- package/src/sap/m/TableSelectDialog.js +1 -1
- package/src/sap/m/Text.js +1 -1
- package/src/sap/m/TextArea.js +1 -1
- package/src/sap/m/Tile.js +1 -1
- package/src/sap/m/TileContainer.js +1 -1
- package/src/sap/m/TileContent.js +1 -1
- package/src/sap/m/TimePicker.js +49 -19
- package/src/sap/m/TimePickerSlider.js +1 -1
- package/src/sap/m/TimePickerSliders.js +1 -1
- package/src/sap/m/Title.js +1 -1
- package/src/sap/m/TitlePropagationSupport.js +1 -1
- package/src/sap/m/ToggleButton.js +1 -1
- package/src/sap/m/Token.js +1 -1
- package/src/sap/m/Tokenizer.js +3 -5
- package/src/sap/m/Toolbar.js +1 -1
- package/src/sap/m/ToolbarLayoutData.js +1 -1
- package/src/sap/m/ToolbarSeparator.js +1 -1
- package/src/sap/m/ToolbarSpacer.js +1 -1
- package/src/sap/m/Tree.js +1 -1
- package/src/sap/m/TreeItemBase.js +1 -1
- package/src/sap/m/UploadCollection.js +2 -2
- package/src/sap/m/UploadCollectionItem.js +1 -1
- package/src/sap/m/UploadCollectionParameter.js +1 -1
- package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
- package/src/sap/m/VBox.js +1 -1
- package/src/sap/m/ViewSettingsCustomItem.js +1 -1
- package/src/sap/m/ViewSettingsCustomTab.js +1 -1
- package/src/sap/m/ViewSettingsDialog.js +1 -1
- package/src/sap/m/ViewSettingsFilterItem.js +1 -1
- package/src/sap/m/ViewSettingsItem.js +1 -1
- package/src/sap/m/VisibleItem.js +1 -1
- package/src/sap/m/Wizard.js +1 -1
- package/src/sap/m/WizardProgressNavigator.js +1 -1
- package/src/sap/m/WizardStep.js +1 -1
- package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
- package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
- package/src/sap/m/changeHandler/CombineButtons.js +1 -1
- package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
- package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
- package/src/sap/m/delegate/ValueStateMessage.js +2 -0
- package/src/sap/m/designtime/messagebundle_de.properties +2 -2
- package/src/sap/m/library.js +2 -2
- package/src/sap/m/messagebundle_cs.properties +2 -2
- package/src/sap/m/messagebundle_fr.properties +6 -6
- package/src/sap/m/messagebundle_hr.properties +2 -2
- package/src/sap/m/messagebundle_it.properties +9 -9
- package/src/sap/m/messagebundle_iw.properties +1 -1
- package/src/sap/m/messagebundle_ko.properties +7 -7
- package/src/sap/m/messagebundle_nl.properties +4 -4
- package/src/sap/m/messagebundle_pt.properties +7 -7
- package/src/sap/m/messagebundle_sh.properties +1 -1
- package/src/sap/m/messagebundle_th.properties +1 -1
- package/src/sap/m/messagebundle_zh_CN.properties +1 -1
- package/src/sap/m/semantic/AddAction.js +1 -1
- package/src/sap/m/semantic/CancelAction.js +1 -1
- package/src/sap/m/semantic/DeleteAction.js +1 -1
- package/src/sap/m/semantic/DetailPage.js +1 -1
- package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
- package/src/sap/m/semantic/EditAction.js +1 -1
- package/src/sap/m/semantic/FavoriteAction.js +1 -1
- package/src/sap/m/semantic/FilterAction.js +1 -1
- package/src/sap/m/semantic/FilterSelect.js +1 -1
- package/src/sap/m/semantic/FlagAction.js +1 -1
- package/src/sap/m/semantic/ForwardAction.js +1 -1
- package/src/sap/m/semantic/FullscreenPage.js +1 -1
- package/src/sap/m/semantic/GroupAction.js +1 -1
- package/src/sap/m/semantic/GroupSelect.js +1 -1
- package/src/sap/m/semantic/MainAction.js +1 -1
- package/src/sap/m/semantic/MasterPage.js +1 -1
- package/src/sap/m/semantic/MessagesIndicator.js +1 -1
- package/src/sap/m/semantic/MultiSelectAction.js +1 -1
- package/src/sap/m/semantic/NegativeAction.js +1 -1
- package/src/sap/m/semantic/OpenInAction.js +1 -1
- package/src/sap/m/semantic/PositiveAction.js +1 -1
- package/src/sap/m/semantic/PrintAction.js +1 -1
- package/src/sap/m/semantic/SaveAction.js +1 -1
- package/src/sap/m/semantic/Segment.js +1 -1
- package/src/sap/m/semantic/SegmentedContainer.js +1 -1
- package/src/sap/m/semantic/SemanticButton.js +1 -1
- package/src/sap/m/semantic/SemanticConfiguration.js +1 -1
- package/src/sap/m/semantic/SemanticControl.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
- package/src/sap/m/semantic/SemanticPage.js +1 -1
- package/src/sap/m/semantic/SemanticSelect.js +1 -1
- package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
- package/src/sap/m/semantic/SendEmailAction.js +1 -1
- package/src/sap/m/semantic/SendMessageAction.js +1 -1
- package/src/sap/m/semantic/ShareInJamAction.js +1 -1
- package/src/sap/m/semantic/ShareMenu.js +1 -1
- package/src/sap/m/semantic/ShareMenuPage.js +1 -1
- package/src/sap/m/semantic/SortAction.js +1 -1
- package/src/sap/m/semantic/SortSelect.js +1 -1
- package/src/sap/m/themes/base/Dialog.less +4 -66
- package/src/sap/m/themes/base/Popover.less +0 -1
- package/src/sap/m/themes/base/RadioButton.less +2 -2
- package/src/sap/m/upload/UploadSet.js +32 -2
- package/src/sap/m/upload/UploadSetItem.js +1 -1
package/src/sap/m/RadioButton.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
'./library',
|
|
10
10
|
'sap/ui/core/Control',
|
|
11
|
+
'sap/ui/core/Core',
|
|
11
12
|
'sap/ui/core/EnabledPropagator',
|
|
12
13
|
'sap/ui/core/message/MessageMixin',
|
|
13
|
-
'
|
|
14
|
-
'./Label',
|
|
14
|
+
'sap/m/Label',
|
|
15
15
|
'sap/ui/core/library',
|
|
16
16
|
'sap/base/strings/capitalize',
|
|
17
17
|
'./RadioButtonRenderer'
|
|
@@ -19,9 +19,9 @@ sap.ui.define([
|
|
|
19
19
|
function(
|
|
20
20
|
library,
|
|
21
21
|
Control,
|
|
22
|
+
Core,
|
|
22
23
|
EnabledPropagator,
|
|
23
24
|
MessageMixin,
|
|
24
|
-
RadioButtonGroup,
|
|
25
25
|
Label,
|
|
26
26
|
coreLibrary,
|
|
27
27
|
capitalize,
|
|
@@ -29,8 +29,6 @@ function(
|
|
|
29
29
|
) {
|
|
30
30
|
"use strict";
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
32
|
// shortcut for sap.ui.core.TextAlign
|
|
35
33
|
var TextAlign = coreLibrary.TextAlign;
|
|
36
34
|
|
|
@@ -40,7 +38,12 @@ function(
|
|
|
40
38
|
// shortcut for sap.ui.core.TextDirection
|
|
41
39
|
var TextDirection = coreLibrary.TextDirection;
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
var getNextSelectionNumber = (function () {
|
|
42
|
+
var i = 0;
|
|
43
|
+
return function () {
|
|
44
|
+
return i++;
|
|
45
|
+
};
|
|
46
|
+
}());
|
|
44
47
|
|
|
45
48
|
/**
|
|
46
49
|
* Constructor for a new RadioButton.
|
|
@@ -84,7 +87,7 @@ function(
|
|
|
84
87
|
* @implements sap.ui.core.IFormContent
|
|
85
88
|
*
|
|
86
89
|
* @author SAP SE
|
|
87
|
-
* @version 1.71.
|
|
90
|
+
* @version 1.71.47
|
|
88
91
|
*
|
|
89
92
|
* @constructor
|
|
90
93
|
* @public
|
|
@@ -93,11 +96,9 @@ function(
|
|
|
93
96
|
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
94
97
|
*/
|
|
95
98
|
var RadioButton = Control.extend("sap.m.RadioButton", /** @lends sap.m.RadioButton.prototype */ { metadata : {
|
|
96
|
-
|
|
97
99
|
interfaces : ["sap.ui.core.IFormContent"],
|
|
98
100
|
library : "sap.m",
|
|
99
101
|
properties : {
|
|
100
|
-
|
|
101
102
|
/**
|
|
102
103
|
* Specifies if the radio button is disabled.
|
|
103
104
|
*/
|
|
@@ -178,7 +179,6 @@ function(
|
|
|
178
179
|
|
|
179
180
|
},
|
|
180
181
|
events : {
|
|
181
|
-
|
|
182
182
|
/**
|
|
183
183
|
* Event is triggered when the user makes a change on the radio button (selecting or unselecting it).
|
|
184
184
|
*/
|
|
@@ -193,7 +193,6 @@ function(
|
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
associations : {
|
|
196
|
-
|
|
197
196
|
/**
|
|
198
197
|
* Association to controls / IDs which describe this control (see WAI-ARIA attribute aria-describedby).
|
|
199
198
|
*/
|
|
@@ -214,6 +213,8 @@ function(
|
|
|
214
213
|
// and have valueState property of the RadioButton set to the message type.
|
|
215
214
|
MessageMixin.call(RadioButton.prototype);
|
|
216
215
|
|
|
216
|
+
RadioButton.getNextSelectionNumber = getNextSelectionNumber;
|
|
217
|
+
|
|
217
218
|
RadioButton.prototype._groupNames = {};
|
|
218
219
|
|
|
219
220
|
// Keyboard navigation variants
|
|
@@ -224,13 +225,49 @@ function(
|
|
|
224
225
|
PREV: "prev"
|
|
225
226
|
};
|
|
226
227
|
|
|
228
|
+
RadioButton.prototype.init = function () {
|
|
229
|
+
this._iSelectionNumber = -1;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
RadioButton.prototype.onBeforeRendering = function() {
|
|
233
|
+
var sGroupName = this.getGroupName();
|
|
234
|
+
|
|
235
|
+
this._updateGroupName(sGroupName);
|
|
236
|
+
this._updateLabelProperties();
|
|
237
|
+
|
|
238
|
+
// If this radio button is selected, explicitly deselect the other radio buttons in the same group
|
|
239
|
+
if (this.getSelected() && sGroupName !== "" && this._isLastSelectedInGroup(sGroupName)) {
|
|
240
|
+
this._deselectOthersInGroup(sGroupName);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Destroys all related objects to the RadioButton
|
|
246
|
+
* @public
|
|
247
|
+
*/
|
|
248
|
+
RadioButton.prototype.exit = function() {
|
|
249
|
+
var sGroupName = this.getGroupName(),
|
|
250
|
+
aControlsInGroup = this._groupNames[sGroupName],
|
|
251
|
+
iGroupNameIndex = aControlsInGroup && aControlsInGroup.indexOf(this);
|
|
252
|
+
|
|
253
|
+
this._iTabIndex = null;
|
|
254
|
+
|
|
255
|
+
if (this._oLabel) {
|
|
256
|
+
this._oLabel.destroy();
|
|
257
|
+
this._oLabel = null;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (iGroupNameIndex >= -1) {
|
|
261
|
+
aControlsInGroup.splice(iGroupNameIndex, 1);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
227
265
|
/**
|
|
228
266
|
* Function is called when the radio button is tapped.
|
|
229
267
|
* @param {jQuery.Event} oEvent The event object
|
|
230
268
|
* @private
|
|
231
269
|
*/
|
|
232
270
|
RadioButton.prototype.ontap = function(oEvent) {
|
|
233
|
-
|
|
234
271
|
if (!this.getEnabled() || !this.getEditable()) {
|
|
235
272
|
return;
|
|
236
273
|
}
|
|
@@ -238,7 +275,7 @@ function(
|
|
|
238
275
|
var oParent = this.getParent();
|
|
239
276
|
|
|
240
277
|
// check if the RadioButton is part of a RadioButtonGroup which is disabled/readonly
|
|
241
|
-
if (oParent
|
|
278
|
+
if (oParent && oParent.isA("sap.m.RadioButtonGroup") && (!oParent.getEnabled() || !oParent.getEditable())) {
|
|
242
279
|
return;
|
|
243
280
|
}
|
|
244
281
|
|
|
@@ -258,22 +295,49 @@ function(
|
|
|
258
295
|
}
|
|
259
296
|
};
|
|
260
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Sets RadioButton's groupName. Only one radioButton from the same group can be selected
|
|
300
|
+
* @param {string} sGroupName - Name of the group to which the RadioButton will belong.
|
|
301
|
+
* @returns {this} Reference to the control instance for chaining
|
|
302
|
+
* @public
|
|
303
|
+
*/
|
|
304
|
+
RadioButton.prototype.setGroupName = function(sGroupName) {
|
|
305
|
+
this._updateGroupName(sGroupName, this.getGroupName());
|
|
306
|
+
this.setProperty("groupName", sGroupName);
|
|
307
|
+
return this;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Sets the state of the RadioButton to selected.
|
|
312
|
+
* @param {boolean} bSelected - defines if the radio button is selected
|
|
313
|
+
* @returns {this} Reference to the control instance for chaining
|
|
314
|
+
* @public
|
|
315
|
+
*/
|
|
316
|
+
RadioButton.prototype.setSelected = function(bSelected) {
|
|
317
|
+
this.setProperty("selected", bSelected);
|
|
318
|
+
|
|
319
|
+
if (this.getSelected()) {
|
|
320
|
+
this._iSelectionNumber = getNextSelectionNumber();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return this;
|
|
324
|
+
};
|
|
325
|
+
|
|
261
326
|
/**
|
|
262
327
|
* Function is called when radiobutton is being touched. Only necessary for Android/Blackberry.
|
|
263
328
|
* @param {jQuery.Event} oEvent The event object
|
|
264
329
|
* @private
|
|
265
330
|
*/
|
|
266
|
-
RadioButton.prototype.ontouchstart = function(oEvent) {
|
|
267
|
-
|
|
331
|
+
RadioButton.prototype.ontouchstart = function (oEvent) {
|
|
268
332
|
//for control who need to know if they should handle events from the CheckBox control
|
|
269
|
-
oEvent.
|
|
333
|
+
oEvent.setMarked();
|
|
270
334
|
if (this.getEnabled() && this.getActiveHandling()) {
|
|
271
|
-
this
|
|
335
|
+
this.addStyleClass("sapMRbBTouched");
|
|
272
336
|
}
|
|
273
337
|
};
|
|
274
338
|
|
|
275
|
-
RadioButton.prototype.ontouchend = function(
|
|
276
|
-
this
|
|
339
|
+
RadioButton.prototype.ontouchend = function () {
|
|
340
|
+
this.removeStyleClass("sapMRbBTouched");
|
|
277
341
|
};
|
|
278
342
|
|
|
279
343
|
RadioButton.prototype.onsapnext = function(oEvent) {
|
|
@@ -355,7 +419,7 @@ function(
|
|
|
355
419
|
* @private
|
|
356
420
|
*/
|
|
357
421
|
RadioButton.prototype._keyboardHandler = function(sPosition, bSelect) {
|
|
358
|
-
if (this.getParent()
|
|
422
|
+
if (this.getParent() && this.getParent().isA("sap.m.RadioButtonGroup")) {
|
|
359
423
|
return;
|
|
360
424
|
}
|
|
361
425
|
|
|
@@ -373,20 +437,20 @@ function(
|
|
|
373
437
|
/**
|
|
374
438
|
* @see sap.ui.core.Control#getAccessibilityInfo
|
|
375
439
|
* @protected
|
|
376
|
-
* @returns {
|
|
440
|
+
* @returns {object} The <code>sap.m.RadioButton</code> accessibility information
|
|
377
441
|
*/
|
|
378
442
|
RadioButton.prototype.getAccessibilityInfo = function() {
|
|
379
|
-
var oBundle =
|
|
443
|
+
var oBundle = Core.getLibraryResourceBundle("sap.m");
|
|
380
444
|
return {
|
|
381
445
|
role: "radio",
|
|
382
446
|
type: oBundle.getText("ACC_CTR_TYPE_RADIO"),
|
|
383
|
-
description: (this.getText() || "") + (this.getSelected() ? (" " + oBundle.getText("ACC_CTR_STATE_CHECKED")) : ""),
|
|
447
|
+
description: (this.getText() || "") + (this.getSelected() ? (" " + oBundle.getText("ACC_CTR_STATE_CHECKED")) : (" " + oBundle.getText("ACC_CTR_STATE_NOT_CHECKED"))),
|
|
384
448
|
enabled: this.getEnabled(),
|
|
385
449
|
editable: this.getEditable()
|
|
386
450
|
};
|
|
387
451
|
};
|
|
388
452
|
|
|
389
|
-
|
|
453
|
+
/**
|
|
390
454
|
* RadioButton without label must not be stretched in Form.
|
|
391
455
|
*/
|
|
392
456
|
RadioButton.prototype.getFormDoNotAdjustWidth = function() {
|
|
@@ -397,7 +461,7 @@ function(
|
|
|
397
461
|
* Determines next focusable item
|
|
398
462
|
*
|
|
399
463
|
* @param {enum} sNavigation any item from KH_NAVIGATION
|
|
400
|
-
* @returns {RadioButton}
|
|
464
|
+
* @returns {sap.m.RadioButton} Next focusable radio button
|
|
401
465
|
* @private
|
|
402
466
|
*/
|
|
403
467
|
RadioButton.prototype._getNextFocusItem = function(sNavigation) {
|
|
@@ -441,175 +505,11 @@ function(
|
|
|
441
505
|
this.ontap(oEvent);
|
|
442
506
|
};
|
|
443
507
|
|
|
444
|
-
RadioButton.prototype.setEnabled = function(bEnabled) {
|
|
445
|
-
this.setProperty("enabled", bEnabled, false);
|
|
446
|
-
|
|
447
|
-
return this;
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
508
|
// #############################################################################
|
|
453
|
-
// Overwritten
|
|
509
|
+
// Overwritten & private methods
|
|
454
510
|
// #############################################################################
|
|
455
511
|
|
|
456
512
|
/**
|
|
457
|
-
* Sets the state of the RadioButton to selected.
|
|
458
|
-
* @param {boolean} bSelected - defines if the radio button is selected
|
|
459
|
-
* @returns {sap.m.RadioButton} Reference to the control instance for chaining
|
|
460
|
-
* @public
|
|
461
|
-
*/
|
|
462
|
-
RadioButton.prototype.setSelected = function(bSelected) {
|
|
463
|
-
var oControl,
|
|
464
|
-
bSelectedOld = this.getSelected(),
|
|
465
|
-
sGroupName = this.getGroupName(),
|
|
466
|
-
aControlsInGroup = this._groupNames[sGroupName],
|
|
467
|
-
iLength = aControlsInGroup && aControlsInGroup.length;
|
|
468
|
-
|
|
469
|
-
this.setProperty("selected", bSelected, true); // No re-rendering
|
|
470
|
-
this._changeGroupName(this.getGroupName());
|
|
471
|
-
|
|
472
|
-
if (!!bSelected && sGroupName && sGroupName !== "") { // If this radio button is selected and groupName is set, explicitly deselect the other radio buttons of the same group
|
|
473
|
-
for (var i = 0; i < iLength; i++) {
|
|
474
|
-
oControl = aControlsInGroup[i];
|
|
475
|
-
|
|
476
|
-
if (oControl instanceof RadioButton && oControl !== this && oControl.getSelected()) {
|
|
477
|
-
oControl.fireSelect({ selected: false });
|
|
478
|
-
oControl.setSelected(false);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if ((bSelectedOld !== !!bSelected) && this.getDomRef()) {
|
|
484
|
-
this.$().toggleClass("sapMRbSel", bSelected);
|
|
485
|
-
|
|
486
|
-
if (bSelected) {
|
|
487
|
-
this.getDomRef().setAttribute("aria-checked", "true");
|
|
488
|
-
this.getDomRef("RB").checked = true;
|
|
489
|
-
this.getDomRef("RB").setAttribute("checked", "checked");
|
|
490
|
-
} else {
|
|
491
|
-
this.getDomRef().removeAttribute("aria-checked"); // aria-checked=false is default value and need not be set explicitly
|
|
492
|
-
this.getDomRef("RB").checked = false;
|
|
493
|
-
this.getDomRef("RB").removeAttribute("checked");
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
return this;
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Sets the text for the RadioButton's label.
|
|
502
|
-
* @param {string} sText - The text to be set
|
|
503
|
-
* @returns {sap.m.RadioButton} Reference to the control instance for chaining
|
|
504
|
-
* @public
|
|
505
|
-
*/
|
|
506
|
-
RadioButton.prototype.setText = function(sText) {
|
|
507
|
-
this.setProperty("text", sText, true);
|
|
508
|
-
|
|
509
|
-
if (this._oLabel) {
|
|
510
|
-
this._oLabel.setText(this.getText());
|
|
511
|
-
} else {
|
|
512
|
-
this._createLabel("text", this.getText());
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
this.toggleStyleClass("sapMRbHasLabel", !!sText);
|
|
516
|
-
|
|
517
|
-
return this;
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Depeding on useEntireWidth sets the width to the RadioButton's label or the whole RadioButton
|
|
522
|
-
* @param {boolean} bUserEntireWidth - Determines if the width will be set to the label only or to the whole RadioButton
|
|
523
|
-
* @private
|
|
524
|
-
*/
|
|
525
|
-
RadioButton.prototype._setWidth = function(bUserEntireWidth) {
|
|
526
|
-
if (!bUserEntireWidth) {
|
|
527
|
-
this._setLableWidth();
|
|
528
|
-
} else {
|
|
529
|
-
this._setLableWidth("auto");
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* Sets the width for the RadioButton's label.
|
|
535
|
-
* @param {string} sWidth - CSS size to be set as width
|
|
536
|
-
* @private
|
|
537
|
-
*/
|
|
538
|
-
RadioButton.prototype._setLableWidth = function(sWidth) {
|
|
539
|
-
sWidth = sWidth || this.getWidth();
|
|
540
|
-
|
|
541
|
-
if (this._oLabel) {
|
|
542
|
-
this._oLabel.setWidth(sWidth);
|
|
543
|
-
} else {
|
|
544
|
-
this._createLabel("width", sWidth);
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Sets the text direction for the RadioButton's label.
|
|
550
|
-
* @param {string} sDirection - Text direction to be set to RadioButton's label
|
|
551
|
-
* @returns {sap.m.RadioButton} Reference to the control instance for chaining
|
|
552
|
-
* @public
|
|
553
|
-
*/
|
|
554
|
-
RadioButton.prototype.setTextDirection = function(sDirection) {
|
|
555
|
-
|
|
556
|
-
this.setProperty("textDirection", sDirection, true);
|
|
557
|
-
if (this._oLabel) {
|
|
558
|
-
this._oLabel.setTextDirection(this.getTextDirection());
|
|
559
|
-
} else {
|
|
560
|
-
this._createLabel("textDirection", this.getTextDirection());
|
|
561
|
-
}
|
|
562
|
-
return this;
|
|
563
|
-
};
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* Sets RadioButton's groupName. Only one radioButton from the same group can be selected
|
|
567
|
-
* @param {string} sGroupName - Name of the group to which the RadioButton will belong.
|
|
568
|
-
* @returns {sap.m.RadioButton} Reference to the control instance for chaining
|
|
569
|
-
* @public
|
|
570
|
-
*/
|
|
571
|
-
RadioButton.prototype.setGroupName = function(sGroupName) {
|
|
572
|
-
this._changeGroupName(sGroupName, this.getGroupName());
|
|
573
|
-
return this.setProperty("groupName", sGroupName, true);
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
RadioButton.prototype.onBeforeRendering = function() {
|
|
577
|
-
// Set the width before rendering as both width and useEntireWidth are dependent
|
|
578
|
-
this._setWidth(this.getUseEntireWidth());
|
|
579
|
-
return this._changeGroupName(this.getGroupName());
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Destroys all related objects to the RadioButton
|
|
584
|
-
* @public
|
|
585
|
-
*/
|
|
586
|
-
RadioButton.prototype.exit = function() {
|
|
587
|
-
var sGroupName = this.getGroupName(),
|
|
588
|
-
aControlsInGroup = this._groupNames[sGroupName],
|
|
589
|
-
iGroupNameIndex = aControlsInGroup && aControlsInGroup.indexOf(this);
|
|
590
|
-
|
|
591
|
-
this._iTabIndex = null;
|
|
592
|
-
if (this._oLabel) {
|
|
593
|
-
this._oLabel.destroy();
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
if (iGroupNameIndex >= -1) {
|
|
597
|
-
aControlsInGroup.splice(iGroupNameIndex, 1);
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Creates label and sets a property to it.
|
|
603
|
-
* @param {string} prop - Property to be set to the new label.
|
|
604
|
-
* @param {string} value - Value of the property which will be set.
|
|
605
|
-
* @private
|
|
606
|
-
*/
|
|
607
|
-
RadioButton.prototype._createLabel = function(prop, value) {
|
|
608
|
-
this._oLabel = new Label(this.getId() + "-label").addStyleClass("sapMRbBLabel").setParent(this, null, true);
|
|
609
|
-
this._oLabel.setProperty(prop, value, false);
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
/*
|
|
613
513
|
* Sets the tab index of the control
|
|
614
514
|
*
|
|
615
515
|
* @param {int} iTabIndex - Greater than or equal to -1
|
|
@@ -628,23 +528,6 @@ function(
|
|
|
628
528
|
return this;
|
|
629
529
|
};
|
|
630
530
|
|
|
631
|
-
/*
|
|
632
|
-
* Sets the textAlign to the internal label
|
|
633
|
-
* @param {string} sAlign
|
|
634
|
-
* @return {sap.m.RadioButton}
|
|
635
|
-
* @since 1.28
|
|
636
|
-
* @public
|
|
637
|
-
*/
|
|
638
|
-
RadioButton.prototype.setTextAlign = function(sAlign) {
|
|
639
|
-
this.setProperty("textAlign", sAlign, true);
|
|
640
|
-
if (this._oLabel) {
|
|
641
|
-
this._oLabel.setTextAlign(this.getTextAlign());
|
|
642
|
-
} else {
|
|
643
|
-
this._createLabel("textAlign", this.getTextAlign());
|
|
644
|
-
}
|
|
645
|
-
return this;
|
|
646
|
-
};
|
|
647
|
-
|
|
648
531
|
/**
|
|
649
532
|
* Sets the private valueStateText property. Required, in order to make the MessageMixin work.
|
|
650
533
|
*
|
|
@@ -653,16 +536,48 @@ function(
|
|
|
653
536
|
* @returns {sap.m.RadioButton} Reference to the control instance for chaining.
|
|
654
537
|
*/
|
|
655
538
|
RadioButton.prototype.setValueStateText = function(sText) {
|
|
656
|
-
return this.setProperty("valueStateText", sText
|
|
539
|
+
return this.setProperty("valueStateText", sText);
|
|
657
540
|
};
|
|
658
541
|
|
|
659
542
|
/**
|
|
660
|
-
*
|
|
543
|
+
* Maintains the RadioButton's internal Label's text property.
|
|
544
|
+
* @param {string} sText - The text to be set
|
|
545
|
+
* @public
|
|
546
|
+
*/
|
|
547
|
+
RadioButton.prototype._updateLabelProperties = function () {
|
|
548
|
+
var oLabel = this._getLabel();
|
|
549
|
+
var sText = this.getText();
|
|
550
|
+
var bUseEntireWidth = this.getUseEntireWidth();
|
|
551
|
+
|
|
552
|
+
this.toggleStyleClass("sapMRbHasLabel", !!sText);
|
|
553
|
+
|
|
554
|
+
// Set the width before rendering as both width and useEntireWidth are dependent
|
|
555
|
+
oLabel.setText(sText)
|
|
556
|
+
.setWidth(!bUseEntireWidth ? this.getWidth() : "auto")
|
|
557
|
+
.setTextDirection(this.getTextDirection())
|
|
558
|
+
.setTextAlign(this.getTextAlign());
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Returns the RadioButton's internal Label control.
|
|
563
|
+
* @private
|
|
564
|
+
*/
|
|
565
|
+
RadioButton.prototype._getLabel = function () {
|
|
566
|
+
if (!this._oLabel) {
|
|
567
|
+
this._oLabel = new Label(this.getId() + "-label");
|
|
568
|
+
this._oLabel.addStyleClass("sapMRbBLabel").setParent(this, null, true);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return this._oLabel;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Update the groupname of a RadioButton.
|
|
661
576
|
* @param {string} sNewGroupName - Name of the new group.
|
|
662
577
|
* @param {string} sOldGroupName - Name of the old group.
|
|
663
578
|
* @private
|
|
664
579
|
*/
|
|
665
|
-
RadioButton.prototype.
|
|
580
|
+
RadioButton.prototype._updateGroupName = function (sNewGroupName, sOldGroupName) {
|
|
666
581
|
var aNewGroup = this._groupNames[sNewGroupName],
|
|
667
582
|
aOldGroup = this._groupNames[sOldGroupName];
|
|
668
583
|
|
|
@@ -679,6 +594,28 @@ function(
|
|
|
679
594
|
}
|
|
680
595
|
};
|
|
681
596
|
|
|
597
|
+
RadioButton.prototype._isLastSelectedInGroup = function (sGroupName) {
|
|
598
|
+
var aControlsInGroup = this._groupNames[sGroupName];
|
|
599
|
+
|
|
600
|
+
return aControlsInGroup.every(function (aButton) {
|
|
601
|
+
return aButton._iSelectionNumber <= this._iSelectionNumber;
|
|
602
|
+
}.bind(this));
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
RadioButton.prototype._deselectOthersInGroup = function (sGroupName) {
|
|
606
|
+
var aControlsInGroup = this._groupNames[sGroupName],
|
|
607
|
+
iLength = aControlsInGroup && aControlsInGroup.length;
|
|
608
|
+
|
|
609
|
+
for (var i = 0; i < iLength; i++) {
|
|
610
|
+
var oControl = aControlsInGroup[i];
|
|
611
|
+
|
|
612
|
+
if (oControl instanceof RadioButton && oControl !== this && oControl.getSelected()) {
|
|
613
|
+
oControl.fireSelect({ selected: false });
|
|
614
|
+
oControl.setSelected(false);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
|
|
682
619
|
// Private properties setter generation
|
|
683
620
|
["editableParent"].forEach(function(privatePropName) {
|
|
684
621
|
RadioButton.prototype["_set" + capitalize(privatePropName)] = function (vValue) {
|
|
@@ -688,5 +625,4 @@ function(
|
|
|
688
625
|
});
|
|
689
626
|
|
|
690
627
|
return RadioButton;
|
|
691
|
-
|
|
692
|
-
});
|
|
628
|
+
});
|