@openui5/sap.m 1.102.2 → 1.104.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 (460) hide show
  1. package/.eslintrc.json +2 -3
  2. package/.reuse/dep5 +17 -0
  3. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
  4. package/THIRDPARTY.txt +35 -2
  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 +4 -4
  10. package/src/sap/m/ActionSheet.js +1 -1
  11. package/src/sap/m/App.js +1 -1
  12. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  13. package/src/sap/m/Avatar.js +1 -1
  14. package/src/sap/m/Bar.js +11 -10
  15. package/src/sap/m/BarInPageEnabler.js +1 -1
  16. package/src/sap/m/Breadcrumbs.js +27 -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 +6 -5
  20. package/src/sap/m/Carousel.js +1 -1
  21. package/src/sap/m/CarouselLayout.js +1 -1
  22. package/src/sap/m/CheckBox.js +1 -1
  23. package/src/sap/m/ColorPalette.js +1 -1
  24. package/src/sap/m/ColorPalettePopover.js +1 -1
  25. package/src/sap/m/Column.js +1 -1
  26. package/src/sap/m/ColumnHeaderPopover.js +1 -1
  27. package/src/sap/m/ColumnListItem.js +1 -1
  28. package/src/sap/m/ColumnPopoverActionItem.js +1 -1
  29. package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
  30. package/src/sap/m/ColumnPopoverItem.js +1 -1
  31. package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
  32. package/src/sap/m/ColumnPopoverSortItem.js +1 -1
  33. package/src/sap/m/ComboBox.js +1 -1
  34. package/src/sap/m/ComboBoxBase.js +7 -7
  35. package/src/sap/m/ComboBoxTextField.js +1 -1
  36. package/src/sap/m/CustomDynamicDateOption.js +1 -1
  37. package/src/sap/m/CustomListItem.js +1 -1
  38. package/src/sap/m/CustomTile.js +1 -1
  39. package/src/sap/m/CustomTreeItem.js +1 -1
  40. package/src/sap/m/DatePicker.js +15 -23
  41. package/src/sap/m/DateRangeSelection.js +48 -41
  42. package/src/sap/m/DateTimeField.js +87 -20
  43. package/src/sap/m/DateTimeInput.js +1 -1
  44. package/src/sap/m/DateTimePicker.js +54 -24
  45. package/src/sap/m/DateTimePickerRenderer.js +1 -1
  46. package/src/sap/m/Dialog.js +3 -10
  47. package/src/sap/m/DisplayListItem.js +1 -1
  48. package/src/sap/m/DraftIndicator.js +1 -1
  49. package/src/sap/m/DynamicDate.js +1 -1
  50. package/src/sap/m/DynamicDateFormat.js +31 -13
  51. package/src/sap/m/DynamicDateOption.js +6 -4
  52. package/src/sap/m/DynamicDateRange.js +20 -3
  53. package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
  54. package/src/sap/m/ExpandableText.js +1 -1
  55. package/src/sap/m/FacetFilter.js +29 -28
  56. package/src/sap/m/FacetFilterItem.js +1 -1
  57. package/src/sap/m/FacetFilterList.js +1 -1
  58. package/src/sap/m/FeedContent.js +1 -1
  59. package/src/sap/m/FeedInput.js +1 -1
  60. package/src/sap/m/FeedListItem.js +1 -1
  61. package/src/sap/m/FeedListItemAction.js +1 -1
  62. package/src/sap/m/Fiori20Adapter.js +2 -2
  63. package/src/sap/m/FlexBox.js +1 -1
  64. package/src/sap/m/FlexItemData.js +2 -2
  65. package/src/sap/m/FormattedText.js +1 -1
  66. package/src/sap/m/GenericTag.js +5 -5
  67. package/src/sap/m/GenericTile.js +11 -7
  68. package/src/sap/m/GenericTileLineModeRenderer.js +4 -5
  69. package/src/sap/m/GenericTileRenderer.js +18 -6
  70. package/src/sap/m/GroupHeaderListItem.js +1 -1
  71. package/src/sap/m/GrowingEnablement.js +59 -10
  72. package/src/sap/m/GrowingList.js +1 -1
  73. package/src/sap/m/HBox.js +1 -1
  74. package/src/sap/m/HeaderContainer.js +5 -24
  75. package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
  76. package/src/sap/m/IconTabBar.js +2 -1
  77. package/src/sap/m/IconTabBarSelectList.js +1 -1
  78. package/src/sap/m/IconTabFilter.js +4 -4
  79. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  80. package/src/sap/m/IconTabHeader.js +14 -3
  81. package/src/sap/m/IconTabSeparator.js +1 -1
  82. package/src/sap/m/IllustratedMessage.js +63 -24
  83. package/src/sap/m/IllustratedMessageRenderer.js +10 -6
  84. package/src/sap/m/Illustration.js +1 -1
  85. package/src/sap/m/IllustrationPool.js +1 -0
  86. package/src/sap/m/Image.js +1 -1
  87. package/src/sap/m/ImageContent.js +1 -1
  88. package/src/sap/m/Input.js +2 -17
  89. package/src/sap/m/InputBase.js +12 -5
  90. package/src/sap/m/InputListItem.js +1 -1
  91. package/src/sap/m/InstanceManager.js +14 -19
  92. package/src/sap/m/Label.js +1 -1
  93. package/src/sap/m/LightBox.js +1 -1
  94. package/src/sap/m/LightBoxItem.js +1 -1
  95. package/src/sap/m/Link.js +41 -5
  96. package/src/sap/m/LinkRenderer.js +18 -10
  97. package/src/sap/m/List.js +1 -1
  98. package/src/sap/m/ListBase.js +4 -1
  99. package/src/sap/m/ListItemBase.js +10 -2
  100. package/src/sap/m/MaskEnabler.js +52 -2
  101. package/src/sap/m/MaskInput.js +23 -1
  102. package/src/sap/m/MaskInputRenderer.js +10 -0
  103. package/src/sap/m/MaskInputRule.js +1 -1
  104. package/src/sap/m/Menu.js +1 -1
  105. package/src/sap/m/MenuButton.js +2 -1
  106. package/src/sap/m/MenuItem.js +1 -1
  107. package/src/sap/m/MenuListItem.js +3 -3
  108. package/src/sap/m/MessageBox.js +1020 -908
  109. package/src/sap/m/MessageItem.js +1 -1
  110. package/src/sap/m/MessageListItem.js +1 -1
  111. package/src/sap/m/MessagePage.js +1 -1
  112. package/src/sap/m/MessagePopover.js +4 -1
  113. package/src/sap/m/MessagePopoverItem.js +1 -1
  114. package/src/sap/m/MessageStrip.js +1 -1
  115. package/src/sap/m/MessageToast.js +1 -1
  116. package/src/sap/m/MessageView.js +1 -1
  117. package/src/sap/m/MultiComboBox.js +4 -4
  118. package/src/sap/m/MultiEditField.js +1 -1
  119. package/src/sap/m/MultiInput.js +8 -8
  120. package/src/sap/m/NavContainer.js +23 -19
  121. package/src/sap/m/NewsContent.js +1 -1
  122. package/src/sap/m/NotificationList.js +1 -1
  123. package/src/sap/m/NotificationListBase.js +1 -1
  124. package/src/sap/m/NotificationListGroup.js +1 -1
  125. package/src/sap/m/NotificationListItem.js +1 -1
  126. package/src/sap/m/NumericContent.js +1 -1
  127. package/src/sap/m/NumericInput.js +1 -1
  128. package/src/sap/m/ObjectAttribute.js +14 -1
  129. package/src/sap/m/ObjectAttributeRenderer.js +5 -4
  130. package/src/sap/m/ObjectHeader.js +4 -4
  131. package/src/sap/m/ObjectHeaderRenderer.js +11 -11
  132. package/src/sap/m/ObjectIdentifier.js +3 -3
  133. package/src/sap/m/ObjectListItem.js +1 -1
  134. package/src/sap/m/ObjectMarker.js +7 -4
  135. package/src/sap/m/ObjectNumber.js +1 -1
  136. package/src/sap/m/ObjectNumberRenderer.js +10 -3
  137. package/src/sap/m/ObjectStatus.js +1 -1
  138. package/src/sap/m/OverflowToolbar.js +35 -12
  139. package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
  140. package/src/sap/m/OverflowToolbarAssociativePopoverControls.js +5 -0
  141. package/src/sap/m/OverflowToolbarButton.js +1 -1
  142. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  143. package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
  144. package/src/sap/m/P13nAnyFilterItem.js +1 -1
  145. package/src/sap/m/P13nColumnsItem.js +1 -1
  146. package/src/sap/m/P13nColumnsPanel.js +1 -1
  147. package/src/sap/m/P13nConditionPanel.js +24 -24
  148. package/src/sap/m/P13nDialog.js +3 -1
  149. package/src/sap/m/P13nDimMeasureItem.js +1 -1
  150. package/src/sap/m/P13nDimMeasurePanel.js +1 -1
  151. package/src/sap/m/P13nFilterItem.js +1 -1
  152. package/src/sap/m/P13nFilterPanel.js +1 -1
  153. package/src/sap/m/P13nGroupItem.js +1 -1
  154. package/src/sap/m/P13nGroupPanel.js +1 -1
  155. package/src/sap/m/P13nItem.js +1 -1
  156. package/src/sap/m/P13nPanel.js +1 -1
  157. package/src/sap/m/P13nSelectionItem.js +1 -1
  158. package/src/sap/m/P13nSelectionPanel.js +1 -1
  159. package/src/sap/m/P13nSortItem.js +1 -1
  160. package/src/sap/m/P13nSortPanel.js +1 -1
  161. package/src/sap/m/PDFViewer.js +1 -1
  162. package/src/sap/m/PDFViewerRenderer.js +1 -0
  163. package/src/sap/m/Page.js +1 -1
  164. package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
  165. package/src/sap/m/PagingButton.js +1 -1
  166. package/src/sap/m/Panel.js +1 -1
  167. package/src/sap/m/PlanningCalendar.js +1 -1
  168. package/src/sap/m/PlanningCalendarHeader.js +2 -2
  169. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  170. package/src/sap/m/PlanningCalendarRow.js +1 -1
  171. package/src/sap/m/PlanningCalendarView.js +1 -1
  172. package/src/sap/m/Popover.js +5 -5
  173. package/src/sap/m/PopoverRenderer.js +2 -2
  174. package/src/sap/m/ProgressIndicator.js +15 -29
  175. package/src/sap/m/ProgressIndicatorRenderer.js +12 -3
  176. package/src/sap/m/PullToRefresh.js +1 -1
  177. package/src/sap/m/QuickView.js +2 -2
  178. package/src/sap/m/QuickViewBase.js +1 -1
  179. package/src/sap/m/QuickViewCard.js +1 -1
  180. package/src/sap/m/QuickViewGroup.js +1 -1
  181. package/src/sap/m/QuickViewGroupElement.js +2 -1
  182. package/src/sap/m/QuickViewPage.js +1 -1
  183. package/src/sap/m/RadioButton.js +1 -1
  184. package/src/sap/m/RadioButtonGroup.js +2 -2
  185. package/src/sap/m/RangeSlider.js +75 -55
  186. package/src/sap/m/RangeSliderRenderer.js +34 -2
  187. package/src/sap/m/RatingIndicator.js +8 -1
  188. package/src/sap/m/RatingIndicatorRenderer.js +13 -4
  189. package/src/sap/m/ResponsivePopover.js +7 -6
  190. package/src/sap/m/ResponsiveScale.js +1 -1
  191. package/src/sap/m/ScrollBar.js +1 -1
  192. package/src/sap/m/ScrollContainer.js +1 -1
  193. package/src/sap/m/SearchField.js +1 -1
  194. package/src/sap/m/SegmentedButton.js +1 -1
  195. package/src/sap/m/SegmentedButtonItem.js +1 -1
  196. package/src/sap/m/Select.js +16 -18
  197. package/src/sap/m/SelectDialog.js +2 -2
  198. package/src/sap/m/SelectDialogBase.js +1 -1
  199. package/src/sap/m/SelectList.js +8 -8
  200. package/src/sap/m/SelectListRenderer.js +2 -2
  201. package/src/sap/m/SelectRenderer.js +37 -13
  202. package/src/sap/m/SelectionDetails.js +1 -1
  203. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  204. package/src/sap/m/SelectionDetailsItem.js +1 -1
  205. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  206. package/src/sap/m/Shell.js +1 -1
  207. package/src/sap/m/SimpleFixFlex.js +5 -6
  208. package/src/sap/m/SimpleFixFlexRenderer.js +1 -0
  209. package/src/sap/m/SinglePlanningCalendar.js +1 -1
  210. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  211. package/src/sap/m/SinglePlanningCalendarGrid.js +1 -1
  212. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
  213. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  214. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  215. package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
  216. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  217. package/src/sap/m/SlideTile.js +1 -1
  218. package/src/sap/m/Slider.js +14 -5
  219. package/src/sap/m/SliderRenderer.js +27 -2
  220. package/src/sap/m/SliderTooltip.js +1 -1
  221. package/src/sap/m/SliderTooltipBase.js +1 -1
  222. package/src/sap/m/SliderTooltipContainer.js +3 -3
  223. package/src/sap/m/SplitApp.js +1 -1
  224. package/src/sap/m/SplitButton.js +1 -1
  225. package/src/sap/m/SplitContainer.js +3 -11
  226. package/src/sap/m/StandardDynamicDateOption.js +1 -1
  227. package/src/sap/m/StandardListItem.js +1 -1
  228. package/src/sap/m/StandardTile.js +1 -1
  229. package/src/sap/m/StandardTreeItem.js +1 -1
  230. package/src/sap/m/StepInput.js +1 -1
  231. package/src/sap/m/SuggestionItem.js +1 -1
  232. package/src/sap/m/SuggestionsPopover.js +1 -1
  233. package/src/sap/m/Switch.js +1 -1
  234. package/src/sap/m/TabContainer.js +3 -2
  235. package/src/sap/m/TabContainerItem.js +1 -1
  236. package/src/sap/m/TabStrip.js +2 -2
  237. package/src/sap/m/TabStripItem.js +1 -1
  238. package/src/sap/m/Table.js +1 -1
  239. package/src/sap/m/TablePersoController.js +2 -2
  240. package/src/sap/m/TablePersoDialog.js +2 -2
  241. package/src/sap/m/TablePersoProvider.js +2 -2
  242. package/src/sap/m/TableSelectDialog.js +2 -2
  243. package/src/sap/m/Text.js +2 -2
  244. package/src/sap/m/TextArea.js +4 -3
  245. package/src/sap/m/TextRenderer.js +2 -0
  246. package/src/sap/m/Tile.js +1 -1
  247. package/src/sap/m/TileContainer.js +6 -6
  248. package/src/sap/m/TileContent.js +9 -9
  249. package/src/sap/m/TileContentRenderer.js +1 -1
  250. package/src/sap/m/TimePicker.js +73 -18
  251. package/src/sap/m/TimePickerClock.js +1 -1
  252. package/src/sap/m/TimePickerClocks.js +5 -3
  253. package/src/sap/m/TimePickerClocksRenderer.js +1 -0
  254. package/src/sap/m/TimePickerInputs.js +1 -1
  255. package/src/sap/m/TimePickerInternals.js +1 -1
  256. package/src/sap/m/TimePickerSlider.js +1 -1
  257. package/src/sap/m/TimePickerSliders.js +1 -1
  258. package/src/sap/m/Title.js +2 -2
  259. package/src/sap/m/TitlePropagationSupport.js +1 -1
  260. package/src/sap/m/ToggleButton.js +2 -2
  261. package/src/sap/m/Token.js +1 -1
  262. package/src/sap/m/Tokenizer.js +1 -1
  263. package/src/sap/m/Toolbar.js +1 -1
  264. package/src/sap/m/ToolbarLayoutData.js +6 -2
  265. package/src/sap/m/ToolbarSeparator.js +1 -1
  266. package/src/sap/m/ToolbarSpacer.js +1 -1
  267. package/src/sap/m/Tree.js +1 -1
  268. package/src/sap/m/TreeItemBase.js +1 -1
  269. package/src/sap/m/UploadCollection.js +6 -6
  270. package/src/sap/m/UploadCollectionItem.js +1 -1
  271. package/src/sap/m/UploadCollectionParameter.js +1 -1
  272. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
  273. package/src/sap/m/VBox.js +1 -1
  274. package/src/sap/m/ValueStateHeader.js +1 -1
  275. package/src/sap/m/VariantItem.js +160 -0
  276. package/src/sap/m/VariantManagement.js +610 -547
  277. package/src/sap/m/ViewSettingsCustomItem.js +1 -1
  278. package/src/sap/m/ViewSettingsCustomTab.js +1 -1
  279. package/src/sap/m/ViewSettingsDialog.js +3 -3
  280. package/src/sap/m/ViewSettingsFilterItem.js +1 -1
  281. package/src/sap/m/ViewSettingsItem.js +1 -1
  282. package/src/sap/m/VisibleItem.js +1 -1
  283. package/src/sap/m/WheelSlider.js +1 -1
  284. package/src/sap/m/WheelSliderContainer.js +1 -1
  285. package/src/sap/m/Wizard.js +1 -1
  286. package/src/sap/m/WizardProgressNavigator.js +1 -1
  287. package/src/sap/m/WizardStep.js +1 -1
  288. package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
  289. package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
  290. package/src/sap/m/changeHandler/CombineButtons.js +1 -1
  291. package/src/sap/m/changeHandler/MoveTableColumns.js +2 -2
  292. package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
  293. package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
  294. package/src/sap/m/designtime/VariantManagement.designtime.js +34 -24
  295. package/src/sap/m/designtime/messagebundle_de.properties +2 -2
  296. package/src/sap/m/flexibility/EngineFlex.js +48 -0
  297. package/src/sap/m/inputUtils/forwardItemProperties.js +4 -0
  298. package/src/sap/m/library.js +32 -9
  299. package/src/sap/m/messagebundle.properties +33 -2
  300. package/src/sap/m/messagebundle_ar.properties +27 -12
  301. package/src/sap/m/messagebundle_bg.properties +22 -7
  302. package/src/sap/m/messagebundle_ca.properties +22 -7
  303. package/src/sap/m/messagebundle_cs.properties +24 -9
  304. package/src/sap/m/messagebundle_cy.properties +22 -7
  305. package/src/sap/m/messagebundle_da.properties +22 -7
  306. package/src/sap/m/messagebundle_de.properties +23 -8
  307. package/src/sap/m/messagebundle_el.properties +23 -8
  308. package/src/sap/m/messagebundle_en.properties +22 -7
  309. package/src/sap/m/messagebundle_en_GB.properties +22 -7
  310. package/src/sap/m/messagebundle_en_US_sappsd.properties +22 -7
  311. package/src/sap/m/messagebundle_en_US_saprigi.properties +22 -7
  312. package/src/sap/m/messagebundle_en_US_saptrc.properties +22 -7
  313. package/src/sap/m/messagebundle_es.properties +22 -7
  314. package/src/sap/m/messagebundle_es_MX.properties +22 -7
  315. package/src/sap/m/messagebundle_et.properties +22 -7
  316. package/src/sap/m/messagebundle_fi.properties +22 -7
  317. package/src/sap/m/messagebundle_fr.properties +35 -20
  318. package/src/sap/m/messagebundle_fr_CA.properties +22 -7
  319. package/src/sap/m/messagebundle_hi.properties +22 -7
  320. package/src/sap/m/messagebundle_hr.properties +26 -11
  321. package/src/sap/m/messagebundle_hu.properties +24 -9
  322. package/src/sap/m/messagebundle_id.properties +22 -7
  323. package/src/sap/m/messagebundle_it.properties +29 -14
  324. package/src/sap/m/messagebundle_iw.properties +23 -8
  325. package/src/sap/m/messagebundle_ja.properties +22 -7
  326. package/src/sap/m/messagebundle_kk.properties +22 -7
  327. package/src/sap/m/messagebundle_ko.properties +39 -24
  328. package/src/sap/m/messagebundle_lt.properties +22 -7
  329. package/src/sap/m/messagebundle_lv.properties +22 -7
  330. package/src/sap/m/messagebundle_ms.properties +22 -7
  331. package/src/sap/m/messagebundle_nl.properties +36 -21
  332. package/src/sap/m/messagebundle_no.properties +27 -12
  333. package/src/sap/m/messagebundle_pl.properties +23 -8
  334. package/src/sap/m/messagebundle_pt.properties +27 -12
  335. package/src/sap/m/messagebundle_pt_PT.properties +22 -7
  336. package/src/sap/m/messagebundle_ro.properties +23 -8
  337. package/src/sap/m/messagebundle_ru.properties +22 -7
  338. package/src/sap/m/messagebundle_sh.properties +23 -8
  339. package/src/sap/m/messagebundle_sk.properties +22 -7
  340. package/src/sap/m/messagebundle_sl.properties +24 -9
  341. package/src/sap/m/messagebundle_sv.properties +22 -7
  342. package/src/sap/m/messagebundle_th.properties +45 -30
  343. package/src/sap/m/messagebundle_tr.properties +23 -8
  344. package/src/sap/m/messagebundle_uk.properties +23 -8
  345. package/src/sap/m/messagebundle_vi.properties +22 -7
  346. package/src/sap/m/messagebundle_zh_CN.properties +24 -9
  347. package/src/sap/m/messagebundle_zh_TW.properties +26 -11
  348. package/src/sap/m/p13n/AbstractContainer.js +5 -5
  349. package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
  350. package/src/sap/m/p13n/BasePanel.js +4 -3
  351. package/src/sap/m/p13n/Container.js +1 -1
  352. package/src/sap/m/p13n/Engine.js +1253 -0
  353. package/src/sap/m/p13n/FlexUtil.js +162 -0
  354. package/src/sap/m/p13n/GroupController.js +145 -0
  355. package/src/sap/m/p13n/GroupPanel.js +10 -3
  356. package/src/sap/m/p13n/MetadataHelper.js +35 -0
  357. package/src/sap/m/p13n/PersistenceProvider.js +135 -0
  358. package/src/sap/m/p13n/Popup.js +46 -9
  359. package/src/sap/m/p13n/QueryPanel.js +1 -1
  360. package/src/sap/m/p13n/SelectionController.js +563 -0
  361. package/src/sap/m/p13n/SelectionPanel.js +13 -1
  362. package/src/sap/m/p13n/SortController.js +153 -0
  363. package/src/sap/m/p13n/SortPanel.js +11 -1
  364. package/src/sap/m/p13n/enum/PersistenceMode.js +43 -0
  365. package/src/sap/m/p13n/handler/xConfigHandler.js +166 -0
  366. package/src/sap/m/p13n/modification/FlexModificationHandler.js +90 -0
  367. package/src/sap/m/p13n/modification/LocalStorageModificationHandler.js +75 -0
  368. package/src/sap/m/p13n/modification/ModificationHandler.js +133 -0
  369. package/src/sap/m/p13n/modules/AdaptationProvider.js +67 -0
  370. package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +124 -0
  371. package/src/sap/m/p13n/modules/StateHandlerRegistry.js +101 -0
  372. package/src/sap/m/p13n/modules/UIManager.js +230 -0
  373. package/src/sap/m/p13n/modules/xConfigAPI.js +286 -0
  374. package/src/sap/m/plugins/ColumnResizer.js +15 -1
  375. package/src/sap/m/plugins/DataStateIndicator.js +12 -4
  376. package/src/sap/m/plugins/PasteProvider.js +1 -1
  377. package/src/sap/m/plugins/PluginBase.js +2 -2
  378. package/src/sap/m/rules/DatePicker.support.js +4 -3
  379. package/src/sap/m/semantic/AddAction.js +1 -1
  380. package/src/sap/m/semantic/CancelAction.js +1 -1
  381. package/src/sap/m/semantic/DeleteAction.js +1 -1
  382. package/src/sap/m/semantic/DetailPage.js +1 -1
  383. package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
  384. package/src/sap/m/semantic/EditAction.js +1 -1
  385. package/src/sap/m/semantic/FavoriteAction.js +1 -1
  386. package/src/sap/m/semantic/FilterAction.js +1 -1
  387. package/src/sap/m/semantic/FilterSelect.js +1 -1
  388. package/src/sap/m/semantic/FlagAction.js +1 -1
  389. package/src/sap/m/semantic/ForwardAction.js +1 -1
  390. package/src/sap/m/semantic/FullscreenPage.js +1 -1
  391. package/src/sap/m/semantic/GroupAction.js +1 -1
  392. package/src/sap/m/semantic/GroupSelect.js +1 -1
  393. package/src/sap/m/semantic/MainAction.js +1 -1
  394. package/src/sap/m/semantic/MasterPage.js +1 -1
  395. package/src/sap/m/semantic/MessagesIndicator.js +1 -1
  396. package/src/sap/m/semantic/MultiSelectAction.js +1 -1
  397. package/src/sap/m/semantic/NegativeAction.js +1 -1
  398. package/src/sap/m/semantic/OpenInAction.js +1 -1
  399. package/src/sap/m/semantic/PositiveAction.js +1 -1
  400. package/src/sap/m/semantic/PrintAction.js +1 -1
  401. package/src/sap/m/semantic/SaveAction.js +1 -1
  402. package/src/sap/m/semantic/Segment.js +1 -1
  403. package/src/sap/m/semantic/SegmentedContainer.js +1 -1
  404. package/src/sap/m/semantic/SemanticButton.js +1 -1
  405. package/src/sap/m/semantic/SemanticConfiguration.js +1 -1
  406. package/src/sap/m/semantic/SemanticControl.js +1 -1
  407. package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +3 -3
  408. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +3 -3
  409. package/src/sap/m/semantic/SemanticPage.js +1 -1
  410. package/src/sap/m/semantic/SemanticSelect.js +1 -1
  411. package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
  412. package/src/sap/m/semantic/SendEmailAction.js +1 -1
  413. package/src/sap/m/semantic/SendMessageAction.js +1 -1
  414. package/src/sap/m/semantic/ShareInJamAction.js +1 -1
  415. package/src/sap/m/semantic/ShareMenu.js +1 -1
  416. package/src/sap/m/semantic/ShareMenuPage.js +1 -1
  417. package/src/sap/m/semantic/SortAction.js +1 -1
  418. package/src/sap/m/semantic/SortSelect.js +1 -1
  419. package/src/sap/m/table/Util.js +8 -3
  420. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  421. package/src/sap/m/table/columnmenu/Entry.js +1 -1
  422. package/src/sap/m/table/columnmenu/Item.js +1 -1
  423. package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
  424. package/src/sap/m/table/columnmenu/Menu.js +9 -3
  425. package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
  426. package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
  427. package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
  428. package/src/sap/m/table/columnmenu/QuickGroup.js +21 -1
  429. package/src/sap/m/table/columnmenu/QuickGroupItem.js +13 -1
  430. package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
  431. package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
  432. package/src/sap/m/table/columnmenu/QuickTotal.js +21 -1
  433. package/src/sap/m/table/columnmenu/QuickTotalItem.js +13 -1
  434. package/src/sap/m/themes/base/ActionListItem.less +1 -1
  435. package/src/sap/m/themes/base/Breadcrumbs.less +17 -0
  436. package/src/sap/m/themes/base/CheckBox.less +2 -0
  437. package/src/sap/m/themes/base/Dialog.less +1 -2
  438. package/src/sap/m/themes/base/FeedContent.less +13 -5
  439. package/src/sap/m/themes/base/GenericTag.less +5 -3
  440. package/src/sap/m/themes/base/GenericTile.less +13 -9
  441. package/src/sap/m/themes/base/IllustratedMessage.less +7 -0
  442. package/src/sap/m/themes/base/LightBox.less +0 -12
  443. package/src/sap/m/themes/base/MessageBox.less +4 -3
  444. package/src/sap/m/themes/base/NumericContent.less +1 -1
  445. package/src/sap/m/themes/base/ObjectNumber.less +5 -0
  446. package/src/sap/m/themes/base/ObjectStatus.less +2 -1
  447. package/src/sap/m/themes/base/OverflowToolbarAssociativePopover.less +5 -1
  448. package/src/sap/m/themes/base/ProgressIndicator.less +0 -4
  449. package/src/sap/m/themes/base/Select.less +1 -3
  450. package/src/sap/m/themes/base/SelectList.less +0 -5
  451. package/src/sap/m/themes/base/SinglePlanningCalendarGrid.less +7 -0
  452. package/src/sap/m/themes/base/SlideTile.less +5 -4
  453. package/src/sap/m/themes/base/StandardListItem.less +1 -0
  454. package/src/sap/m/themes/base/Table.less +11 -1
  455. package/src/sap/m/themes/base/TimePickerClock.less +7 -0
  456. package/src/sap/m/themes/base/Title.less +1 -1
  457. package/src/sap/m/upload/UploadSet.js +98 -15
  458. package/src/sap/m/upload/UploadSetItem.js +16 -4
  459. package/src/sap/m/upload/UploadSetRenderer.js +8 -16
  460. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +2 -1
