@openui5/sap.m 1.103.0 → 1.105.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. package/.eslintrc.json +2 -3
  2. package/.reuse/dep5 +18 -1
  3. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
  4. package/THIRDPARTY.txt +36 -3
  5. package/package.json +4 -4
  6. package/src/sap/m/.library +1 -1
  7. package/src/sap/m/AccButton.js +1 -1
  8. package/src/sap/m/ActionListItem.js +1 -1
  9. package/src/sap/m/ActionSelect.js +1 -1
  10. package/src/sap/m/ActionSheet.js +1 -1
  11. package/src/sap/m/App.js +2 -3
  12. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  13. package/src/sap/m/Avatar.js +2 -2
  14. package/src/sap/m/BadgeEnabler.js +1 -2
  15. package/src/sap/m/Bar.js +11 -10
  16. package/src/sap/m/Breadcrumbs.js +2 -2
  17. package/src/sap/m/BusyDialog.js +1 -1
  18. package/src/sap/m/BusyIndicator.js +1 -1
  19. package/src/sap/m/Button.js +49 -10
  20. package/src/sap/m/ButtonRenderer.js +10 -2
  21. package/src/sap/m/Carousel.js +3 -4
  22. package/src/sap/m/CarouselLayout.js +1 -1
  23. package/src/sap/m/CheckBox.js +46 -6
  24. package/src/sap/m/CheckBoxRenderer.js +1 -0
  25. package/src/sap/m/ColorPalette.js +1 -1
  26. package/src/sap/m/ColorPalettePopover.js +1 -1
  27. package/src/sap/m/Column.js +1 -1
  28. package/src/sap/m/ColumnHeaderPopover.js +5 -7
  29. package/src/sap/m/ColumnListItem.js +1 -4
  30. package/src/sap/m/ColumnListItemRenderer.js +1 -2
  31. package/src/sap/m/ColumnPopoverActionItem.js +3 -3
  32. package/src/sap/m/ColumnPopoverCustomItem.js +3 -3
  33. package/src/sap/m/ColumnPopoverItem.js +3 -3
  34. package/src/sap/m/ColumnPopoverSelectListItem.js +3 -5
  35. package/src/sap/m/ColumnPopoverSortItem.js +3 -3
  36. package/src/sap/m/ComboBox.js +6 -5
  37. package/src/sap/m/ComboBoxBase.js +1 -5
  38. package/src/sap/m/ComboBoxBaseRenderer.js +2 -2
  39. package/src/sap/m/ComboBoxTextField.js +1 -7
  40. package/src/sap/m/ComboBoxTextFieldRenderer.js +19 -4
  41. package/src/sap/m/CustomDynamicDateOption.js +1 -1
  42. package/src/sap/m/CustomListItem.js +1 -1
  43. package/src/sap/m/CustomTile.js +1 -1
  44. package/src/sap/m/CustomTreeItem.js +3 -3
  45. package/src/sap/m/CustomTreeItemRenderer.js +2 -2
  46. package/src/sap/m/DatePicker.js +14 -24
  47. package/src/sap/m/DateRangeSelection.js +45 -38
  48. package/src/sap/m/DateTimeField.js +87 -20
  49. package/src/sap/m/DateTimeInput.js +1 -1
  50. package/src/sap/m/DateTimePicker.js +52 -28
  51. package/src/sap/m/Dialog.js +38 -1
  52. package/src/sap/m/DisplayListItem.js +1 -1
  53. package/src/sap/m/DraftIndicator.js +1 -1
  54. package/src/sap/m/DynamicDate.js +1 -1
  55. package/src/sap/m/DynamicDateFormat.js +2 -5
  56. package/src/sap/m/DynamicDateOption.js +43 -16
  57. package/src/sap/m/DynamicDateRange.js +49 -7
  58. package/src/sap/m/DynamicDateRangeRenderer.js +5 -2
  59. package/src/sap/m/DynamicDateUtil.js +23 -2
  60. package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
  61. package/src/sap/m/ExpandableText.js +1 -1
  62. package/src/sap/m/FacetFilter.js +2 -2
  63. package/src/sap/m/FacetFilterItem.js +1 -1
  64. package/src/sap/m/FacetFilterList.js +4 -4
  65. package/src/sap/m/FeedContent.js +1 -1
  66. package/src/sap/m/FeedInput.js +1 -1
  67. package/src/sap/m/FeedListItem.js +1 -1
  68. package/src/sap/m/FeedListItemAction.js +1 -1
  69. package/src/sap/m/Fiori20Adapter.js +2 -2
  70. package/src/sap/m/FlexBox.js +1 -1
  71. package/src/sap/m/FlexItemData.js +1 -1
  72. package/src/sap/m/FormattedText.js +1 -1
  73. package/src/sap/m/GenericTag.js +1 -1
  74. package/src/sap/m/GenericTile.js +67 -16
  75. package/src/sap/m/GenericTileLineModeRenderer.js +4 -4
  76. package/src/sap/m/GenericTileRenderer.js +16 -4
  77. package/src/sap/m/GroupHeaderListItem.js +1 -1
  78. package/src/sap/m/GrowingEnablement.js +37 -11
  79. package/src/sap/m/GrowingList.js +1 -1
  80. package/src/sap/m/HBox.js +1 -1
  81. package/src/sap/m/HeaderContainer.js +3 -3
  82. package/src/sap/m/HeaderContainerItemNavigator.js +3 -6
  83. package/src/sap/m/IconTabBar.js +54 -22
  84. package/src/sap/m/IconTabBarSelectList.js +1 -1
  85. package/src/sap/m/IconTabFilter.js +1 -1
  86. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  87. package/src/sap/m/IconTabHeader.js +5 -1
  88. package/src/sap/m/IconTabSeparator.js +1 -1
  89. package/src/sap/m/IllustratedMessage.js +64 -25
  90. package/src/sap/m/IllustratedMessageRenderer.js +10 -6
  91. package/src/sap/m/Illustration.js +1 -1
  92. package/src/sap/m/IllustrationPool.js +1 -0
  93. package/src/sap/m/IllustrationRenderer.js +1 -1
  94. package/src/sap/m/Image.js +2 -2
  95. package/src/sap/m/ImageContent.js +1 -1
  96. package/src/sap/m/Input.js +51 -7
  97. package/src/sap/m/InputBase.js +1 -1
  98. package/src/sap/m/InputBaseRenderer.js +2 -2
  99. package/src/sap/m/InputListItem.js +1 -1
  100. package/src/sap/m/InputRenderer.js +4 -0
  101. package/src/sap/m/Label.js +34 -4
  102. package/src/sap/m/LabelRenderer.js +7 -2
  103. package/src/sap/m/LightBox.js +1 -1
  104. package/src/sap/m/LightBoxItem.js +1 -1
  105. package/src/sap/m/Link.js +95 -10
  106. package/src/sap/m/LinkRenderer.js +26 -12
  107. package/src/sap/m/List.js +38 -1
  108. package/src/sap/m/ListBase.js +104 -40
  109. package/src/sap/m/ListBaseRenderer.js +7 -15
  110. package/src/sap/m/ListItemBase.js +40 -11
  111. package/src/sap/m/ListItemBaseRenderer.js +17 -6
  112. package/src/sap/m/ListRenderer.js +2 -2
  113. package/src/sap/m/MaskEnabler.js +52 -2
  114. package/src/sap/m/MaskInput.js +23 -1
  115. package/src/sap/m/MaskInputRule.js +1 -1
  116. package/src/sap/m/Menu.js +1 -1
  117. package/src/sap/m/MenuButton.js +1 -1
  118. package/src/sap/m/MenuItem.js +1 -1
  119. package/src/sap/m/MenuListItem.js +1 -1
  120. package/src/sap/m/MessageBox.js +1 -1
  121. package/src/sap/m/MessageItem.js +3 -4
  122. package/src/sap/m/MessageListItem.js +8 -4
  123. package/src/sap/m/MessagePage.js +1 -1
  124. package/src/sap/m/MessagePopover.js +4 -1
  125. package/src/sap/m/MessagePopoverItem.js +1 -1
  126. package/src/sap/m/MessageStrip.js +1 -1
  127. package/src/sap/m/MessageToast.js +1 -1
  128. package/src/sap/m/MessageView.js +1 -1
  129. package/src/sap/m/MultiComboBox.js +5 -16
  130. package/src/sap/m/MultiEditField.js +1 -1
  131. package/src/sap/m/MultiInput.js +1 -15
  132. package/src/sap/m/NavContainer.js +21 -19
  133. package/src/sap/m/NewsContent.js +2 -3
  134. package/src/sap/m/NotificationList.js +1 -1
  135. package/src/sap/m/NotificationListBase.js +1 -1
  136. package/src/sap/m/NotificationListGroup.js +3 -7
  137. package/src/sap/m/NotificationListGroupRenderer.js +1 -1
  138. package/src/sap/m/NotificationListItem.js +1 -1
  139. package/src/sap/m/NumericContent.js +1 -1
  140. package/src/sap/m/NumericInput.js +1 -1
  141. package/src/sap/m/ObjectAttribute.js +1 -1
  142. package/src/sap/m/ObjectHeader.js +3 -3
  143. package/src/sap/m/ObjectIdentifier.js +3 -3
  144. package/src/sap/m/ObjectListItem.js +7 -1
  145. package/src/sap/m/ObjectMarker.js +1 -1
  146. package/src/sap/m/ObjectNumber.js +2 -3
  147. package/src/sap/m/ObjectNumberRenderer.js +10 -3
  148. package/src/sap/m/ObjectStatus.js +2 -3
  149. package/src/sap/m/ObjectStatusRenderer.js +2 -2
  150. package/src/sap/m/OverflowToolbar.js +3 -8
  151. package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
  152. package/src/sap/m/OverflowToolbarAssociativePopoverControls.js +3 -3
  153. package/src/sap/m/OverflowToolbarAssociativePopoverRenderer.js +2 -2
  154. package/src/sap/m/OverflowToolbarButton.js +1 -1
  155. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  156. package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
  157. package/src/sap/m/P13nAnyFilterItem.js +3 -3
  158. package/src/sap/m/P13nColumnsItem.js +3 -3
  159. package/src/sap/m/P13nColumnsPanel.js +3 -3
  160. package/src/sap/m/P13nConditionPanel.js +10 -3
  161. package/src/sap/m/P13nDialog.js +3 -3
  162. package/src/sap/m/P13nDimMeasureItem.js +3 -3
  163. package/src/sap/m/P13nDimMeasurePanel.js +3 -3
  164. package/src/sap/m/P13nFilterItem.js +3 -3
  165. package/src/sap/m/P13nFilterPanel.js +3 -3
  166. package/src/sap/m/P13nGroupItem.js +3 -3
  167. package/src/sap/m/P13nGroupPanel.js +3 -3
  168. package/src/sap/m/P13nItem.js +3 -3
  169. package/src/sap/m/P13nOperationsHelper.js +2 -2
  170. package/src/sap/m/P13nPanel.js +3 -3
  171. package/src/sap/m/P13nSelectionItem.js +3 -3
  172. package/src/sap/m/P13nSelectionPanel.js +3 -3
  173. package/src/sap/m/P13nSortItem.js +3 -3
  174. package/src/sap/m/P13nSortPanel.js +3 -3
  175. package/src/sap/m/PDFViewer.js +2 -2
  176. package/src/sap/m/PDFViewerRenderer.js +1 -0
  177. package/src/sap/m/Page.js +1 -3
  178. package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
  179. package/src/sap/m/PagingButton.js +1 -1
  180. package/src/sap/m/Panel.js +1 -1
  181. package/src/sap/m/PlanningCalendar.js +4 -16
  182. package/src/sap/m/PlanningCalendarHeader.js +1 -5
  183. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  184. package/src/sap/m/PlanningCalendarRow.js +1 -1
  185. package/src/sap/m/PlanningCalendarView.js +1 -1
  186. package/src/sap/m/Popover.js +11 -4
  187. package/src/sap/m/ProgressIndicator.js +1 -1
  188. package/src/sap/m/ProgressIndicatorRenderer.js +6 -3
  189. package/src/sap/m/PullToRefresh.js +1 -1
  190. package/src/sap/m/QuickView.js +3 -3
  191. package/src/sap/m/QuickViewBase.js +3 -3
  192. package/src/sap/m/QuickViewCard.js +3 -3
  193. package/src/sap/m/QuickViewGroup.js +1 -1
  194. package/src/sap/m/QuickViewGroupElement.js +3 -3
  195. package/src/sap/m/QuickViewPage.js +3 -3
  196. package/src/sap/m/RadioButton.js +47 -20
  197. package/src/sap/m/RadioButtonGroup.js +29 -19
  198. package/src/sap/m/RangeSlider.js +1 -3
  199. package/src/sap/m/RatingIndicator.js +8 -1
  200. package/src/sap/m/RatingIndicatorRenderer.js +13 -4
  201. package/src/sap/m/ResponsivePopover.js +3 -3
  202. package/src/sap/m/ResponsiveScale.js +1 -1
  203. package/src/sap/m/ScrollBar.js +1 -1
  204. package/src/sap/m/ScrollContainer.js +1 -1
  205. package/src/sap/m/SearchField.js +1 -1
  206. package/src/sap/m/SegmentedButton.js +1 -1
  207. package/src/sap/m/SegmentedButtonItem.js +1 -1
  208. package/src/sap/m/Select.js +7 -13
  209. package/src/sap/m/SelectDialog.js +2 -1
  210. package/src/sap/m/SelectDialogBase.js +1 -1
  211. package/src/sap/m/SelectList.js +1 -1
  212. package/src/sap/m/SelectListRenderer.js +2 -2
  213. package/src/sap/m/SelectionDetails.js +2 -2
  214. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  215. package/src/sap/m/SelectionDetailsItem.js +1 -1
  216. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  217. package/src/sap/m/Shell.js +1 -1
  218. package/src/sap/m/SimpleFixFlex.js +1 -1
  219. package/src/sap/m/SinglePlanningCalendar.js +5 -7
  220. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  221. package/src/sap/m/SinglePlanningCalendarGrid.js +1 -7
  222. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
  223. package/src/sap/m/SinglePlanningCalendarMonthGridRenderer.js +0 -2
  224. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  225. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  226. package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
  227. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  228. package/src/sap/m/SlideTile.js +30 -5
  229. package/src/sap/m/Slider.js +1 -1
  230. package/src/sap/m/SliderTooltip.js +1 -3
  231. package/src/sap/m/SliderTooltipBase.js +1 -1
  232. package/src/sap/m/SliderTooltipBaseRenderer.js +2 -2
  233. package/src/sap/m/SliderTooltipContainer.js +1 -1
  234. package/src/sap/m/SliderTooltipContainerRenderer.js +2 -2
  235. package/src/sap/m/SliderTooltipRenderer.js +2 -2
  236. package/src/sap/m/SplitApp.js +1 -1
  237. package/src/sap/m/SplitButton.js +1 -3
  238. package/src/sap/m/SplitContainer.js +1 -5
  239. package/src/sap/m/StandardDynamicDateOption.js +9 -15
  240. package/src/sap/m/StandardListItem.js +1 -1
  241. package/src/sap/m/StandardListItemRenderer.js +2 -2
  242. package/src/sap/m/StandardTile.js +1 -1
  243. package/src/sap/m/StandardTreeItem.js +1 -1
  244. package/src/sap/m/StepInput.js +1 -1
  245. package/src/sap/m/SuggestionItem.js +1 -1
  246. package/src/sap/m/SuggestionsPopover.js +4 -2
  247. package/src/sap/m/Switch.js +1 -1
  248. package/src/sap/m/TabContainer.js +1 -1
  249. package/src/sap/m/TabContainerItem.js +1 -1
  250. package/src/sap/m/TabStrip.js +1 -1
  251. package/src/sap/m/TabStripItem.js +1 -1
  252. package/src/sap/m/Table.js +11 -9
  253. package/src/sap/m/TablePersoController.js +1 -1
  254. package/src/sap/m/TablePersoDialog.js +6 -15
  255. package/src/sap/m/TablePersoProvider.js +1 -1
  256. package/src/sap/m/TableRenderer.js +2 -9
  257. package/src/sap/m/TableSelectDialog.js +1 -1
  258. package/src/sap/m/Text.js +1 -1
  259. package/src/sap/m/TextArea.js +1 -1
  260. package/src/sap/m/TextAreaRenderer.js +1 -2
  261. package/src/sap/m/Tile.js +1 -1
  262. package/src/sap/m/TileContainer.js +1 -1
  263. package/src/sap/m/TileContent.js +8 -9
  264. package/src/sap/m/TileContentRenderer.js +3 -3
  265. package/src/sap/m/TimePicker.js +43 -6
  266. package/src/sap/m/TimePickerClock.js +2 -3
  267. package/src/sap/m/TimePickerClocks.js +5 -3
  268. package/src/sap/m/TimePickerClocksRenderer.js +1 -1
  269. package/src/sap/m/TimePickerInputs.js +1 -1
  270. package/src/sap/m/TimePickerInputsRenderer.js +1 -1
  271. package/src/sap/m/TimePickerInternals.js +1 -1
  272. package/src/sap/m/TimePickerSlider.js +1 -1
  273. package/src/sap/m/TimePickerSliders.js +3 -5
  274. package/src/sap/m/Title.js +1 -1
  275. package/src/sap/m/TitlePropagationSupport.js +1 -1
  276. package/src/sap/m/ToggleButton.js +2 -2
  277. package/src/sap/m/Token.js +1 -3
  278. package/src/sap/m/Tokenizer.js +1 -1
  279. package/src/sap/m/Toolbar.js +1 -1
  280. package/src/sap/m/ToolbarLayoutData.js +1 -1
  281. package/src/sap/m/ToolbarSeparator.js +1 -1
  282. package/src/sap/m/ToolbarSpacer.js +1 -1
  283. package/src/sap/m/Tree.js +8 -1
  284. package/src/sap/m/TreeItemBase.js +1 -1
  285. package/src/sap/m/TreeRenderer.js +0 -10
  286. package/src/sap/m/UploadCollection.js +2 -2
  287. package/src/sap/m/UploadCollectionItem.js +1 -1
  288. package/src/sap/m/UploadCollectionParameter.js +1 -1
  289. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
  290. package/src/sap/m/VBox.js +1 -1
  291. package/src/sap/m/ValueStateHeader.js +1 -1
  292. package/src/sap/m/VariantItem.js +160 -0
  293. package/src/sap/m/VariantManagement.js +665 -570
  294. package/src/sap/m/ViewSettingsCustomItem.js +1 -1
  295. package/src/sap/m/ViewSettingsCustomTab.js +1 -1
  296. package/src/sap/m/ViewSettingsDialog.js +1 -1
  297. package/src/sap/m/ViewSettingsFilterItem.js +1 -1
  298. package/src/sap/m/ViewSettingsItem.js +1 -1
  299. package/src/sap/m/VisibleItem.js +1 -1
  300. package/src/sap/m/WheelSlider.js +1 -1
  301. package/src/sap/m/WheelSliderContainer.js +1 -1
  302. package/src/sap/m/Wizard.js +1 -3
  303. package/src/sap/m/WizardProgressNavigator.js +1 -1
  304. package/src/sap/m/WizardStep.js +1 -1
  305. package/src/sap/m/changeHandler/AddTableColumn.js +12 -13
  306. package/src/sap/m/changeHandler/ChangeLinkTarget.js +2 -3
  307. package/src/sap/m/changeHandler/CombineButtons.js +19 -22
  308. package/src/sap/m/changeHandler/MoveTableColumns.js +6 -6
  309. package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +5 -5
  310. package/src/sap/m/changeHandler/SplitMenuButton.js +7 -6
  311. package/src/sap/m/delegate/DateNavigation.js +0 -4
  312. package/src/sap/m/designtime/Link.designtime.js +19 -11
  313. package/src/sap/m/designtime/VariantManagement.designtime.js +36 -26
  314. package/src/sap/m/flexibility/EngineFlex.js +48 -0
  315. package/src/sap/m/inputUtils/selectionRange.js +1 -2
  316. package/src/sap/m/library.js +30 -6
  317. package/src/sap/m/messagebundle.properties +30 -3
  318. package/src/sap/m/messagebundle_ar.properties +26 -8
  319. package/src/sap/m/messagebundle_bg.properties +20 -2
  320. package/src/sap/m/messagebundle_ca.properties +19 -1
  321. package/src/sap/m/messagebundle_cs.properties +20 -2
  322. package/src/sap/m/messagebundle_cy.properties +21 -3
  323. package/src/sap/m/messagebundle_da.properties +19 -1
  324. package/src/sap/m/messagebundle_de.properties +19 -1
  325. package/src/sap/m/messagebundle_el.properties +22 -4
  326. package/src/sap/m/messagebundle_en.properties +21 -3
  327. package/src/sap/m/messagebundle_en_GB.properties +21 -3
  328. package/src/sap/m/messagebundle_en_US_sappsd.properties +20 -2
  329. package/src/sap/m/messagebundle_en_US_saprigi.properties +18 -2
  330. package/src/sap/m/messagebundle_en_US_saptrc.properties +20 -2
  331. package/src/sap/m/messagebundle_es.properties +20 -2
  332. package/src/sap/m/messagebundle_es_MX.properties +19 -1
  333. package/src/sap/m/messagebundle_et.properties +19 -1
  334. package/src/sap/m/messagebundle_fi.properties +23 -5
  335. package/src/sap/m/messagebundle_fr.properties +20 -2
  336. package/src/sap/m/messagebundle_fr_CA.properties +21 -3
  337. package/src/sap/m/messagebundle_hi.properties +21 -3
  338. package/src/sap/m/messagebundle_hr.properties +23 -5
  339. package/src/sap/m/messagebundle_hu.properties +21 -3
  340. package/src/sap/m/messagebundle_id.properties +21 -3
  341. package/src/sap/m/messagebundle_it.properties +20 -2
  342. package/src/sap/m/messagebundle_iw.properties +21 -3
  343. package/src/sap/m/messagebundle_ja.properties +20 -2
  344. package/src/sap/m/messagebundle_kk.properties +19 -1
  345. package/src/sap/m/messagebundle_ko.properties +27 -9
  346. package/src/sap/m/messagebundle_lt.properties +19 -1
  347. package/src/sap/m/messagebundle_lv.properties +19 -1
  348. package/src/sap/m/messagebundle_ms.properties +20 -2
  349. package/src/sap/m/messagebundle_nl.properties +33 -15
  350. package/src/sap/m/messagebundle_no.properties +21 -3
  351. package/src/sap/m/messagebundle_pl.properties +20 -2
  352. package/src/sap/m/messagebundle_pt.properties +24 -6
  353. package/src/sap/m/messagebundle_pt_PT.properties +19 -1
  354. package/src/sap/m/messagebundle_ro.properties +20 -2
  355. package/src/sap/m/messagebundle_ru.properties +20 -2
  356. package/src/sap/m/messagebundle_sh.properties +20 -2
  357. package/src/sap/m/messagebundle_sk.properties +19 -1
  358. package/src/sap/m/messagebundle_sl.properties +20 -2
  359. package/src/sap/m/messagebundle_sv.properties +19 -1
  360. package/src/sap/m/messagebundle_th.properties +52 -34
  361. package/src/sap/m/messagebundle_tr.properties +23 -5
  362. package/src/sap/m/messagebundle_uk.properties +20 -2
  363. package/src/sap/m/messagebundle_vi.properties +20 -2
  364. package/src/sap/m/messagebundle_zh_CN.properties +20 -2
  365. package/src/sap/m/messagebundle_zh_TW.properties +19 -1
  366. package/src/sap/m/p13n/AbstractContainer.js +7 -7
  367. package/src/sap/m/p13n/AbstractContainerItem.js +4 -4
  368. package/src/sap/m/p13n/BasePanel.js +8 -7
  369. package/src/sap/m/p13n/Container.js +3 -3
  370. package/src/sap/m/p13n/Engine.js +1254 -0
  371. package/src/sap/m/p13n/FlexUtil.js +161 -0
  372. package/src/sap/m/p13n/GroupController.js +145 -0
  373. package/src/sap/m/p13n/GroupPanel.js +12 -5
  374. package/src/sap/m/p13n/MetadataHelper.js +35 -0
  375. package/src/sap/m/p13n/PersistenceProvider.js +160 -0
  376. package/src/sap/m/p13n/Popup.js +49 -12
  377. package/src/sap/m/p13n/QueryPanel.js +3 -3
  378. package/src/sap/m/p13n/SelectionController.js +548 -0
  379. package/src/sap/m/p13n/SelectionPanel.js +15 -3
  380. package/src/sap/m/p13n/SortController.js +153 -0
  381. package/src/sap/m/p13n/SortPanel.js +13 -3
  382. package/src/sap/m/p13n/enum/PersistenceMode.js +43 -0
  383. package/src/sap/m/p13n/handler/xConfigHandler.js +166 -0
  384. package/src/sap/m/p13n/modification/FlexModificationHandler.js +90 -0
  385. package/src/sap/m/p13n/modification/LocalStorageModificationHandler.js +75 -0
  386. package/src/sap/m/p13n/modification/ModificationHandler.js +143 -0
  387. package/src/sap/m/p13n/modules/AdaptationProvider.js +67 -0
  388. package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +147 -0
  389. package/src/sap/m/p13n/modules/StateHandlerRegistry.js +101 -0
  390. package/src/sap/m/p13n/modules/UIManager.js +230 -0
  391. package/src/sap/m/p13n/modules/xConfigAPI.js +288 -0
  392. package/src/sap/m/plugins/CellSelector.js +741 -0
  393. package/src/sap/m/plugins/ColumnResizer.js +15 -1
  394. package/src/sap/m/plugins/DataStateIndicator.js +2 -2
  395. package/src/sap/m/plugins/PasteProvider.js +1 -1
  396. package/src/sap/m/plugins/PluginBase.js +4 -3
  397. package/src/sap/m/semantic/AddAction.js +1 -1
  398. package/src/sap/m/semantic/CancelAction.js +1 -1
  399. package/src/sap/m/semantic/DeleteAction.js +1 -1
  400. package/src/sap/m/semantic/DetailPage.js +1 -1
  401. package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
  402. package/src/sap/m/semantic/EditAction.js +1 -1
  403. package/src/sap/m/semantic/FavoriteAction.js +1 -1
  404. package/src/sap/m/semantic/FilterAction.js +1 -1
  405. package/src/sap/m/semantic/FilterSelect.js +1 -1
  406. package/src/sap/m/semantic/FlagAction.js +1 -1
  407. package/src/sap/m/semantic/ForwardAction.js +1 -1
  408. package/src/sap/m/semantic/FullscreenPage.js +1 -1
  409. package/src/sap/m/semantic/GroupAction.js +1 -1
  410. package/src/sap/m/semantic/GroupSelect.js +1 -1
  411. package/src/sap/m/semantic/MainAction.js +1 -1
  412. package/src/sap/m/semantic/MasterPage.js +1 -1
  413. package/src/sap/m/semantic/MessagesIndicator.js +1 -1
  414. package/src/sap/m/semantic/MultiSelectAction.js +1 -1
  415. package/src/sap/m/semantic/NegativeAction.js +1 -1
  416. package/src/sap/m/semantic/OpenInAction.js +1 -1
  417. package/src/sap/m/semantic/PositiveAction.js +1 -1
  418. package/src/sap/m/semantic/PrintAction.js +1 -1
  419. package/src/sap/m/semantic/SaveAction.js +1 -1
  420. package/src/sap/m/semantic/Segment.js +1 -1
  421. package/src/sap/m/semantic/SegmentedContainer.js +1 -1
  422. package/src/sap/m/semantic/SemanticButton.js +1 -1
  423. package/src/sap/m/semantic/SemanticConfiguration.js +3 -4
  424. package/src/sap/m/semantic/SemanticControl.js +1 -1
  425. package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
  426. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
  427. package/src/sap/m/semantic/SemanticPage.js +1 -1
  428. package/src/sap/m/semantic/SemanticSelect.js +1 -1
  429. package/src/sap/m/semantic/SemanticToggleButton.js +1 -3
  430. package/src/sap/m/semantic/SendEmailAction.js +1 -1
  431. package/src/sap/m/semantic/SendMessageAction.js +1 -1
  432. package/src/sap/m/semantic/ShareInJamAction.js +1 -1
  433. package/src/sap/m/semantic/ShareMenu.js +1 -1
  434. package/src/sap/m/semantic/ShareMenuPage.js +1 -1
  435. package/src/sap/m/semantic/SortAction.js +1 -1
  436. package/src/sap/m/semantic/SortSelect.js +1 -1
  437. package/src/sap/m/table/Util.js +14 -7
  438. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  439. package/src/sap/m/table/columnmenu/Entry.js +1 -1
  440. package/src/sap/m/table/columnmenu/Item.js +1 -1
  441. package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
  442. package/src/sap/m/table/columnmenu/Menu.js +8 -2
  443. package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
  444. package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
  445. package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
  446. package/src/sap/m/table/columnmenu/QuickGroup.js +21 -3
  447. package/src/sap/m/table/columnmenu/QuickGroupItem.js +13 -1
  448. package/src/sap/m/table/columnmenu/QuickSort.js +1 -3
  449. package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -3
  450. package/src/sap/m/table/columnmenu/QuickTotal.js +21 -3
  451. package/src/sap/m/table/columnmenu/QuickTotalItem.js +13 -1
  452. package/src/sap/m/themes/base/Breadcrumbs.less +6 -0
  453. package/src/sap/m/themes/base/Button.less +0 -1
  454. package/src/sap/m/themes/base/CellSelector.less +9 -0
  455. package/src/sap/m/themes/base/CheckBox.less +1 -0
  456. package/src/sap/m/themes/base/Dialog.less +1 -0
  457. package/src/sap/m/themes/base/DynamicDateRange.less +4 -0
  458. package/src/sap/m/themes/base/FeedContent.less +13 -5
  459. package/src/sap/m/themes/base/GenericTile.less +49 -9
  460. package/src/sap/m/themes/base/IllustratedMessage.less +7 -0
  461. package/src/sap/m/themes/base/NewsContent.less +6 -0
  462. package/src/sap/m/themes/base/NumericContent.less +1 -1
  463. package/src/sap/m/themes/base/ObjectStatus.less +2 -1
  464. package/src/sap/m/themes/base/OverflowToolbarAssociativePopover.less +5 -1
  465. package/src/sap/m/themes/base/SelectList.less +0 -5
  466. package/src/sap/m/themes/base/SinglePlanningCalendarGrid.less +7 -0
  467. package/src/sap/m/themes/base/SlideTile.less +35 -4
  468. package/src/sap/m/themes/base/Table.less +11 -2
  469. package/src/sap/m/themes/base/TileContent.less +17 -0
  470. package/src/sap/m/themes/base/library.source.less +1 -0
  471. package/src/sap/m/upload/UploadSet.js +110 -21
  472. package/src/sap/m/upload/UploadSetItem.js +18 -7
  473. package/src/sap/m/upload/UploadSetRenderer.js +8 -16
  474. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
  475. package/src/sap/m/upload/Uploader.js +1 -2