@@ -0,0 +1,563 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ 'sap/base/util/array/diff',
9
+ 'sap/ui/base/Object',
10
+ 'sap/base/util/merge',
11
+ 'sap/base/util/deepEqual',
12
+ 'sap/ui/model/json/JSONModel',
13
+ 'sap/m/p13n/SelectionPanel',
14
+ 'sap/m/p13n/modules/xConfigAPI'
15
+ ], function (diff, BaseObject, merge, deepEqual, JSONModel, SelectionPanel, xConfigAPI) {
16
+ "use strict";
17
+
18
+ /**
19
+ * Constructor for a new <code>SelectionController</code>.
20
+ *
21
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
22
+ * @param {object} [mSettings] Initial settings for the new control
23
+ * @param {sap.ui.core.Control} mSettings.control The control instance to be personalized by this controller
24
+ * @param {string} mSettings.targetAggregation The name of the personalized aggregation
25
+ *
26
+ * @class
27
+ * The <code>SelectionController</code> serves as base class to create control specific personalization implementations.
28
+ *
29
+ * @extends sap.ui.base.Object
30
+ *
31
+ * @author SAP SE
32
+ * @version 1.104.0
33
+ *
34
+ * @public
35
+ * @experimental Since 1.104. Please note that the API of this control is not yet finalized!
36
+ * @alias sap.m.p13n.SelectionController
37
+ */
38
+ var SelectionController = BaseObject.extend("sap.m.p13n.SelectionController",{
39
+ constructor: function(mSettings) {
40
+ BaseObject.call(this);
41
+
42
+ this._sTargetAggregation = mSettings.targetAggregation;
43
+ this._fSelector = mSettings.selector;
44
+ this._oAdaptationControl = mSettings.control;
45
+ this._oP13nData = null;
46
+ this._bLiveMode = false;
47
+ this._bResetEnabled = false;
48
+
49
+ }
50
+ });
51
+
52
+ /**
53
+ * The control that is being personalized via this controller.
54
+ *
55
+ * @returns {sap.ui.mdc.Control} The control which is being adapted.
56
+ */
57
+ SelectionController.prototype.getAdaptationControl = function(){
58
+ return this._oAdaptationControl;
59
+ };
60
+
61
+ SelectionController.prototype.getTargetAggregation = function(){
62
+ return this._sTargetAggregation;
63
+ };
64
+
65
+
66
+ /**
67
+ * Defines the available ChangeTypes (should be in sync with 'getDelta').
68
+ *
69
+ * @returns {object} A map of legal change types.
70
+ */
71
+ SelectionController.prototype.getChangeOperations = function() {
72
+ return {
73
+ add: "addItem",
74
+ remove: "removeItem",
75
+ move: "moveItem"
76
+ };
77
+ };
78
+
79
+ /**
80
+ * Defines which control(s) are considered for the reset.
81
+ *
82
+ * @returns {sap.ui.core.Control|sap.ui.core.Control[]}
83
+ */
84
+ SelectionController.prototype.getSelectorForReset = function() {
85
+ return this._oAdaptationControl;
86
+ };
87
+
88
+ SelectionController.prototype.sanityCheck = function(oState) {
89
+ return oState;
90
+ };
91
+
92
+ /**
93
+ * The actual UI used for personalization.
94
+ *
95
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
96
+ * @returns {sap.ui.core.Control|string|Promise} The control which is going to be used in the p13n container.
97
+ */
98
+ SelectionController.prototype.initAdaptationUI = function(oPropertyHelper){
99
+ var oAdaptationData = this.mixInfoAndState(oPropertyHelper);
100
+ return this.retrieveUI(oAdaptationData)
101
+ .then(function(oSelectionPanel){
102
+ this._oPanel = oSelectionPanel;
103
+ return Promise.resolve(oSelectionPanel);
104
+ }.bind(this));
105
+ };
106
+
107
+ SelectionController.prototype.retrieveUI = function(oAdaptationData) {
108
+ var oSelectionPanel = new SelectionPanel({
109
+ showHeader: true,
110
+ enableCount: true
111
+ });
112
+ oSelectionPanel.setP13nData(oAdaptationData.items);
113
+ return Promise.resolve(oSelectionPanel);
114
+ };
115
+
116
+ SelectionController.prototype.getCurrentState = function(){
117
+ var aState = [], aAggregationItems = this.getAdaptationControl().getAggregation(this.getTargetAggregation()) || [];
118
+ aAggregationItems.forEach(function(oItem, iIndex) {
119
+ var bRelevant = this._fSelector ? this._fSelector({key: oItem.getId()}) : oItem.getVisible();
120
+ if (bRelevant) {
121
+ aState.push({
122
+ key: oItem.getId()
123
+ });
124
+ }
125
+ }.bind(this));
126
+
127
+ var oXConfig = xConfigAPI.readConfig(this.getAdaptationControl()) || {};
128
+ var oItemXConfig = oXConfig.hasOwnProperty("aggregations") ? oXConfig.aggregations[this._sTargetAggregation] : {};
129
+
130
+ for (var sKey in oItemXConfig) {
131
+ var aStateKeys = aState.map(function(o){return o.key;});
132
+ var iCurrentIndex = aStateKeys.indexOf(sKey);
133
+ var iNewIndex = oItemXConfig[sKey].position;
134
+
135
+ if (oItemXConfig[sKey].visible === true && iCurrentIndex === -1) {
136
+ aState.push({
137
+ key: sKey
138
+ });
139
+ }
140
+
141
+ if (iNewIndex !== undefined && aState.length > 0) {
142
+ var oItem = aState.splice(iCurrentIndex, 1)[0];
143
+ aState.splice(iNewIndex, 0, oItem);
144
+ iCurrentIndex = iNewIndex;
145
+ }
146
+ if (oItemXConfig[sKey].visible === false && iCurrentIndex > -1) {
147
+ aState.splice(iCurrentIndex, 1);
148
+ }
149
+
150
+
151
+ }
152
+ return aState;
153
+ };
154
+
155
+ SelectionController.prototype.getStateKey = function(){
156
+ return "items";
157
+ };
158
+
159
+ SelectionController.prototype.getDelta = function(mPropertyBag) {
160
+ var sPresenceAttribute = this._getPresenceAttribute(mPropertyBag.externalAppliance);
161
+ var aNewStatePrepared;
162
+
163
+ var fnFilterUnselected = function (oItem) {
164
+ return oItem.hasOwnProperty(sPresenceAttribute) && oItem[sPresenceAttribute] === false ? false : true;
165
+ };
166
+ aNewStatePrepared = mPropertyBag.applyAbsolute
167
+ ? mPropertyBag.changedState.filter(fnFilterUnselected) :
168
+ this._getFilledArray(mPropertyBag.existingState, mPropertyBag.changedState, sPresenceAttribute).filter(fnFilterUnselected);
169
+
170
+ mPropertyBag.changedState = aNewStatePrepared;
171
+
172
+ //Example: Dialog Ok --> don't trigger unnecessary flex change processing
173
+ if (deepEqual(mPropertyBag.existingState, aNewStatePrepared)){
174
+ return [];
175
+ } else {
176
+ return this.getArrayDeltaChanges(mPropertyBag);
177
+ }
178
+
179
+ };
180
+
181
+ /**
182
+ * Generates a set of changes based on the given arrays for a specified control
183
+ *
184
+ * @param {object} mDeltaInfo Map containing the necessary information to calculate the diff as change objects
185
+ * @param {array} mDeltaInfo.existingState An array describing the control state before a adaptation
186
+ * @param {array} mDeltaInfo.changedState An array describing the control state after a certain adaptation
187
+ * @param {object} mDeltaInfo.control Control instance which is being used to generate the changes
188
+ * @param {object} mDeltaInfo.changeOperations Map containing the changeOperations for the given Control instance
189
+ * @param {string} mDeltaInfo.changeOperations.add Name of the control specific 'add' changehandler
190
+ * @param {string} mDeltaInfo.changeOperations.remove Name of the control specific 'remove' changehandler
191
+ * @param {string} [mDeltaInfo.changeOperations.move] Name of the control specific 'move' changehandler
192
+ * @param {string} [mDeltaInfo.generator] Name of the change generator (E.g. the namespace of the UI creating the change object)
193
+ *
194
+ * @returns {array} Array containing the delta based created changes
195
+ */
196
+ SelectionController.prototype.getArrayDeltaChanges = function (mDeltaInfo) {
197
+
198
+ var aExistingArray = mDeltaInfo.existingState;
199
+ var aChangedArray = mDeltaInfo.changedState;
200
+ var oControl = mDeltaInfo.control;
201
+ var sInsertOperation = mDeltaInfo.changeOperations.add;
202
+ var sRemoveOperation = mDeltaInfo.changeOperations.remove;
203
+ var sMoveOperation = mDeltaInfo.changeOperations.move;
204
+ var sGenerator = mDeltaInfo.generator;
205
+
206
+ var aDeltaAttributes = mDeltaInfo.deltaAttributes || [];
207
+
208
+ var fnSymbol = function(o) {
209
+ var sDiff = "";
210
+ aDeltaAttributes.forEach(function(sAttribute){
211
+ sDiff = sDiff + o[sAttribute];
212
+ });
213
+ return sDiff;
214
+ };
215
+
216
+ var aResults = diff(aExistingArray, aChangedArray, fnSymbol);
217
+ // Function to match field with exising field in the given array
218
+ var fMatch = function (oField, aArray) {
219
+ return aArray.filter(function (oExistingField) {
220
+ return oExistingField && (oExistingField.key === oField.key);
221
+ })[0];
222
+ };
223
+
224
+ var aChanges = [];
225
+ var aProcessedArray = aExistingArray.slice(0);
226
+
227
+ aResults.forEach(function (oResult) {
228
+ // Begin --> hack for handling result returned by diff
229
+ if (oResult.type === "delete" && aProcessedArray[oResult.index] === undefined) {
230
+ aProcessedArray.splice(oResult.index, 1);
231
+ return;
232
+ }
233
+
234
+ var oProp, oExistingProp, iLength;
235
+ if (oResult.type === "insert") {
236
+ oExistingProp = fMatch(aChangedArray[oResult.index], aProcessedArray);
237
+ if (oExistingProp) {
238
+ oExistingProp.index = aProcessedArray.indexOf(oExistingProp);
239
+ aProcessedArray.splice(oExistingProp.index, 1, undefined);
240
+ aChanges = aChanges.concat(this._createAddRemoveChange(oControl, sRemoveOperation, this._getChangeContent(oExistingProp, aDeltaAttributes), sGenerator));
241
+ }
242
+ }
243
+ // End hack
244
+ oProp = oResult.type === "delete" ? aProcessedArray[oResult.index] : aChangedArray[oResult.index];
245
+ oProp.index = oResult.index;
246
+ if (oResult.type === "delete") {
247
+ aProcessedArray.splice(oProp.index, 1);
248
+ } else {
249
+ aProcessedArray.splice(oProp.index, 0, oProp);
250
+ }
251
+ // Move operation shows up as insert followed by delete OR delete followed by insert
252
+ if (sMoveOperation) {
253
+ iLength = aChanges.length;
254
+ // Get the last added change
255
+ if (iLength) {
256
+ oExistingProp = aChanges[iLength - 1];
257
+ oExistingProp = oExistingProp ? oExistingProp.changeSpecificData.content : undefined;
258
+ }
259
+ // Matching property exists with a different index --> then this is a move operation
260
+ if (oExistingProp && oExistingProp.key === oProp.key && oResult.index != oExistingProp.index) {
261
+ // remove the last insert/delete operation
262
+ aChanges.pop();
263
+ aChanges = aChanges.concat(this._createMoveChange(oExistingProp.id, oExistingProp.key, oResult.index, sMoveOperation, oControl, sMoveOperation !== "moveSort", sGenerator));
264
+ return;
265
+ }
266
+ }
267
+
268
+ aChanges = aChanges.concat(this._createAddRemoveChange(oControl, oResult.type === "delete" ? sRemoveOperation : sInsertOperation, this._getChangeContent(oProp, aDeltaAttributes), sGenerator));
269
+
270
+ }.bind(this));
271
+ return aChanges;
272
+ };
273
+
274
+ /**
275
+ * Method which reduces a propertyinfo map to changecontent relevant attributes.
276
+ * <b>Note:</b> This method determines the attributes stored in the changeContent.
277
+ *
278
+ * @param {object} oProperty Object containing all values prior to change creation
279
+ * @param {array} aDeltaAttributes Array containing all attributes that are necessary for the delta calculation
280
+ *
281
+ * @returns {object} Object containing reduced content
282
+ */
283
+ SelectionController.prototype._getChangeContent = function (oProperty, aDeltaAttributes) {
284
+
285
+ var oChangeContent = {};
286
+
287
+ // Index
288
+ if (oProperty.index >= 0) {
289
+ oChangeContent.index = oProperty.index;
290
+ }
291
+
292
+ aDeltaAttributes.forEach(function(sAttribute) {
293
+ if (oProperty.hasOwnProperty(sAttribute)){
294
+ oChangeContent[sAttribute] = oProperty[sAttribute];
295
+ }
296
+ });
297
+
298
+ return oChangeContent;
299
+ };
300
+
301
+ SelectionController.prototype._createAddRemoveChange = function(oControl, sOperation, oContent){
302
+ var oAddRemoveChange = {
303
+ selectorElement: oControl,
304
+ changeSpecificData: {
305
+ changeType: sOperation,
306
+ content: {
307
+ key: oContent.key,
308
+ targetAggregation: this.getTargetAggregation(),
309
+ index: oContent.index,
310
+ value: sOperation === this.getChangeOperations()["add"]
311
+ }
312
+ }
313
+ };
314
+ return oAddRemoveChange;
315
+ };
316
+
317
+ SelectionController.prototype._createMoveChange = function(sId, sPropertykey, iNewIndex, sMoveOperation, oControl, bPersistId){
318
+ var oMoveChange = {
319
+ selectorElement: oControl,
320
+ changeSpecificData: {
321
+ changeType: sMoveOperation,
322
+ content: {
323
+ key: sPropertykey,
324
+ targetAggregation: this.getTargetAggregation(),
325
+ index: iNewIndex
326
+ }
327
+ }
328
+ };
329
+ return oMoveChange;
330
+ };
331
+ SelectionController.prototype._getPresenceAttribute = function(bexternalAppliance){
332
+ return "visible";
333
+ };
334
+
335
+ /**
336
+ * Allows calculations prior to applying a set of changes.
337
+ * This can be used to mix additional changes to auto-created changes.
338
+ *
339
+ * @returns {Promise} A Promise that should resolve with an array of additional changes.
340
+ */
341
+ SelectionController.prototype.getBeforeApply = function(){
342
+ return Promise.resolve();
343
+ };
344
+
345
+ /**
346
+ * Initialized the inner model for the Personalization.
347
+ *
348
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The propertyhelper that should be utilized for property determination.
349
+ * @returns {object} The personalization model data
350
+ */
351
+ SelectionController.prototype.mixInfoAndState = function(oPropertyHelper) {
352
+
353
+ var aItemState = this.getCurrentState();
354
+ var mItemState = this.arrayToMap(aItemState);
355
+
356
+ var oP13nData = this.prepareAdaptationData(oPropertyHelper, function(mItem, oProperty){
357
+ var oExisting = mItemState[oProperty.key];
358
+ mItem.visible = this._fSelector ? this._fSelector(oProperty) : (!!oExisting);
359
+ mItem.position = oExisting ? oExisting.position : -1;
360
+ return !(oProperty.visible === false);
361
+ }.bind(this));
362
+
363
+ this.sortP13nData({
364
+ visible: "visible",
365
+ position: "position"
366
+ }, oP13nData.items);
367
+
368
+ oP13nData.items.forEach(function(oItem){delete oItem.position;});
369
+ return oP13nData;
370
+ };
371
+
372
+ /**
373
+ * @returns {object} The personalization data.
374
+ *
375
+ */
376
+ SelectionController.prototype.getP13nData = function() {
377
+ return this._oPanel ? this._oPanel.getP13nData() : this._oAdaptationModel.getProperty("/items");
378
+ };
379
+
380
+ SelectionController.prototype.model2State = false;
381
+
382
+ /**
383
+ * Can be used to trigger update after UI interactions such as "Ok" and "Reset"
384
+ *
385
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
386
+ */
387
+ SelectionController.prototype.update = function(oPropertyHelper) {
388
+ if (this._oPanel) {
389
+ var oAdaptationData = this.mixInfoAndState(oPropertyHelper);
390
+ this._oPanel.setP13nData(oAdaptationData.items);
391
+ } else if (this._oAdaptationModel){
392
+ //'setData' causes unnecessary rerendering in some cases
393
+ var oP13nData = this.mixInfoAndState(oPropertyHelper);
394
+ this._oAdaptationModel.setProperty("/items", oP13nData.items);
395
+ this._oAdaptationModel.setProperty("/itemsGrouped", oP13nData.itemsGrouped);
396
+ }
397
+ };
398
+
399
+ SelectionController.prototype._getFilledArray = function(aPreviousItems, aNewItems, sRemoveProperty) {
400
+ var aNewItemsPrepared = merge([], aPreviousItems);
401
+ var aNewItemState = merge([], aNewItems);
402
+
403
+ var mExistingItems = this.arrayToMap(aPreviousItems);
404
+
405
+ aNewItemState.forEach(function (oItem) {
406
+ var oExistingItem = mExistingItems[oItem.key];
407
+ if (!oItem.hasOwnProperty(sRemoveProperty) || oItem[sRemoveProperty]) {
408
+ var iNewPosition = oItem.position;
409
+ if (oExistingItem){//move if it exists
410
+ // do not reorder it in case it exists and no position is provided
411
+ iNewPosition = iNewPosition > -1 ? iNewPosition : oExistingItem.position;
412
+ var iOldPosition = oExistingItem.position;
413
+ aNewItemsPrepared.splice(iNewPosition, 0, aNewItemsPrepared.splice(iOldPosition, 1)[0]);
414
+ } else {//add if it does not exist the item will be inserted at the end
415
+ iNewPosition = iNewPosition > -1 ? iNewPosition : aNewItemsPrepared.length;
416
+ aNewItemsPrepared.splice(iNewPosition, 0, oItem);
417
+ }
418
+ aNewItemsPrepared[iNewPosition] = oItem;//overwrite existing item with new item (for correct values such as 'descending')
419
+ } else if (oExistingItem) {//check if exists before delete
420
+ aNewItemsPrepared[oExistingItem.position][sRemoveProperty] = false;
421
+ }
422
+ });
423
+
424
+ return aNewItemsPrepared;
425
+ };
426
+
427
+ /**
428
+ *
429
+ * Getter for the personalization model
430
+ *
431
+ * @param {sap.ui.mdc.util.PropertyHelper} oPropertyHelper The property helper instance
432
+ * @returns {sap.ui.model.json.JSONModel} The personalization model.
433
+ *
434
+ */
435
+ SelectionController.prototype._getP13nModel = function(oPropertyHelper) {
436
+ if (!this._oAdaptationModel) {
437
+ this._oAdaptationModel = new JSONModel(this.mixInfoAndState(oPropertyHelper));
438
+ this._oP13nData = this._oAdaptationModel.getData();
439
+ this._oAdaptationModel.setSizeLimit(10000);
440
+ } else {
441
+ this.update(oPropertyHelper);
442
+ }
443
+
444
+ return this._oAdaptationModel;
445
+ };
446
+
447
+ SelectionController.prototype.changesToState = function(aChanges) {
448
+
449
+ var aState = [];
450
+
451
+ aChanges.forEach(function(oChange){
452
+ var oStateDiffContent = merge({}, oChange.changeSpecificData.content);
453
+ var iIndex = oStateDiffContent.index;
454
+ delete oStateDiffContent.index;
455
+
456
+ //set the position attribute in case to an explicit move
457
+ if (oChange.changeSpecificData.changeType === this.getChangeOperations()["move"]) {
458
+ oStateDiffContent.position = iIndex;
459
+ }
460
+
461
+ //set the presence attribute to false in case of an explicit remove
462
+ if (oChange.changeSpecificData.changeType === this.getChangeOperations()["remove"]) {
463
+ oStateDiffContent[this._getPresenceAttribute()] = false;
464
+ }
465
+
466
+ aState.push(oStateDiffContent);
467
+ }.bind(this));
468
+
469
+ return aState;
470
+ };
471
+
472
+ SelectionController.prototype.prepareAdaptationData = function(oPropertyHelper, fnEnhace, bGroupData) {
473
+
474
+ var aItems = [];
475
+ var mItemsGrouped = bGroupData ? {} : null;
476
+
477
+ var bEnhance = fnEnhace instanceof Function;
478
+
479
+ oPropertyHelper.getProperties().forEach(function(oProperty) {
480
+
481
+ var mItem = {};
482
+
483
+ if (bEnhance) {
484
+ var bIsValid = fnEnhace(mItem, oProperty);
485
+ if (!bIsValid) {
486
+ return;
487
+ }
488
+ }
489
+
490
+ mItem.key = oProperty.key;
491
+ mItem.name = oProperty.key;
492
+ mItem.label = oProperty.label || oProperty.key;
493
+ mItem.tooltip = oProperty.tooltip;
494
+
495
+ if (mItemsGrouped) {
496
+ mItem.group = oProperty.group ? oProperty.group : "BASIC";
497
+ mItem.groupLabel = oProperty.groupLabel;
498
+ mItemsGrouped[mItem.group] = mItemsGrouped[mItem.group] ? mItemsGrouped[mItem.group] : [];
499
+ mItemsGrouped[mItem.group].push(mItem);
500
+ }
501
+
502
+ aItems.push(mItem);
503
+
504
+ });
505
+
506
+ var oAdaptationData = {
507
+ items: aItems
508
+ };
509
+
510
+ if (mItemsGrouped) {
511
+ oAdaptationData.itemsGrouped = this._buildGroupStructure(mItemsGrouped);
512
+ }
513
+
514
+ return oAdaptationData;
515
+
516
+ };
517
+
518
+ //TODO: generify
519
+ SelectionController.prototype.sortP13nData = function (oSorting, aItems) {
520
+
521
+ var mP13nTypeSorting = oSorting;
522
+
523
+ var sPositionAttribute = mP13nTypeSorting.position;
524
+ var sSelectedAttribute = mP13nTypeSorting.visible;
525
+
526
+ var sLocale = sap.ui.getCore().getConfiguration().getLocale().toString();
527
+
528
+ var oCollator = window.Intl.Collator(sLocale, {});
529
+
530
+ // group selected / unselected --> sort alphabetically in each group
531
+ aItems.sort(function (mField1, mField2) {
532
+ if (mField1[sSelectedAttribute] && mField2[sSelectedAttribute]) {
533
+ return (mField1[sPositionAttribute] || 0) - (mField2[sPositionAttribute] || 0);
534
+ } else if (mField1[sSelectedAttribute]) {
535
+ return -1;
536
+ } else if (mField2[sSelectedAttribute]) {
537
+ return 1;
538
+ } else if (!mField1[sSelectedAttribute] && !mField2[sSelectedAttribute]) {
539
+ return oCollator.compare(mField1.label, mField2.label);
540
+ }
541
+ });
542
+ };
543
+
544
+ SelectionController.prototype.arrayToMap = function(aArray) {
545
+ return aArray.reduce(function(mMap, oProp, iIndex){
546
+ mMap[oProp.key] = oProp;
547
+ mMap[oProp.key].position = iIndex;
548
+ return mMap;
549
+ }, {});
550
+ };
551
+
552
+ SelectionController.prototype.destroy = function() {
553
+ BaseObject.prototype.destroy.apply(this, arguments);
554
+ this._oAdaptationControl = null;
555
+ this._bLiveMode = null;
556
+ this._oPanel = null;
557
+ this._bResetEnabled = null;
558
+ this._oAdaptationModel = null;
559
+ };
560
+
561
+ return SelectionController;
562
+
563
+ });
@@ -48,7 +48,7 @@ sap.ui.define([
48
48
  * @extends sap.m.p13n.BasePanel
49
49
  *
50
50
  * @author SAP SE
51
- * @version 1.102.2
51
+ * @version 1.104.0
52
52
  *
53
53
  * @public
54
54
  * @experimental Since 1.96.
@@ -59,6 +59,15 @@ sap.ui.define([
59
59
  metadata: {
60
60
  library: "sap.m",
61
61
  properties: {
62
+ /**
63
+ * A short text describing the panel.
64
+ * <b>Note:</b> This text will only be displayed if the panel is being used in a <code>sap.m.p13n.Popup</code>.
65
+ */
66
+ title: {
67
+ type: "string",
68
+ defaultValue: sap.ui.getCore().getLibraryResourceBundle("sap.m").getText("p13n.DEFAULT_TITLE_SELECTION")
69
+ },
70
+ /**
62
71
  /**
63
72
  * Shows an additional header with a search field and the Show Selected button.
64
73
  */
@@ -284,6 +293,7 @@ sap.ui.define([
284
293
  * Sets the personalization state of the panel instance.
285
294
  * @public
286
295
  * @param {sap.m.p13n.Item[]} aP13nData An array containing the personalization state that is represented by the <code>SelectionPanel</code>.
296
+ * @returns {this} The <code>SelectionPanel</code> instance
287
297
  */
288
298
  SelectionPanel.prototype.setP13nData = function(aP13nData) {
289
299
  if (this.getEnableCount()) {
@@ -298,6 +308,8 @@ sap.ui.define([
298
308
  //remove the reorder buttons from their current location and hence reset the hover logic
299
309
  this._removeMoveButtons();
300
310
  this._oSelectedItem = null;
311
+
312
+ return this;
301
313
  };
302
314
 
303
315
  SelectionPanel.prototype._updateCount = function() {