@@ -0,0 +1,741 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ sap.ui.define([
7
+ "./PluginBase",
8
+ "sap/ui/events/KeyCodes",
9
+ "sap/ui/core/Core",
10
+ "sap/ui/thirdparty/jquery",
11
+ "sap/base/Log"
12
+ ], function (PluginBase, KeyCodes, Core, jQuery, Log) {
13
+ "use strict";
14
+
15
+ var SELECTION_DIRECTION = {
16
+ NEXT: 1,
17
+ PREVIOUS: 2
18
+ };
19
+
20
+ var CSS_CLASS = "sapMPluginsCellSelector";
21
+
22
+ /**
23
+ * Constructor for a new CellSelector plugin.
24
+ *
25
+ * @param {string} [sId] id for the new control, generated automatically if no id is given
26
+ * @param {object} [mSettings] initial settings for the new control
27
+ *
28
+ * The CellSelector plugins enables cell selection inside the table, when added as a dependent to the control.
29
+ * It allows the user to individually select a cell block.
30
+ *
31
+ * Keyboard Usage:
32
+ * - SPACE: Select the currently focused cell.
33
+ * - SHIFT + ARROW_KEYS: Expands/shrink the current cell selection block into the specified direction by one row/column.
34
+ * - SHIFT + SPACE: Enahnces the current cell selection block to cover the whole row.
35
+ * - CTRL + SPACE: Enhances the current cell selection block to cover the whole column.
36
+ * - SHIFT + HOME: Enhances the current cell selection block to the begin of the covered rows.
37
+ * - SHIFT + END: Enhances the current cell selection block to the end of the covered rows.
38
+ * - CTRL + SHIFT + A: Clears the selection.
39
+ *
40
+ * @extends sap.m.plugins.PluginBase
41
+ * @class
42
+ * @version 1.105.0
43
+ * @author SAP SE
44
+ *
45
+ * @private
46
+ * @alias sap.m.plugins.CellSelector
47
+ */
48
+ var CellSelector = PluginBase.extend("sap.m.plugins.CellSelector", {
49
+ metadata: {
50
+ library: "sap.m",
51
+ properties: {},
52
+ events: {}
53
+ }
54
+ });
55
+
56
+ CellSelector.prototype.onActivate = function (oControl) {
57
+ oControl.addDelegate(this, true, this);
58
+ this._oSession = {};
59
+ this._oSession.oCanvas = {};
60
+
61
+ var sScrollEvent = this.getConfig("scrollEvent");
62
+ sScrollEvent && oControl.attachEvent(sScrollEvent, this._handleScroll, this);
63
+ };
64
+
65
+ CellSelector.prototype.onDeactivate = function (oControl) {
66
+ oControl.removeDelegate(this, this);
67
+ this._oSession = {};
68
+ this._oSession.oCanvas = {};
69
+
70
+ var sScrollEvent = this.getConfig("scrollEvent");
71
+ sScrollEvent && oControl.detachEvent(sScrollEvent, this._handleScroll, this);
72
+ };
73
+
74
+ /**
75
+ * Retrieve the cells for the current selection.
76
+ *
77
+ * Note: This method is subject to change.
78
+ * @returns {Object} contains the selected cells in each selected row
79
+ * @private
80
+ * @experimental Since 1.104
81
+ */
82
+ CellSelector.prototype.getSelectedCells = function () {
83
+ if (!this._bSelecting) {
84
+ return {};
85
+ }
86
+ var oNormalizedBounds = getNormalizedBounds(this._oSession.mSource, this._oSession.mTarget);
87
+
88
+ var oSelection = {};
89
+ for (var iRow = oNormalizedBounds.from.rowIndex; iRow < oNormalizedBounds.to.rowIndex; iRow++) {
90
+ var oRowContext = this.getConfig("contextByIndex", this.getControl(), iRow), aColumns = [];
91
+ for (var iCol = oNormalizedBounds.from.colIndex; iCol < oNormalizedBounds.to.colIndex; iCol++) {
92
+ var oColumn = this.getConfig("columnByIndex", this.getControl(), iCol);
93
+ if (oColumn) {
94
+ aColumns.push(iCol);
95
+ }
96
+ }
97
+ oSelection[iRow] = {
98
+ rowContext: oRowContext,
99
+ columnIndices: aColumns
100
+ };
101
+ }
102
+ return oSelection;
103
+ };
104
+
105
+ CellSelector.prototype.onsapspace = function (oEvent) {
106
+ if (oEvent.isMarked()) {
107
+ return;
108
+ } else if (!this.getConfig("isSelectionEnabled", this.getControl())) {
109
+ Log.error("Cell selection is inactive, because preconditions are not met.");
110
+ return;
111
+ }
112
+
113
+ var oTarget = oEvent.target;
114
+ var oCellInfo = this.getConfig("getCellInfo", this.getControl(), oTarget);
115
+
116
+ if (oCellInfo) {
117
+ this._bSelecting = true;
118
+ if (this._oSession.mSource) {
119
+ if (this._oSession.mSource.rowIndex !== oCellInfo.rowIndex || this._oSession.mSource.colIndex !== oCellInfo.colIndex) {
120
+ this._oSession.mSource = null;
121
+ this._oSession.mTarget = null;
122
+ }
123
+ }
124
+ this._oSession.mSource = oCellInfo;
125
+ this._oSession.mStart = oCellInfo;
126
+ this._selectCells(this._oSession.mSource, oCellInfo, {info: {focus: oCellInfo}});
127
+
128
+ oEvent.preventDefault();
129
+ oEvent.setMarked();
130
+ }
131
+ };
132
+
133
+ CellSelector.prototype.onsapnext = CellSelector.prototype.onsapprevious = function (oEvent) {
134
+ if (!this._bSelecting) {
135
+ return;
136
+ }
137
+ this._clearSelection();
138
+ };
139
+
140
+ CellSelector.prototype.onsaphome = CellSelector.prototype.onsapend = CellSelector.prototype.onsapnext;
141
+
142
+ CellSelector.prototype.onsapnextmodifiers = function (oEvent) {
143
+ this._selectNextCell(oEvent, false, 1);
144
+ };
145
+
146
+ CellSelector.prototype.onsappreviousmodifiers = function (oEvent) {
147
+ this._selectNextCell(oEvent, true.valueOf, -1);
148
+ };
149
+
150
+ CellSelector.prototype._selectNextCell = function (oEvent, bIsPrevious, iDirectionIndex) {
151
+ if (!this._bSelecting || !oEvent.shiftKey || oEvent.isMarked() || !this._isInSelectionArea(oEvent.target)) {
152
+ return;
153
+ }
154
+
155
+ var oFocusCellInfo = this.getConfig("getCellInfo", this.getControl(), oEvent.target);
156
+ var mFrom = Object.assign({}, this._oSession.mSource);
157
+ var mTo = Object.assign({}, this._oSession.mTarget);
158
+
159
+ var sKeyCode = bIsPrevious ? KeyCodes.ARROW_UP : KeyCodes.ARROW_DOWN,
160
+ iDirection = bIsPrevious ? SELECTION_DIRECTION.PREVIOUS : SELECTION_DIRECTION.NEXT;
161
+
162
+ var sType = oEvent.keyCode == sKeyCode ? "row" : "col";
163
+ mTo[sType + "Index"] += iDirectionIndex;
164
+ oFocusCellInfo[sType + "Index"] += iDirectionIndex;
165
+
166
+ if (!this.getConfig("isNavigatableCell", this.getControl(), mTo)) {
167
+ return;
168
+ }
169
+
170
+ this._selectCells(mFrom, mTo, {info: {focus: oFocusCellInfo, direction: iDirection}});
171
+ oEvent.preventDefault();
172
+ oEvent.setMarked();
173
+ };
174
+
175
+ CellSelector.prototype.onsapspacemodifiers = function (oEvent) {
176
+ if (!this._bSelecting || oEvent.isMarked()) {
177
+ return;
178
+ }
179
+
180
+ var mTo = Object.assign({}, this._oSession.mTarget);
181
+ var oFocusCellInfo = this.getConfig("getCellInfo", this.getControl(), oEvent.target);
182
+
183
+ if (oEvent.shiftKey) {
184
+ // Select rows, if single row selection, only select focused row
185
+ this._oSession.mSource.colIndex = -Infinity;
186
+ mTo.colIndex = Infinity;
187
+ this._selectCells(this._oSession.mSource, mTo, {info: {focus: oFocusCellInfo, boundaryChange: true}});
188
+ } else if (oEvent.ctrlKey || oEvent.metaKey) {
189
+ // Select columns
190
+ this._oSession.mSource.rowIndex = -Infinity;
191
+ mTo.rowIndex = Infinity;
192
+ this._selectCells(this._oSession.mSource, mTo, {info: {focus: oFocusCellInfo, boundaryChange: true}});
193
+ }
194
+ oEvent.preventDefault();
195
+ oEvent.setMarked();
196
+ };
197
+
198
+ CellSelector.prototype.onsaphomemodifiers = function (oEvent) {
199
+ if (!this._bSelecting || oEvent.isMarked() || !oEvent.shiftKey || !this._isInSelectionArea(oEvent.target)) {
200
+ return;
201
+ }
202
+
203
+ var mTo = Object.assign({}, this._oSession.mTarget);
204
+ mTo.colIndex = -Infinity;
205
+ this._selectCells(this._oSession.mSource, mTo, {info: {focus: mTo, boundaryChange: true}});
206
+ oEvent.setMarked();
207
+ };
208
+
209
+ CellSelector.prototype.onsapendmodifiers = function (oEvent) {
210
+ if (!this._bSelecting || oEvent.isMarked() || !oEvent.shiftKey || !this._isInSelectionArea(oEvent.target)) {
211
+ return;
212
+ }
213
+
214
+ var mTo = Object.assign({}, this._oSession.mTarget);
215
+ mTo.colIndex = Infinity;
216
+ this._selectCells(this._oSession.mSource, mTo, {info: {focus: mTo, boundaryChange: true}});
217
+ oEvent.setMarked();
218
+ };
219
+
220
+ CellSelector.prototype.onkeydown = function (oEvent) {
221
+ if (this._bSelecting) {
222
+ // CTRL+SHIFT+A: Clear Selection
223
+ if (isKeyCombination(oEvent, KeyCodes.A, true, true)) {
224
+ this._clearSelection();
225
+ }
226
+ oEvent.preventDefault();
227
+ oEvent.setMarked();
228
+ }
229
+ };
230
+
231
+ CellSelector.prototype.onkeyup = function (oEvent) {
232
+ if (!this._bSelecting) {
233
+ return;
234
+ }
235
+ oEvent.setMarked();
236
+ };
237
+
238
+ /**
239
+ * Checks if the given target element is in the selection area.
240
+ * @param {HTMLElement} oTarget target element
241
+ * @returns {boolean} bInArea - true: in selection area, false: not in area
242
+ * @private
243
+ */
244
+ CellSelector.prototype._isInSelectionArea = function (oTarget) {
245
+ var oFocusInfo = this.getConfig("getCellInfo", this.getControl(), oTarget);
246
+ var bInArea = false;
247
+
248
+ if (oFocusInfo) {
249
+ var oNormalizedBounds = getNormalizedBounds(this._oSession.mSource, this._oSession.mTarget);
250
+ var aRows = this.getControl().getRows();
251
+
252
+ bInArea = !(oFocusInfo.rowIndex < oNormalizedBounds.from.rowIndex
253
+ || oFocusInfo.rowIndex > oNormalizedBounds.to.rowIndex
254
+ || oFocusInfo.colIndex < oNormalizedBounds.from.colIndex
255
+ || oFocusInfo.colIndex > oNormalizedBounds.to.colIndex)
256
+ || oFocusInfo.rowIndex == aRows[0].getIndex()
257
+ || oFocusInfo.rowIndex == aRows[aRows.length - 1].getIndex();
258
+ }
259
+
260
+ return bInArea;
261
+ };
262
+
263
+ /**
264
+ * Selects the cell from the source cell to the provided target cell's coordinates.
265
+ *
266
+ * The algorithm builds up a bounding box, goes through all the cells inside it and determines their selection state.
267
+ * The bounding box can either be ranging from
268
+ * a) source cell to target cell or
269
+ * b) source cell to current lower right cell.
270
+ * The bigger bounding box of the two will be inspected.
271
+ * @param {Object} mFrom source cell coordinates
272
+ * @param {int} mFrom.rowIndex row index
273
+ * @param {int} mFrom.colIndex column index
274
+ * @param {Object} mTo target cell coordinates
275
+ * @param {int} mTo.rowIndex row index
276
+ * @param {int} mTo.colIndex column index
277
+ * @param {object} oOptions cell selection options
278
+ * @param {object} oOptions.info options info
279
+ * @param {object} oOptions.info.focus focus info
280
+ * @param {boolean} oOptions.info.boundaryChange change of both both boundaries
281
+ * @private
282
+ */
283
+ CellSelector.prototype._selectCells = function (mFrom, mTo, oOptions) {
284
+ if (!this._bSelecting) {
285
+ return;
286
+ }
287
+
288
+ this._oSession.aCells = [];
289
+ this._savePreviousSelectionAreas();
290
+ this._eraseSelection();
291
+
292
+ if (!this._oSession.mTarget) {
293
+ this._oSession.mTarget = mTo;
294
+ }
295
+ if (!mFrom) {
296
+ this._oSession.mSource = mFrom = mTo;
297
+ }
298
+ if (!oOptions) {
299
+ oOptions = {};
300
+ }
301
+
302
+ var mBounds = getNormalizedBounds(mFrom, mTo);
303
+
304
+ // "Select cells" - returns the area to draw on (boundaries), border information for drawing and selected cell information
305
+ var oSelection = this.getConfig("selectCells", this.getControl(), mBounds, oOptions);
306
+
307
+ this._oSession.aCells = oSelection.cells;
308
+ this._drawSelection(oSelection.bounds, oSelection.borderOptions);
309
+
310
+ if (oOptions && oOptions.info && !oOptions.info.boundaryChange) {
311
+ // Set new source and target positions
312
+ this._oSession.mSource = mFrom;
313
+ this._oSession.mTarget = mTo;
314
+ } else {
315
+ // If it is something like column, row (begin/end/whole) selection, the source and target positions need to be adjusted to the normalized bounds
316
+ this._oSession.mSource = mBounds.from;
317
+ this._oSession.mTarget = mBounds.to;
318
+ }
319
+ };
320
+
321
+ /**
322
+ * Draws the selection for the given bounds.
323
+ * @param {Object} mBounds object containing the bounds information (from, to)
324
+ * @param {Object} mBounds.from from position
325
+ * @param {Object} mBounds.to to position
326
+ * @private
327
+ */
328
+ CellSelector.prototype._drawSelection = function (mBounds, oOptions) {
329
+ var aSelectionAreas = this.getConfig("getSelectionAreas", this.getControl(), mBounds.from, mBounds.to);
330
+
331
+ // Iterate through every selection area
332
+ aSelectionAreas.forEach(function (oArea, iIndex) {
333
+ var oTableDomRef = this.getControl().getDomRef(oArea.container),
334
+ oFromDomRef = this.getConfig("getCellRef", this.getControl(), oArea.from),
335
+ oToDomRef = this.getConfig("getCellRef", this.getControl(), oArea.to);
336
+ var mFromRect, mToRect, oTableRect;
337
+ var oStyle = {};
338
+
339
+ if (!oFromDomRef || !oToDomRef) {
340
+ return;
341
+ }
342
+
343
+ mFromRect = oFromDomRef.getBoundingClientRect();
344
+ mToRect = oToDomRef.getBoundingClientRect();
345
+ oTableRect = oTableDomRef.getBoundingClientRect();
346
+
347
+ // There are instances, where no offset needs to be factored in (e.g. fixed columns).
348
+ var mOffsetLeft = oArea.hasOffset ? oTableRect.left : 0;
349
+
350
+ oStyle.left = Math.min(mFromRect.left, mToRect.left) - mOffsetLeft;
351
+ oStyle.top = Math.min(mFromRect.top, mToRect.top) - oTableRect.top;
352
+ oStyle.width = Math.max(mToRect.right, mFromRect.right) - oStyle.left - mOffsetLeft;
353
+ oStyle.height = Math.max(mToRect.bottom, mFromRect.bottom) - oStyle.top - oTableRect.top;
354
+
355
+ oStyle.noBorderTop = !oOptions.top;
356
+ oStyle.noBorderBottom = !oOptions.bottom;
357
+
358
+ // if there are multiple areas omit the left/right border accordingly
359
+ oStyle.noBorderRight = aSelectionAreas.length > 1 && iIndex < (aSelectionAreas.length - 1) ? true : false;
360
+ oStyle.noBorderLeft = aSelectionAreas.length > 1 && iIndex > 0 ? true : false;
361
+
362
+ // Draw selection area
363
+ this._drawSelectionArea(oStyle, oArea.container);
364
+ }.bind(this));
365
+ };
366
+
367
+ /**
368
+ * Draw the selection area for the given style in the given container.
369
+ * @param {Object} oTargetStyle object containing style information (left, top, width, height)
370
+ * @param {float} oTargetStyle.left left position
371
+ * @param {float} oTargetStyle.top top position
372
+ * @param {float} oTargetStyle.width width
373
+ * @param {float} oTargetStyle.height height
374
+ * @param {string} sContainer name of the container
375
+ * @private
376
+ */
377
+ CellSelector.prototype._drawSelectionArea = function (oTargetStyle, sContainer) {
378
+ if (!this._oSession.oCanvas[sContainer]) {
379
+ this._oSession.oCanvas[sContainer] = document.createElement("div");
380
+ this._oSession.oCanvas[sContainer].className = CSS_CLASS + "Canvas";
381
+ }
382
+ if (!this._oSession.oCanvas[sContainer].isConnected) {
383
+ this.getControl().getDomRef(sContainer).append(this._oSession.oCanvas[sContainer]);
384
+ }
385
+
386
+ var oStyle = this._oSession.oCanvas[sContainer].style;
387
+ oStyle.left = oTargetStyle.left + "px";
388
+ oStyle.top = oTargetStyle.top + "px";
389
+ oStyle.width = oTargetStyle.width + "px";
390
+ oStyle.height = oTargetStyle.height + "px";
391
+ oStyle.display = "block";
392
+
393
+ oStyle.borderTop = oTargetStyle.noBorderTop ? "0px" : "";
394
+ oStyle.borderBottom = oTargetStyle.noBorderBottom ? "0px" : "";
395
+ oStyle.borderRight = oTargetStyle.noBorderRight ? "0px" : "";
396
+ oStyle.borderLeft = oTargetStyle.noBorderLeft ? "0px" : "";
397
+ };
398
+
399
+ CellSelector.prototype._clearSelection = function () {
400
+ this._bSelecting = false;
401
+ this._eraseSelection();
402
+ this._oSession.mSource = null;
403
+ this._oSession.mTarget = null;
404
+ };
405
+
406
+ /**
407
+ * Erases the selection
408
+ * @private
409
+ */
410
+ CellSelector.prototype._eraseSelection = function () {
411
+ Object.values(this._oSession.oCanvas).forEach(function (oArea) {
412
+ oArea.style = "";
413
+ });
414
+ };
415
+
416
+ /**
417
+ * A special scroll handler, which handles selection accordingly when the table is scrolling vertically.
418
+ * @param {sap.ui.base.Event} oEvent scroll event
419
+ * @private
420
+ */
421
+ CellSelector.prototype._handleScroll = function (oEvent) {
422
+ // Rerender selection
423
+ if (!this._bSelecting) {
424
+ return;
425
+ }
426
+ this._selectCells(this._oSession.mSource, this._oSession.mTarget);
427
+ };
428
+
429
+ /**
430
+ * Saves all the previous selection areas for later reference and calculation.
431
+ * @private
432
+ */
433
+ CellSelector.prototype._savePreviousSelectionAreas = function () {
434
+ Object.entries(this._oSession.oCanvas).forEach(function (aEntries) {
435
+ var sContainer = aEntries[0], oArea = aEntries[1];
436
+ if (oArea.style.left && oArea.style.top && oArea.style.width && oArea.style.height) {
437
+ if (!this._oSession.previousSelection) {
438
+ this._oSession.previousSelection = {};
439
+ }
440
+ this._oSession.previousSelection[sContainer] = {
441
+ top: parseFloat(oArea.style.top),
442
+ left: parseFloat(oArea.style.left),
443
+ width: parseFloat(oArea.style.width),
444
+ height: parseFloat(oArea.style.height)
445
+ };
446
+ }
447
+ }.bind(this));
448
+ };
449
+
450
+ /**
451
+ * Returns an object containing normalized coordinates for the given bounding area.
452
+ * <code>from</code> will contain the coordinates for the upper left corner of the bounding area,
453
+ * while <code>to</code> contains the coordinates of the lower right corner of the bounding area.
454
+ * @param {Object} mFrom
455
+ * @param {int} mFrom.rowIndex row index
456
+ * @param {int} mFrom.colIndex column index
457
+ * @param {Object} mTo
458
+ * @param {int} mTo.rowIndex row index
459
+ * @param {int} mTo.colIndex column index
460
+ * @returns object containing coordinates for from and to
461
+ */
462
+ function getNormalizedBounds(mFrom, mTo) {
463
+ return {
464
+ from: {rowIndex: Math.min(mFrom.rowIndex, mTo.rowIndex), colIndex: Math.min(mFrom.colIndex, mTo.colIndex)},
465
+ to: {rowIndex: Math.max(mFrom.rowIndex, mTo.rowIndex), colIndex: Math.max(mFrom.colIndex, mTo.colIndex)}
466
+ };
467
+ }
468
+
469
+ /**
470
+ * Check if the given key combination applies to the event.
471
+ * @param {sap.ui.base.Event} oEvent event instance
472
+ * @param {string} sKeyCode key code
473
+ * @param {boolean} bShift shift key pressed
474
+ * @param {boolean} bCtrl control key pressed
475
+ * @returns is combination or not
476
+ */
477
+ function isKeyCombination(oEvent, sKeyCode, bShift, bCtrl) {
478
+ return oEvent.keyCode == sKeyCode && oEvent.shiftKey == bShift && (oEvent.ctrlKey == bCtrl || oEvent.metaKey == bCtrl);
479
+ }
480
+
481
+ PluginBase.setConfigs({
482
+ "sap.m.Table": {
483
+ selectableCells: ".sapMListTblCell:not([aria-hidden=true])"
484
+ },
485
+ "sap.ui.table.Table": {
486
+ container: "tableCtrlCnt",
487
+ selectableCells: ".sapUiTableDataCell",
488
+ scrollEvent: "firstVisibleRowChanged",
489
+ /**
490
+ * Checks if the selection is enabled for the control.
491
+ * @param {sap.ui.core.Control} oControl control instance
492
+ * @returns {boolean} is selection enabled or not
493
+ */
494
+ isSelectionEnabled: function (oControl) {
495
+ return !(oControl.getSelectionBehavior() !== "RowSelector" || oControl.getSelectionMode() == "None");
496
+ },
497
+ /**
498
+ * Retrieve the cell reference for a given position
499
+ * @param {sap.ui.table.Table} oTable table instance
500
+ * @param {Object} mPosition position
501
+ * @param {int} mPosition.rowIndex row index
502
+ * @param {int} mPosition.colIndex column index
503
+ * @returns {HTMLElement} cell's DOM element
504
+ */
505
+ getCellRef: function (oTable, mPosition) {
506
+ var oRow = this._getRowByIndex(oTable, mPosition.rowIndex);
507
+ if (oRow) {
508
+ var oColumn = this._getColumns(oTable)[mPosition.colIndex];
509
+ var oCell = oColumn && oRow.getCells()[mPosition.colIndex];
510
+ if (oCell) {
511
+ return oCell.$().closest(".sapUiTableDataCell")[0];
512
+ }
513
+ }
514
+ },
515
+ /**
516
+ * Retrieve cell information for a given DOM element.
517
+ * @param {sap.ui.table.Table} oTable table instance
518
+ * @param {HTMLElement} oTarget DOM element of cell
519
+ * @returns {Object} cell information containing rowIndex and colIndex
520
+ */
521
+ getCellInfo: function (oTable, oTarget) {
522
+ return {
523
+ rowIndex: this.rowIndex(null, oTarget),
524
+ colIndex: this.colIndex(oTable, oTarget)
525
+ };
526
+ },
527
+ /**
528
+ * Returns the controls' available selection areas for the given bounds.
529
+ *
530
+ * Note: The order of the areas is from left to right. Area at index 0 is the leftmost area, etc.
531
+ * @param {sap.ui.table.Table} oTable table instance
532
+ * @param {Object} mFrom from position
533
+ * @param {Object} mTo to position
534
+ * @returns {Object[]} array of objects (container, from, to) containing information for each area. It contains the name of the container
535
+ * and the area that will be selected in said container.
536
+ */
537
+ getSelectionAreas: function (oTable, mFrom, mTo) {
538
+ // push selection areas from left to right
539
+ var aAreas = [], iFixedColumnCount = oTable.getFixedColumnCount();
540
+ if (iFixedColumnCount > 0 && (mFrom.colIndex < iFixedColumnCount || mFrom.colIndex === -Infinity)) {
541
+ var iToCol = mTo.colIndex === Infinity ? iFixedColumnCount - 1 : Math.min(mTo.colIndex, iFixedColumnCount - 1);
542
+ var mFixedFrom = {rowIndex: mFrom.rowIndex, colIndex: mFrom.colIndex},
543
+ mFixedTo = {rowIndex: mTo.rowIndex, colIndex: iToCol};
544
+ aAreas.push({container: "sapUiTableCtrlScrFixed", from: mFixedFrom, to: mFixedTo});
545
+ }
546
+ if (mTo.colIndex >= iFixedColumnCount || mTo.colIndex === Infinity) {
547
+ aAreas.push({container: this.container, from: mFrom, to: mTo, hasOffset: true});
548
+ }
549
+ return aAreas;
550
+ },
551
+ /**
552
+ * Retrieves selected cells and returns their position and the boundaries of the selection area fitted to the table and its border options.
553
+ *
554
+ * Note: Also modifies the original mSelectionBounds object and replaces MIN/MAX with real values.
555
+ *
556
+ * Note: As the selection area may vary based on control-specific settings (e.g. SingleSelection), the information is returned as well.
557
+ * @param {sap.ui.table.Table} oTable table instance
558
+ * @param {Object} mSelectionBounds selection options
559
+ * @param {Object} oOptions selection options
560
+ * @returns {Object} oSelection object containg <code>bounds</code> (selection bounds) and <code>cells</code> (selected cell positions)
561
+ * @returns {Object} oSelection.bounds
562
+ * @returns {int[]} oSelection.cells
563
+ */
564
+ selectCells: function (oTable, mSelectionBounds, oOptions) {
565
+ var mBounds = {}, oBorderOptions = {top: true, bottom: true};
566
+ mBounds.from = Object.assign({}, mSelectionBounds.from);
567
+ mBounds.to = Object.assign({}, mSelectionBounds.to);
568
+ var aCells = [];
569
+
570
+ // Replace MIN/MAX with according number for focus object
571
+ if (oOptions && oOptions.info) {
572
+ if (oOptions.info.focus.rowIndex === -Infinity) {
573
+ oOptions.info.focus.rowIndex = 0;
574
+ } else if (oOptions.info.focus.rowIndex === Infinity) {
575
+ oOptions.info.focus.rowIndex = oTable._getTotalRowCount();
576
+ }
577
+ if (oOptions.info.focus.colIndex === -Infinity) {
578
+ oOptions.info.focus.colIndex = 0;
579
+ } else if (oOptions.info.focus.colIndex === Infinity) {
580
+ oOptions.info.focus.colIndex = this._getColumns(oTable).length - 1;
581
+ }
582
+ this._focusCell(oTable, oOptions.info.focus, oOptions.info.direction);
583
+ }
584
+
585
+ // Determine the first, last and last row of unfixed rows. Needs to factor in fixed rows.
586
+ var iFirstRow = oTable.getFirstVisibleRow() + oTable.getFixedRowCount();
587
+ var iLastRowIndex = iFirstRow + oTable.getVisibleRowCount() - oTable.getFixedBottomRowCount() - oTable.getFixedRowCount() - 1;
588
+ var iLowerFixedLimit = iFirstRow + oTable.getVisibleRowCount() - oTable.getFixedRowCount() - oTable.getFixedBottomRowCount();
589
+
590
+ if ((mBounds.from.rowIndex < iFirstRow && mBounds.to.rowIndex < iFirstRow
591
+ || mBounds.from.rowIndex > iLastRowIndex && mBounds.to.rowIndex > iLastRowIndex)
592
+ && !(mBounds.from.rowIndex < oTable.getFixedRowCount() || mBounds.to.rowIndex >= iLowerFixedLimit)) {
593
+ // If both FROM and TO are out of the view port and there is no need to render them, set bounds to none. Needs to factor in fixed rows.
594
+ mBounds.from = {};
595
+ mBounds.to = {};
596
+ } else {
597
+ if ((mBounds.from.rowIndex < iFirstRow && mBounds.from.rowIndex > (oTable.getFixedRowCount() - 1)) || mBounds.from.rowIndex === -Infinity) {
598
+ // Case 1: FROM is "above" table, so return the position of the first row instead for rendering.
599
+ mBounds.from.rowIndex = iFirstRow;
600
+ oBorderOptions.top = mBounds.from.rowIndex == 0 ? true : false;
601
+ if (mSelectionBounds.from.rowIndex === -Infinity) {
602
+ // Case 1.A: If MIN is given, set it immediately to 0
603
+ mSelectionBounds.from.rowIndex = 0;
604
+ mBounds.from.rowIndex = oTable.getFixedRowCount() > 0 ? 0 : iFirstRow;
605
+ }
606
+ }
607
+ if ((mBounds.to.rowIndex > iLastRowIndex && mBounds.to.rowIndex < (oTable._getTotalRowCount() - oTable.getFixedBottomRowCount())) || mBounds.to.rowIndex === Infinity) {
608
+ // Case 2: TO is "below" table (currently visible rows), so return the position of the last visible row instead for rendering.
609
+ mBounds.to.rowIndex = iLastRowIndex;
610
+ oBorderOptions.bottom = mBounds.to.rowIndex == oTable._getTotalRowCount() - 1 ? true : false;
611
+ if (mSelectionBounds.to.rowIndex === Infinity) {
612
+ // Case 2.A: If MAX is given, set it immediately to the maximum row count
613
+ mSelectionBounds.to.rowIndex = oTable._getTotalRowCount() - 1;
614
+ mBounds.to.rowIndex = oTable.getFixedRowCount() > 0 ? oTable._getTotalRowCount() - 1 : iLastRowIndex;
615
+ }
616
+ }
617
+ }
618
+
619
+ // If table is in Single Selection Mode, only select the row with focus in it
620
+ if (mBounds.from.colIndex === -Infinity && mBounds.from.colIndex === Infinity) {
621
+ mBounds.from.rowIndex = oOptions.info.focus.rowIndex;
622
+ mSelectionBounds.from.rowIndex = oOptions.info.focus.rowIndex;
623
+ }
624
+
625
+ var aVisibleColumns = this._getColumns(oTable);
626
+ mBounds.from.colIndex = mSelectionBounds.from.colIndex = Math.max(mSelectionBounds.from.colIndex, 0);
627
+ mBounds.to.colIndex = mSelectionBounds.to.colIndex = Math.min(mSelectionBounds.to.colIndex, aVisibleColumns.length - 1);
628
+
629
+ for (var iRow = mSelectionBounds.from.rowIndex; iRow <= mSelectionBounds.to.rowIndex; iRow++) {
630
+ var oRow = this._getRowByIndex(oTable, iRow);
631
+ if (oRow) {
632
+ for (var iCol = mSelectionBounds.from.colIndex; iCol <= mSelectionBounds.to.colIndex; iCol++) {
633
+ aCells.push([iRow, iCol]);
634
+ }
635
+ }
636
+ }
637
+
638
+ return {
639
+ bounds: mBounds,
640
+ borderOptions: oBorderOptions,
641
+ cells: aCells
642
+ };
643
+ },
644
+ /**
645
+ * Retrieves the row index for the given cell's DOM reference.
646
+ * @param {sap.ui.table.Table} oTable table instance
647
+ * @param {HTMLElement} oCellDomRef DOM reference of cell
648
+ * @returns {int} row index
649
+ */
650
+ rowIndex: function (oTable, oCellDomRef) {
651
+ return jQuery(oCellDomRef).control(0, true).getIndex();
652
+ },
653
+ /**
654
+ * Retrieves the column index for the given cell's DOM reference.
655
+ * @param {sap.ui.table.Table} oTable table instance
656
+ * @param {HTMLElement} oCellDomRef DOM reference of cell
657
+ * @returns {int} column index
658
+ */
659
+ colIndex: function (oTable, oCellDomRef) {
660
+ return this._getColumns(oTable).indexOf(Core.byId(oCellDomRef.getAttribute("data-sap-ui-colid")));
661
+ },
662
+ contextByIndex: function(oTable, iRowIndex) {
663
+ return oTable.getContextByIndex(iRowIndex);
664
+ },
665
+ columnByIndex: function(oTable, iColIndex) {
666
+ var oColumn = this._getColumns(oTable)[iColIndex];
667
+ if (!oColumn.getVisible()) {
668
+ return;
669
+ }
670
+ return oColumn;
671
+ },
672
+ isNavigatableCell: function (oTable, mPosition) {
673
+ if (mPosition.rowIndex < 0 || mPosition.rowIndex >= oTable._getTotalRowCount()
674
+ || mPosition.colIndex < 0 || mPosition.colIndex >= this._getColumns(oTable).length) {
675
+ return false;
676
+ }
677
+ return true;
678
+ },
679
+ /**
680
+ * Scroll one row up or down based on the given direction.
681
+ * @param {sap.ui.table.Table} oTable table instance
682
+ * @param {int} iDirection scroll direction
683
+ * @param {int} iRow row index
684
+ */
685
+ _scrollRow: function (oTable, iDirection, iRow) {
686
+ var iFirstRow = oTable.getFirstVisibleRow();
687
+ if (iRow >= 0 && iRow < oTable._getTotalRowCount()) {
688
+ if (oTable.getFixedRowCount() > 0 && iRow == oTable.getFixedRowCount()) {
689
+ oTable.setFirstVisibleRow(0);
690
+ } else {
691
+ iDirection == SELECTION_DIRECTION.NEXT ? iFirstRow++ : iFirstRow--;
692
+ oTable.setFirstVisibleRow(iFirstRow);
693
+ }
694
+ }
695
+ },
696
+ /**
697
+ * Focus the specified cell and scroll if necessary.
698
+ * @param {sap.ui.table.Table} oTable table instance
699
+ * @param {Object} mPosition position object
700
+ * @param {int} mPosition.rowIndex row index
701
+ * @param {int} mPosition.colIndex column index
702
+ * @param {int} iDirection scroll direction
703
+ */
704
+ _focusCell: function (oTable, mPosition, iDirection) {
705
+ var oCellRef = this.getCellRef(oTable, mPosition);
706
+
707
+ if (!oCellRef) {
708
+ this._scrollRow(oTable, iDirection, mPosition.rowIndex);
709
+ oCellRef = this.getCellRef(oTable, mPosition);
710
+ }
711
+ oCellRef && oCellRef.focus();
712
+ },
713
+ /**
714
+ * Get visible columns of the table.
715
+ * @param {sap.ui.table.Table} oTable table instance
716
+ * @returns {sap.ui.table.Column[]} array of visible columns
717
+ */
718
+ _getColumns: function (oTable) {
719
+ return oTable.getColumns().filter(function (oColumn) {
720
+ return oColumn.shouldRender();
721
+ });
722
+ },
723
+ /**
724
+ * Retrieve a row by its index.
725
+ * @param {sap.ui.table.Table} oTable table instance
726
+ * @param {int} iRowIndex row index
727
+ * @returns {sap.ui.table.Row|null} row instance
728
+ */
729
+ _getRowByIndex: function (oTable, iRowIndex) {
730
+ var aItems = oTable.getRows();
731
+ for (var i = 0; i < aItems.length; i++) {
732
+ if (aItems[i].getIndex() == iRowIndex) {
733
+ return aItems[i];
734
+ }
735
+ }
736
+ }
737
+ }
738
+ }, CellSelector);
739
+
740
+ return CellSelector;
741
+ });