@openui5/sap.m 1.115.1 → 1.117.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 (465) hide show
  1. package/.reuse/dep5 +0 -5
  2. package/THIRDPARTY.txt +1 -7
  3. package/package.json +4 -4
  4. package/src/sap/m/.library +1 -1
  5. package/src/sap/m/AccButton.js +1 -1
  6. package/src/sap/m/ActionListItem.js +1 -1
  7. package/src/sap/m/ActionSelect.js +1 -1
  8. package/src/sap/m/ActionSheet.js +6 -2
  9. package/src/sap/m/ActionTile.js +1 -1
  10. package/src/sap/m/ActionTileContent.js +1 -1
  11. package/src/sap/m/AdditionalTextButton.js +1 -1
  12. package/src/sap/m/App.js +1 -1
  13. package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
  14. package/src/sap/m/Avatar.js +46 -5
  15. package/src/sap/m/AvatarRenderer.js +16 -10
  16. package/src/sap/m/Bar.js +1 -1
  17. package/src/sap/m/Breadcrumbs.js +6 -5
  18. package/src/sap/m/BusyDialog.js +5 -3
  19. package/src/sap/m/BusyIndicator.js +1 -1
  20. package/src/sap/m/Button.js +1 -1
  21. package/src/sap/m/Carousel.js +24 -8
  22. package/src/sap/m/CarouselLayout.js +1 -1
  23. package/src/sap/m/CarouselRenderer.js +19 -4
  24. package/src/sap/m/CheckBox.js +8 -4
  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 +29 -170
  28. package/src/sap/m/ColumnHeaderPopover.js +1 -1
  29. package/src/sap/m/ColumnListItem.js +7 -12
  30. package/src/sap/m/ColumnListItemRenderer.js +16 -27
  31. package/src/sap/m/ColumnPopoverActionItem.js +1 -1
  32. package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
  33. package/src/sap/m/ColumnPopoverItem.js +1 -1
  34. package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
  35. package/src/sap/m/ColumnPopoverSortItem.js +1 -1
  36. package/src/sap/m/ComboBox.js +1 -1
  37. package/src/sap/m/ComboBoxBase.js +1 -1
  38. package/src/sap/m/ComboBoxTextField.js +1 -1
  39. package/src/sap/m/CustomListItem.js +1 -1
  40. package/src/sap/m/CustomTile.js +1 -1
  41. package/src/sap/m/CustomTreeItem.js +1 -1
  42. package/src/sap/m/DatePicker.js +31 -5
  43. package/src/sap/m/DatePickerRenderer.js +3 -2
  44. package/src/sap/m/DateRangeSelection.js +77 -25
  45. package/src/sap/m/DateTimeField.js +15 -10
  46. package/src/sap/m/DateTimeInput.js +1 -1
  47. package/src/sap/m/DateTimePicker.js +1 -1
  48. package/src/sap/m/DateTimePickerRenderer.js +3 -1
  49. package/src/sap/m/Dialog.js +16 -10
  50. package/src/sap/m/DialogRenderer.js +3 -3
  51. package/src/sap/m/DisplayListItem.js +1 -1
  52. package/src/sap/m/DraftIndicator.js +1 -1
  53. package/src/sap/m/DynamicDate.js +1 -1
  54. package/src/sap/m/DynamicDateOption.js +2 -2
  55. package/src/sap/m/DynamicDateRange.js +42 -5
  56. package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
  57. package/src/sap/m/ExpandableText.js +1 -1
  58. package/src/sap/m/FacetFilter.js +1 -3
  59. package/src/sap/m/FacetFilterItem.js +1 -1
  60. package/src/sap/m/FacetFilterList.js +1 -1
  61. package/src/sap/m/FeedContent.js +1 -1
  62. package/src/sap/m/FeedInput.js +1 -1
  63. package/src/sap/m/FeedListItem.js +18 -1
  64. package/src/sap/m/FeedListItemAction.js +1 -1
  65. package/src/sap/m/Fiori20Adapter.js +2 -2
  66. package/src/sap/m/FlexBox.js +1 -1
  67. package/src/sap/m/FlexItemData.js +1 -1
  68. package/src/sap/m/FormattedText.js +44 -50
  69. package/src/sap/m/GenericTag.js +1 -1
  70. package/src/sap/m/GenericTile.js +1 -1
  71. package/src/sap/m/GroupHeaderListItem.js +1 -1
  72. package/src/sap/m/GroupHeaderListItemRenderer.js +5 -5
  73. package/src/sap/m/GrowingEnablement.js +34 -32
  74. package/src/sap/m/GrowingList.js +1 -1
  75. package/src/sap/m/HBox.js +1 -1
  76. package/src/sap/m/HeaderContainer.js +1 -1
  77. package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
  78. package/src/sap/m/HyphenationSupport.js +13 -4
  79. package/src/sap/m/IconTabBar.js +3 -1
  80. package/src/sap/m/IconTabBarSelectList.js +1 -1
  81. package/src/sap/m/IconTabFilter.js +3 -3
  82. package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
  83. package/src/sap/m/IconTabHeader.js +1 -1
  84. package/src/sap/m/IconTabSeparator.js +1 -1
  85. package/src/sap/m/IllustratedMessage.js +4 -2
  86. package/src/sap/m/Illustration.js +1 -1
  87. package/src/sap/m/IllustrationPool.js +4 -3
  88. package/src/sap/m/Image.js +1 -1
  89. package/src/sap/m/ImageContent.js +1 -1
  90. package/src/sap/m/Input.js +21 -12
  91. package/src/sap/m/InputBase.js +7 -5
  92. package/src/sap/m/InputBaseRenderer.js +3 -3
  93. package/src/sap/m/InputListItem.js +1 -1
  94. package/src/sap/m/Label.js +1 -1
  95. package/src/sap/m/LabelRenderer.js +3 -3
  96. package/src/sap/m/LightBox.js +1 -1
  97. package/src/sap/m/LightBoxItem.js +1 -1
  98. package/src/sap/m/Link.js +36 -3
  99. package/src/sap/m/List.js +1 -1
  100. package/src/sap/m/ListBase.js +61 -28
  101. package/src/sap/m/ListBaseRenderer.js +12 -4
  102. package/src/sap/m/ListItemBase.js +17 -8
  103. package/src/sap/m/ListItemBaseRenderer.js +6 -6
  104. package/src/sap/m/MaskEnabler.js +1 -1
  105. package/src/sap/m/MaskInput.js +1 -1
  106. package/src/sap/m/MaskInputRule.js +1 -1
  107. package/src/sap/m/Menu.js +14 -1
  108. package/src/sap/m/MenuButton.js +1 -1
  109. package/src/sap/m/MenuItem.js +1 -1
  110. package/src/sap/m/MenuListItem.js +1 -1
  111. package/src/sap/m/MessageItem.js +1 -1
  112. package/src/sap/m/MessageListItem.js +1 -1
  113. package/src/sap/m/MessagePage.js +1 -1
  114. package/src/sap/m/MessagePopover.js +1 -1
  115. package/src/sap/m/MessagePopoverItem.js +1 -1
  116. package/src/sap/m/MessageStrip.js +1 -1
  117. package/src/sap/m/MessageToast.js +1 -12
  118. package/src/sap/m/MessageView.js +2 -2
  119. package/src/sap/m/MultiComboBox.js +3 -3
  120. package/src/sap/m/MultiEditField.js +1 -1
  121. package/src/sap/m/MultiInput.js +13 -2
  122. package/src/sap/m/NavContainer.js +21 -5
  123. package/src/sap/m/NewsContent.js +1 -1
  124. package/src/sap/m/NotificationList.js +1 -1
  125. package/src/sap/m/NotificationListBase.js +1 -1
  126. package/src/sap/m/NotificationListGroup.js +1 -1
  127. package/src/sap/m/NotificationListItem.js +1 -1
  128. package/src/sap/m/NumericContent.js +1 -1
  129. package/src/sap/m/NumericInput.js +1 -1
  130. package/src/sap/m/ObjectAttribute.js +1 -1
  131. package/src/sap/m/ObjectHeader.js +6 -1
  132. package/src/sap/m/ObjectIdentifier.js +1 -1
  133. package/src/sap/m/ObjectListItem.js +9 -2
  134. package/src/sap/m/ObjectMarker.js +1 -1
  135. package/src/sap/m/ObjectNumber.js +1 -1
  136. package/src/sap/m/ObjectStatus.js +63 -4
  137. package/src/sap/m/ObjectStatusRenderer.js +21 -9
  138. package/src/sap/m/OverflowToolbar.js +30 -15
  139. package/src/sap/m/OverflowToolbarAssociativePopover.js +5 -5
  140. package/src/sap/m/OverflowToolbarButton.js +1 -1
  141. package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
  142. package/src/sap/m/OverflowToolbarMenuButton.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 +2 -8
  147. package/src/sap/m/P13nConditionPanel.js +1 -1
  148. package/src/sap/m/P13nDialog.js +2 -1
  149. package/src/sap/m/P13nDimMeasureItem.js +1 -1
  150. package/src/sap/m/P13nDimMeasurePanel.js +3 -10
  151. package/src/sap/m/P13nFilterItem.js +1 -1
  152. package/src/sap/m/P13nFilterPanel.js +28 -43
  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 +5 -3
  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 -1
  163. package/src/sap/m/Page.js +8 -6
  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 +11 -2
  167. package/src/sap/m/PanelRenderer.js +9 -0
  168. package/src/sap/m/PlanningCalendar.js +10 -4
  169. package/src/sap/m/PlanningCalendarHeader.js +1 -1
  170. package/src/sap/m/PlanningCalendarLegend.js +1 -1
  171. package/src/sap/m/PlanningCalendarRow.js +1 -1
  172. package/src/sap/m/PlanningCalendarView.js +1 -1
  173. package/src/sap/m/Popover.js +13 -17
  174. package/src/sap/m/ProgressIndicator.js +1 -1
  175. package/src/sap/m/PullToRefresh.js +1 -1
  176. package/src/sap/m/QuickView.js +1 -1
  177. package/src/sap/m/QuickViewBase.js +1 -1
  178. package/src/sap/m/QuickViewCard.js +14 -1
  179. package/src/sap/m/QuickViewCardRenderer.js +0 -4
  180. package/src/sap/m/QuickViewGroup.js +1 -1
  181. package/src/sap/m/QuickViewGroupElement.js +1 -1
  182. package/src/sap/m/QuickViewPage.js +40 -28
  183. package/src/sap/m/RadioButton.js +1 -1
  184. package/src/sap/m/RadioButtonGroup.js +1 -1
  185. package/src/sap/m/RangeSlider.js +1 -1
  186. package/src/sap/m/RatingIndicator.js +16 -4
  187. package/src/sap/m/RatingIndicatorRenderer.js +9 -2
  188. package/src/sap/m/ResponsivePopover.js +1 -1
  189. package/src/sap/m/ResponsiveScale.js +1 -1
  190. package/src/sap/m/ScrollBar.js +1 -1
  191. package/src/sap/m/ScrollContainer.js +3 -3
  192. package/src/sap/m/SearchField.js +8 -12
  193. package/src/sap/m/SearchFieldRenderer.js +5 -5
  194. package/src/sap/m/SegmentedButton.js +4 -2
  195. package/src/sap/m/SegmentedButtonItem.js +1 -1
  196. package/src/sap/m/SegmentedButtonRenderer.js +3 -3
  197. package/src/sap/m/Select.js +18 -16
  198. package/src/sap/m/SelectDialog.js +1 -1
  199. package/src/sap/m/SelectDialogBase.js +28 -4
  200. package/src/sap/m/SelectList.js +5 -6
  201. package/src/sap/m/SelectionDetails.js +1 -1
  202. package/src/sap/m/SelectionDetailsFacade.js +2 -2
  203. package/src/sap/m/SelectionDetailsItem.js +1 -1
  204. package/src/sap/m/SelectionDetailsItemLine.js +1 -1
  205. package/src/sap/m/Shell.js +1 -1
  206. package/src/sap/m/SimpleFixFlex.js +1 -1
  207. package/src/sap/m/SinglePlanningCalendar.js +1 -1
  208. package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
  209. package/src/sap/m/SinglePlanningCalendarGrid.js +1 -1
  210. package/src/sap/m/SinglePlanningCalendarMonthGrid.js +43 -43
  211. package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
  212. package/src/sap/m/SinglePlanningCalendarView.js +1 -1
  213. package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
  214. package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
  215. package/src/sap/m/SlideTile.js +1 -1
  216. package/src/sap/m/Slider.js +1 -1
  217. package/src/sap/m/SliderTooltip.js +1 -1
  218. package/src/sap/m/SliderTooltipBase.js +1 -1
  219. package/src/sap/m/SliderTooltipContainer.js +1 -1
  220. package/src/sap/m/SplitApp.js +1 -1
  221. package/src/sap/m/SplitButton.js +1 -1
  222. package/src/sap/m/SplitContainer.js +8 -13
  223. package/src/sap/m/StandardDynamicDateOption.js +2 -2
  224. package/src/sap/m/StandardListItem.js +1 -1
  225. package/src/sap/m/StandardTile.js +1 -1
  226. package/src/sap/m/StandardTileRenderer.js +1 -1
  227. package/src/sap/m/StandardTreeItem.js +1 -1
  228. package/src/sap/m/StepInput.js +3 -3
  229. package/src/sap/m/SuggestionItem.js +4 -2
  230. package/src/sap/m/SuggestionsPopover.js +1 -1
  231. package/src/sap/m/Switch.js +1 -1
  232. package/src/sap/m/TabContainer.js +1 -1
  233. package/src/sap/m/TabContainerItem.js +1 -1
  234. package/src/sap/m/TabStrip.js +1 -1
  235. package/src/sap/m/TabStripItem.js +1 -1
  236. package/src/sap/m/Table.js +59 -180
  237. package/src/sap/m/TablePersoController.js +1 -1
  238. package/src/sap/m/TablePersoDialog.js +1 -1
  239. package/src/sap/m/TablePersoProvider.js +4 -1
  240. package/src/sap/m/TableRenderer.js +98 -126
  241. package/src/sap/m/TableSelectDialog.js +1 -1
  242. package/src/sap/m/Text.js +1 -1
  243. package/src/sap/m/TextArea.js +1 -1
  244. package/src/sap/m/TextRenderer.js +3 -3
  245. package/src/sap/m/Tile.js +1 -1
  246. package/src/sap/m/TileContainer.js +1 -1
  247. package/src/sap/m/TileContent.js +1 -1
  248. package/src/sap/m/TileRenderer.js +7 -4
  249. package/src/sap/m/TimePicker.js +41 -12
  250. package/src/sap/m/TimePickerClock.js +1 -1
  251. package/src/sap/m/TimePickerClocks.js +1 -1
  252. package/src/sap/m/TimePickerClocksRenderer.js +6 -13
  253. package/src/sap/m/TimePickerInputs.js +1 -1
  254. package/src/sap/m/TimePickerInputsRenderer.js +6 -10
  255. package/src/sap/m/TimePickerInternals.js +1 -44
  256. package/src/sap/m/TimePickerRenderer.js +3 -2
  257. package/src/sap/m/TimePickerSlider.js +1 -1
  258. package/src/sap/m/TimePickerSliders.js +1 -1
  259. package/src/sap/m/Title.js +1 -1
  260. package/src/sap/m/TitlePropagationSupport.js +1 -1
  261. package/src/sap/m/ToggleButton.js +15 -3
  262. package/src/sap/m/Token.js +1 -1
  263. package/src/sap/m/Tokenizer.js +1 -1
  264. package/src/sap/m/Toolbar.js +4 -2
  265. package/src/sap/m/ToolbarLayoutData.js +1 -1
  266. package/src/sap/m/ToolbarSeparator.js +1 -1
  267. package/src/sap/m/ToolbarSpacer.js +1 -1
  268. package/src/sap/m/Tree.js +1 -1
  269. package/src/sap/m/TreeItemBase.js +1 -1
  270. package/src/sap/m/UploadCollection.js +2 -2
  271. package/src/sap/m/UploadCollectionItem.js +1 -1
  272. package/src/sap/m/UploadCollectionParameter.js +1 -1
  273. package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
  274. package/src/sap/m/VBox.js +1 -1
  275. package/src/sap/m/ValueStateHeader.js +1 -1
  276. package/src/sap/m/VariantManagement.js +13 -50
  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 +2 -2
  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 +1 -1
  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/HBox.designtime.js +16 -0
  295. package/src/sap/m/designtime/IconTabFilter.designtime.js +0 -9
  296. package/src/sap/m/designtime/ObjectHeader.designtime.js +26 -0
  297. package/src/sap/m/designtime/Select.designtime.js +2 -1
  298. package/src/sap/m/designtime/VBox.designtime.js +16 -0
  299. package/src/sap/m/inputUtils/SuggestionsPopoverDialogMixin.js +5 -5
  300. package/src/sap/m/inputUtils/SuggestionsPopoverPopoverMixin.js +4 -0
  301. package/src/sap/m/library.js +62 -7
  302. package/src/sap/m/messagebundle.properties +27 -13
  303. package/src/sap/m/messagebundle_ar.properties +36 -20
  304. package/src/sap/m/messagebundle_bg.properties +102 -86
  305. package/src/sap/m/messagebundle_ca.properties +34 -18
  306. package/src/sap/m/messagebundle_cs.properties +40 -24
  307. package/src/sap/m/messagebundle_cy.properties +35 -19
  308. package/src/sap/m/messagebundle_da.properties +35 -19
  309. package/src/sap/m/messagebundle_de.properties +35 -19
  310. package/src/sap/m/messagebundle_el.properties +36 -20
  311. package/src/sap/m/messagebundle_en.properties +35 -19
  312. package/src/sap/m/messagebundle_en_GB.properties +35 -19
  313. package/src/sap/m/messagebundle_en_US_sappsd.properties +34 -18
  314. package/src/sap/m/messagebundle_en_US_saprigi.properties +34 -18
  315. package/src/sap/m/messagebundle_en_US_saptrc.properties +34 -18
  316. package/src/sap/m/messagebundle_es.properties +33 -17
  317. package/src/sap/m/messagebundle_es_MX.properties +33 -17
  318. package/src/sap/m/messagebundle_et.properties +33 -17
  319. package/src/sap/m/messagebundle_fi.properties +37 -21
  320. package/src/sap/m/messagebundle_fr.properties +38 -22
  321. package/src/sap/m/messagebundle_fr_CA.properties +35 -19
  322. package/src/sap/m/messagebundle_hi.properties +36 -20
  323. package/src/sap/m/messagebundle_hr.properties +36 -20
  324. package/src/sap/m/messagebundle_hu.properties +39 -23
  325. package/src/sap/m/messagebundle_id.properties +38 -22
  326. package/src/sap/m/messagebundle_it.properties +33 -17
  327. package/src/sap/m/messagebundle_iw.properties +40 -24
  328. package/src/sap/m/messagebundle_ja.properties +70 -54
  329. package/src/sap/m/messagebundle_kk.properties +35 -19
  330. package/src/sap/m/messagebundle_ko.properties +36 -20
  331. package/src/sap/m/messagebundle_lt.properties +35 -19
  332. package/src/sap/m/messagebundle_lv.properties +33 -17
  333. package/src/sap/m/messagebundle_ms.properties +35 -19
  334. package/src/sap/m/messagebundle_nl.properties +35 -19
  335. package/src/sap/m/messagebundle_no.properties +38 -22
  336. package/src/sap/m/messagebundle_pl.properties +35 -19
  337. package/src/sap/m/messagebundle_pt.properties +33 -17
  338. package/src/sap/m/messagebundle_pt_PT.properties +33 -17
  339. package/src/sap/m/messagebundle_ro.properties +45 -29
  340. package/src/sap/m/messagebundle_ru.properties +32 -16
  341. package/src/sap/m/messagebundle_sh.properties +43 -27
  342. package/src/sap/m/messagebundle_sk.properties +35 -19
  343. package/src/sap/m/messagebundle_sl.properties +96 -80
  344. package/src/sap/m/messagebundle_sv.properties +37 -21
  345. package/src/sap/m/messagebundle_th.properties +42 -26
  346. package/src/sap/m/messagebundle_tr.properties +36 -20
  347. package/src/sap/m/messagebundle_uk.properties +38 -22
  348. package/src/sap/m/messagebundle_vi.properties +35 -19
  349. package/src/sap/m/messagebundle_zh_CN.properties +40 -24
  350. package/src/sap/m/messagebundle_zh_TW.properties +37 -21
  351. package/src/sap/m/p13n/AbstractContainer.js +2 -2
  352. package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
  353. package/src/sap/m/p13n/BasePanel.js +11 -5
  354. package/src/sap/m/p13n/Container.js +9 -6
  355. package/src/sap/m/p13n/Engine.js +33 -5
  356. package/src/sap/m/p13n/FlexUtil.js +7 -3
  357. package/src/sap/m/p13n/GroupController.js +1 -1
  358. package/src/sap/m/p13n/GroupPanel.js +6 -1
  359. package/src/sap/m/p13n/MetadataHelper.js +1 -1
  360. package/src/sap/m/p13n/PersistenceProvider.js +2 -92
  361. package/src/sap/m/p13n/Popup.js +25 -2
  362. package/src/sap/m/p13n/QueryPanel.js +18 -3
  363. package/src/sap/m/p13n/SelectionController.js +6 -7
  364. package/src/sap/m/p13n/SelectionPanel.js +16 -5
  365. package/src/sap/m/p13n/SortController.js +1 -1
  366. package/src/sap/m/p13n/SortPanel.js +8 -4
  367. package/src/sap/m/p13n/enum/PersistenceMode.js +9 -0
  368. package/src/sap/m/p13n/handler/xConfigHandler.js +13 -13
  369. package/src/sap/m/p13n/modification/FlexModificationHandler.js +24 -1
  370. package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +1 -13
  371. package/src/sap/m/p13n/modules/StateHandlerRegistry.js +1 -1
  372. package/src/sap/m/p13n/modules/UIManager.js +5 -4
  373. package/src/sap/m/p13n/modules/xConfigAPI.js +26 -0
  374. package/src/sap/m/plugins/CellSelector.js +534 -799
  375. package/src/sap/m/plugins/ColumnResizer.js +1 -9
  376. package/src/sap/m/plugins/CopyProvider.js +2 -10
  377. package/src/sap/m/plugins/DataStateIndicator.js +8 -2
  378. package/src/sap/m/plugins/PasteProvider.js +1 -1
  379. package/src/sap/m/plugins/PluginBase.js +1 -1
  380. package/src/sap/m/semantic/AddAction.js +1 -1
  381. package/src/sap/m/semantic/CancelAction.js +1 -1
  382. package/src/sap/m/semantic/DeleteAction.js +1 -1
  383. package/src/sap/m/semantic/DetailPage.js +1 -1
  384. package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
  385. package/src/sap/m/semantic/EditAction.js +1 -1
  386. package/src/sap/m/semantic/FavoriteAction.js +1 -1
  387. package/src/sap/m/semantic/FilterAction.js +1 -1
  388. package/src/sap/m/semantic/FilterSelect.js +1 -1
  389. package/src/sap/m/semantic/FlagAction.js +1 -1
  390. package/src/sap/m/semantic/ForwardAction.js +1 -1
  391. package/src/sap/m/semantic/FullscreenPage.js +1 -1
  392. package/src/sap/m/semantic/GroupAction.js +1 -1
  393. package/src/sap/m/semantic/GroupSelect.js +1 -1
  394. package/src/sap/m/semantic/MainAction.js +1 -1
  395. package/src/sap/m/semantic/MasterPage.js +1 -1
  396. package/src/sap/m/semantic/MessagesIndicator.js +1 -1
  397. package/src/sap/m/semantic/MultiSelectAction.js +1 -1
  398. package/src/sap/m/semantic/NegativeAction.js +1 -1
  399. package/src/sap/m/semantic/OpenInAction.js +1 -1
  400. package/src/sap/m/semantic/PositiveAction.js +1 -1
  401. package/src/sap/m/semantic/PrintAction.js +1 -1
  402. package/src/sap/m/semantic/SaveAction.js +1 -1
  403. package/src/sap/m/semantic/Segment.js +1 -1
  404. package/src/sap/m/semantic/SegmentedContainer.js +1 -1
  405. package/src/sap/m/semantic/SemanticButton.js +1 -1
  406. package/src/sap/m/semantic/SemanticConfiguration.js +3 -3
  407. package/src/sap/m/semantic/SemanticControl.js +1 -1
  408. package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
  409. package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
  410. package/src/sap/m/semantic/SemanticPage.js +1 -1
  411. package/src/sap/m/semantic/SemanticSelect.js +1 -1
  412. package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
  413. package/src/sap/m/semantic/SendEmailAction.js +1 -1
  414. package/src/sap/m/semantic/SendMessageAction.js +1 -1
  415. package/src/sap/m/semantic/ShareInJamAction.js +1 -1
  416. package/src/sap/m/semantic/ShareMenu.js +1 -1
  417. package/src/sap/m/semantic/ShareMenuPage.js +1 -1
  418. package/src/sap/m/semantic/SortAction.js +1 -1
  419. package/src/sap/m/semantic/SortSelect.js +1 -1
  420. package/src/sap/m/table/Util.js +6 -5
  421. package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
  422. package/src/sap/m/table/columnmenu/Entry.js +1 -1
  423. package/src/sap/m/table/columnmenu/Item.js +1 -1
  424. package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
  425. package/src/sap/m/table/columnmenu/Menu.js +1 -1
  426. package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
  427. package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
  428. package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
  429. package/src/sap/m/table/columnmenu/QuickGroup.js +1 -1
  430. package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
  431. package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
  432. package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
  433. package/src/sap/m/table/columnmenu/QuickTotal.js +1 -1
  434. package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
  435. package/src/sap/m/themes/base/Avatar.less +78 -7
  436. package/src/sap/m/themes/base/Carousel.less +7 -0
  437. package/src/sap/m/themes/base/CellSelector.less +50 -105
  438. package/src/sap/m/themes/base/IconTabBar.less +1 -1
  439. package/src/sap/m/themes/base/Link.less +20 -24
  440. package/src/sap/m/themes/base/MessageStrip.less +1 -1
  441. package/src/sap/m/themes/base/NumericContent.less +4 -0
  442. package/src/sap/m/themes/base/ObjectStatus.less +1 -2
  443. package/src/sap/m/themes/base/Panel.less +14 -0
  444. package/src/sap/m/themes/base/PlanningCalendarHeader.less +2 -1
  445. package/src/sap/m/themes/base/RadioButton.less +3 -1
  446. package/src/sap/m/themes/base/SearchField.less +13 -3
  447. package/src/sap/m/themes/base/Select.less +32 -2
  448. package/src/sap/m/themes/base/Table.less +4 -8
  449. package/src/sap/m/themes/base/TimePickerClocks.less +4 -0
  450. package/src/sap/m/themes/base/UploadSet.less +13 -1
  451. package/src/sap/m/themes/base/UploadSetTable.less +80 -0
  452. package/src/sap/m/themes/base/ValueStateMessage.less +1 -0
  453. package/src/sap/m/themes/base/VariantManagement.less +1 -0
  454. package/src/sap/m/themes/base/Wizard.less +1 -1
  455. package/src/sap/m/themes/base/library.source.less +1 -0
  456. package/src/sap/m/upload/FilePreviewDialog.js +257 -0
  457. package/src/sap/m/upload/UploadSet.js +140 -67
  458. package/src/sap/m/upload/UploadSetItem.js +51 -27
  459. package/src/sap/m/upload/UploadSetTable.js +929 -0
  460. package/src/sap/m/upload/UploadSetTableItem.js +327 -0
  461. package/src/sap/m/upload/UploadSetTableItemRenderer.js +22 -0
  462. package/src/sap/m/upload/UploadSetTableRenderer.js +34 -0
  463. package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
  464. package/src/sap/m/upload/UploaderTableItem.js +276 -0
  465. package/ui5.yaml +1 -1
@@ -0,0 +1,929 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ // Provides control sap.m.upload.UploadSetTable.
8
+ sap.ui.define([
9
+ "sap/m/Table",
10
+ "sap/m/ToolbarSpacer",
11
+ "sap/m/upload/UploadSetTableRenderer",
12
+ "sap/ui/unified/FileUploader",
13
+ "sap/m/upload/UploadSetToolbarPlaceholder",
14
+ "sap/m/upload/UploaderHttpRequestMethod",
15
+ "sap/m/OverflowToolbar",
16
+ "sap/m/upload/UploadSetTableItem",
17
+ "sap/base/util/deepEqual",
18
+ "sap/base/Log",
19
+ "sap/m/library",
20
+ "sap/m/IllustratedMessageType",
21
+ "sap/m/IllustratedMessage",
22
+ "sap/m/IllustratedMessageSize",
23
+ "sap/m/upload/UploaderTableItem",
24
+ "sap/ui/core/dnd/DragDropInfo",
25
+ "sap/ui/core/dnd/DropInfo",
26
+ "sap/ui/core/dnd/DragInfo"
27
+ ], function (Table, ToolbarSpacer, UploadSetTableRenderer, FileUploader,
28
+ UploadSetToolbarPlaceholder, UploaderHttpRequestMethod, OverFlowToolbar, UploadSetTableItem, deepEqual, Log, Library, IllustratedMessageType,
29
+ IllustratedMessage, IllustratedMessageSize, Uploader, DragDropInfo, DropInfo, DragInfo) {
30
+ "use strict";
31
+
32
+ /**
33
+ * Constructor for a new UploadSetTable.
34
+ *
35
+ * @param {string} [sId] id for the new control, generated automatically if no id is given.
36
+ * @param {object} [mSettings] Initial settings for the new control.
37
+ * @class This control allows you to upload one or more files from your devices (desktop, tablet, or phone)
38
+ * and attach them to your application.<br>
39
+ * @extends sap.m.Table
40
+ * @author SAP SE
41
+ * @constructor
42
+ * @private
43
+ * @experimental
44
+ * @internal
45
+ * @alias sap.m.upload.UploadSetTable
46
+ */
47
+
48
+ var UploadSetTable = Table.extend("sap.m.upload.UploadSetTable", {
49
+ library: "sap.m",
50
+ metadata: {
51
+ properties: {
52
+ /**
53
+ * Allowed file types for files to be uploaded.
54
+ * <br>If this property is not set, any file can be uploaded.
55
+ */
56
+ fileTypes: {type: "string[]", defaultValue: null},
57
+ /**
58
+ * Maximum length of names of files to be uploaded.
59
+ * <br>If set to <code>null</code> or <code>0</code>, any files can be uploaded,
60
+ * regardless of their names length.
61
+ */
62
+ maxFileNameLength: {type: "int", defaultValue: null},
63
+ /**
64
+ * Size limit in megabytes for files to be uploaded.
65
+ * <br>If set to <code>null</code> or <code>0</code>, files of any size can be uploaded.
66
+ */
67
+ maxFileSize: {type: "float", defaultValue: null},
68
+ /**
69
+ * Allowed media types for files to be uploaded.
70
+ * <br>If this property is not set, any file can be uploaded.
71
+ */
72
+ mediaTypes: {type: "string[]", defaultValue: null},
73
+ /**
74
+ * Defines custom text for the 'No data' text label.
75
+ */
76
+ noDataText: {type: "string", defaultValue: null},
77
+ /**
78
+ * Defines custom text for the 'No data' description label.
79
+ */
80
+ noDataDescription: {type: "string", defaultValue: null},
81
+ /**
82
+ * Defines custom text for the drag and drop text label.
83
+ */
84
+ dragDropText: {type: "string", defaultValue: null},
85
+ /**
86
+ * Defines custom text for the drag and drop description label.
87
+ */
88
+ dragDropDescription: {type: "string", defaultValue: null},
89
+ /**
90
+ * URL where the uploaded files will be stored.
91
+ */
92
+ uploadUrl: {type: "string", defaultValue: null},
93
+ /**
94
+ * HTTP request method chosen for file upload.
95
+ */
96
+ httpRequestMethod: {type: "sap.m.upload.UploaderHttpRequestMethod", defaultValue: UploaderHttpRequestMethod.Post},
97
+ /**
98
+ * Lets the user select multiple files from the same folder and then upload them.
99
+ *
100
+ * If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.
101
+ */
102
+ multiple: {type: "boolean", group: "Behavior", defaultValue: false},
103
+ /**
104
+ * If set to true, the button used for uploading files become invisible.
105
+ */
106
+ uploadButtonInvisible: {type: "boolean", group: "Appearance", defaultValue: false},
107
+ /**
108
+ * Defines whether the upload process should be triggered as soon as the file is added.<br>
109
+ * If set to <code>false</code>, no upload is triggered when a file is added.
110
+ */
111
+ instantUpload: {type: "boolean", defaultValue: true},
112
+ /**
113
+ * Function callback invoked with dropped files, by the control to provide custom handling for drag and drop of files into the control area
114
+ */
115
+ customDropFilesHandler: {type: "function", defaultValue: null},
116
+ /**
117
+ * Defines whether the upload action is allowed.
118
+ */
119
+ uploadEnabled: {type: "boolean", defaultValue: true}
120
+ },
121
+ aggregations: {
122
+ headerToolbar : {
123
+ type: "sap.m.OverflowToolbar",
124
+ multiple: false
125
+ },
126
+ /**
127
+ * Defines the uploader to be used. If not specified, the default implementation is used.
128
+ */
129
+ uploader: {type: "sap.m.upload.UploaderTableItem", multiple: false},
130
+ /**
131
+ * Header fields to be included in the header section of an XHR request.
132
+ */
133
+ headerFields: {type: "sap.ui.core.Item", multiple: true, singularName: "headerField"}
134
+ },
135
+ defaultAggregation : "items",
136
+ events: {
137
+ /**
138
+ * The event is triggered when the file name is changed.
139
+ */
140
+ fileRenamed: {
141
+ parameters: {
142
+ /**
143
+ * The renamed UI element as an UploadSetTableItem.
144
+ */
145
+ item: {type: "sap.m.upload.UploadSetTableItem"}
146
+ }
147
+ },
148
+ /**
149
+ * This event is fired after the item is removed on click of ok button in confirmation dialog.
150
+ */
151
+ afterItemRemoved: {
152
+ parameters: {
153
+ /**
154
+ * The item removed from the set of items to be uploaded.
155
+ */
156
+ item: {type: "sap.m.upload.UploadSetTableItem"}
157
+ }
158
+ },
159
+ /**
160
+ * This event is fired right before the upload process begins.
161
+ */
162
+ beforeUploadStarts: {
163
+ parameters: {
164
+ /**
165
+ * The file whose upload is just about to start.
166
+ */
167
+ item: {type: "sap.m.upload.UploadSetTableItem"}
168
+ },
169
+ allowPreventDefault: true
170
+ },
171
+ /**
172
+ * This event is fired right after the upload process is finished.
173
+ */
174
+ uploadCompleted: {
175
+ parameters: {
176
+ /**
177
+ * The file whose upload has just been completed.
178
+ */
179
+ item: {type: "sap.m.upload.UploadSetTableItem"},
180
+ /**
181
+ * Response message which comes from the server.
182
+ *
183
+ * On the server side this response has to be put within the &quot;body&quot; tags of the response
184
+ * document of the iFrame. It can consist of a return code and an optional message. This does not
185
+ * work in cross-domain scenarios.
186
+ */
187
+ response : {type : "string"},
188
+ /**
189
+ * ReadyState of the XHR request.
190
+ *
191
+ * Required for receiving a <code>readyState</code> is to set the property <code>sendXHR</code>
192
+ * to true. This property is not supported by Internet Explorer 9.
193
+ */
194
+ readyState : {type : "string"},
195
+
196
+ /**
197
+ * Status of the XHR request.
198
+ *
199
+ * Required for receiving a <code>status</code> is to set the property <code>sendXHR</code> to true.
200
+ * This property is not supported by Internet Explorer 9.
201
+ */
202
+ status : {type : "string"},
203
+ /**
204
+ * Http-Response which comes from the server.
205
+ *
206
+ * Required for receiving <code>responseXML</code> is to set the property <code>sendXHR</code> to true.
207
+ *
208
+ * This property is not supported by Internet Explorer 9.
209
+ */
210
+ responseXML : {type : "string"},
211
+ /**
212
+ * Http-Response which comes from the server.
213
+ *
214
+ * Required for receiving <code>responseText</code> is to set the property <code>sendXHR</code> to true.
215
+ *
216
+ * This property is not supported by Internet Explorer 9.
217
+ */
218
+ responseText : {type : "string"},
219
+ /**
220
+ * Http-Response-Headers which come from the server.
221
+ *
222
+ * Provided as a JSON-map, i.e. each header-field is reflected by a property in the <code>headers</code>
223
+ * object, with the property value reflecting the header-field's content.
224
+ *
225
+ * Required for receiving <code>headers</code> is to set the property <code>sendXHR</code> to true.
226
+ * This property is not supported by Internet Explorer 9.
227
+ */
228
+ headers : {type : "object"}
229
+ }
230
+ },
231
+ /**
232
+ * This event is fired in either of the following cases:
233
+ * <ul>
234
+ * <li>When a file that is selected to be uploaded fails to meet the file type restriction
235
+ * (<code>fileType</code> property).</li>
236
+ * <li>When the file type restriction changes, and the file to be uploaded fails to meet the new
237
+ * restriction.</li>
238
+ * </ul>
239
+ */
240
+ fileTypeMismatch: {
241
+ parameters: {
242
+ /**
243
+ * The file that fails to meet the file type restriction specified in the
244
+ * <code>fileType</code> property.
245
+ */
246
+ item: {type: "object"}
247
+ }
248
+ },
249
+ /**
250
+ * This event is fired in either of the following cases:
251
+ * <ul>
252
+ * <li>When a file that is selected to be uploaded fails to meet the file name length restriction specified in the
253
+ * <code>maxFileNameLength</code> property.</li>
254
+ * <li>When the file name length restriction changes, and the file to be uploaded fails to meet the new
255
+ * restriction.</li>
256
+ * <li>Listeners can use the item parameter to remove the incomplete item that failed to meet the restriction</li>
257
+ * </ul>
258
+ */
259
+ fileNameLengthExceeded: {
260
+ parameters: {
261
+ /**
262
+ * The file that fails to meet the file name length restriction specified in the
263
+ * <code>maxFileNameLength</code> property.
264
+ */
265
+ item: {type: "object"}
266
+ }
267
+ },
268
+ /**
269
+ * This event is fired in either of the following cases:
270
+ * <ul>
271
+ * <li>When a file that is selected to be uploaded fails to meet the file size restriction specified in the
272
+ * <code>maxFileSize</code> property.</li>
273
+ * <li>When the file size restriction changes, and the file to be uploaded fails to meet the new
274
+ * restriction.</li>
275
+ * <li>Listeners can use the item parameter to remove the incomplete item that failed to meet the restriction</li>
276
+ * </ul>
277
+ */
278
+ fileSizeExceeded: {
279
+ parameters: {
280
+ /**
281
+ * The file that fails to meet the file size restriction specified in the
282
+ * <code>maxFileSize</code> property.
283
+ */
284
+ item: {type: "object"}
285
+ }
286
+ },
287
+ /**
288
+ * This event is fired in either of the following cases:
289
+ * <ul>
290
+ * <li>When a file that is selected to be uploaded fails to meet the media type restriction specified in the
291
+ * <code>mediaTypes</code> property.</li>
292
+ * <li>When the media type restriction changes, and the file to be uploaded fails to meet the new
293
+ * restriction.</li>
294
+ * </ul>
295
+ */
296
+ mediaTypeMismatch: {
297
+ parameters: {
298
+ /**
299
+ * The file that fails to meet the media type restriction specified in the
300
+ * <code>mediaTypes</code> property.
301
+ */
302
+ item: {type: "object"}
303
+ }
304
+ },
305
+
306
+ /**
307
+ * This event is fired when a file that is selected to be uploaded and just before initiating the file upload process
308
+ * Use this event to set additional info dynamically specific for each item before upload process is initiated
309
+ */
310
+ beforeInitiatingItemUpload: {
311
+ parameters: {
312
+ /**
313
+ * Items in ready state for upload process
314
+ */
315
+ item: {type: "sap.m.upload.UploadSetTableItem"}
316
+ }
317
+ },
318
+ /**
319
+ * This event is fired when the user starts dragging an uploaded item.
320
+ * @event
321
+ * @param {sap.ui.base.Event} oControlEvent
322
+ * @param {sap.ui.base.EventProvider} oControlEvent.getSource
323
+ * @param {object} oControlEvent.getParameters
324
+ * @param {sap.ui.core.Element} oControlEvent.getParameters.target The target element that will be dragged
325
+ * @param {sap.ui.core.dnd.DragSession} oControlEvent.getParameters.dragSession The UI5 <code>dragSession</code> object that exists only during drag and drop
326
+ * @param {Event} oControlEvent.getParameters.browserEvent The underlying browser event
327
+ * @public
328
+ * @since 1.99
329
+ */
330
+ itemDragStart: {
331
+ },
332
+
333
+ /**
334
+ * This event is fired when an uploaded item is dropped on the new list position.
335
+ * @event
336
+ * @param {sap.ui.base.Event} oControlEvent
337
+ * @param {sap.ui.base.EventProvider} oControlEvent.getSource
338
+ * @param {object} oControlEvent.getParameters
339
+ * @param {sap.ui.core.dnd.DragSession} oControlEvent.getParameters.dragSession The UI5 <code>dragSession</code> object that exists only during drag and drop
340
+ * @param {sap.ui.core.Element} oControlEvent.getParameters.draggedControl The element being dragged
341
+ * @param {sap.ui.core.Element} oControlEvent.getParameters.droppedControl The element being dropped
342
+ * @param {sap.ui.core.dnd.RelativeDropPosition} oControlEvent.getParameters.dropPosition The calculated position of the drop action relative to the <code>droppedControl</code>.
343
+ * @param {Event} oControlEvent.getParameters.browserEvent The underlying browser event
344
+ * @public
345
+ * @since 1.99
346
+ */
347
+ itemDrop: {
348
+ }
349
+ }
350
+ },
351
+ renderer: UploadSetTableRenderer
352
+ });
353
+
354
+ var UploadState = Library.UploadState;
355
+
356
+ /* ================== */
357
+ /* Lifecycle handling */
358
+ /* ================== */
359
+
360
+ UploadSetTable.prototype.init = function () {
361
+ Table.prototype.init.call(this);
362
+ this._setDragDropConfig();
363
+ this._filesTobeUploaded = [];
364
+ };
365
+
366
+ UploadSetTable.prototype.onBeforeRendering = function() {
367
+ Table.prototype.onBeforeRendering.call(this);
368
+ this._setIllustratedMessage();
369
+ };
370
+
371
+ UploadSetTable.prototype.onAfterRendering = function() {
372
+ Table.prototype.onAfterRendering.call(this);
373
+ };
374
+
375
+ UploadSetTable.prototype.exit = function () {
376
+ Table.prototype.exit.call(this);
377
+ if (this._oToolbar) {
378
+ this._oToolbar.destroy();
379
+ this._oToolbar = null;
380
+ }
381
+ if (this._oFileUploader) {
382
+ this._oFileUploader.destroy();
383
+ this._oFileUploader = null;
384
+ }
385
+ if (this._illustratedMessage) {
386
+ this._illustratedMessage.destroy();
387
+ this._illustratedMessage = null;
388
+ }
389
+ };
390
+
391
+ /* ===================== */
392
+ /* Overriden API methods */
393
+ /* ===================== */
394
+
395
+ UploadSetTable.prototype.getHeaderToolbar = function () {
396
+ if (!this._oToolbar) {
397
+ this._oToolbar = this.getAggregation("headerToolbar");
398
+ if (!this._oToolbar) {
399
+ this._oToolbar = new OverFlowToolbar(this.getId() + "-toolbar", {
400
+ content: [new ToolbarSpacer(), this.getDefaultFileUploader()]
401
+ });
402
+ this._iFileUploaderPH = 2;
403
+ this.addDependent(this._oToolbar);
404
+ } else {
405
+ this._iFileUploaderPH = this._getFileUploaderPlaceHolderPosition(this._oToolbar);
406
+ if (this._oToolbar && this._iFileUploaderPH > -1) {
407
+ this._setFileUploaderInToolbar(this.getDefaultFileUploader());
408
+ } else if (this._oToolbar) {
409
+ // fallback position to add file uploader control if UploadSetToolbarPlaceHolder instance not found
410
+ this._oToolbar.addContent(this.getDefaultFileUploader());
411
+ }
412
+ }
413
+ }
414
+
415
+ return this._oToolbar;
416
+ };
417
+
418
+ UploadSetTable.prototype.setFileTypes = function (aNewTypes) {
419
+ var aTypes = aNewTypes || null;
420
+ if (typeof aTypes === "string") {
421
+ aTypes = aTypes.split(",");
422
+ }
423
+ aTypes = (aTypes || []).map(function (s) {
424
+ return s ? s.toLowerCase() : "";
425
+ });
426
+ if (!deepEqual(this.getFileTypes(), aTypes)) {
427
+ this.setProperty("fileTypes", aTypes, true);
428
+ this.getDefaultFileUploader().setFileType(aTypes);
429
+ }
430
+ return this;
431
+ };
432
+
433
+ UploadSetTable.prototype.setMaxFileNameLength = function (iNewMax) {
434
+ if (this.getMaxFileNameLength() !== iNewMax) {
435
+ this.setProperty("maxFileNameLength", iNewMax, true);
436
+ this.getDefaultFileUploader().setMaximumFilenameLength(iNewMax);
437
+ }
438
+ return this;
439
+ };
440
+
441
+ UploadSetTable.prototype.setMaxFileSize = function (iNewMax) {
442
+ if (this.getMaxFileSize() !== iNewMax) {
443
+ this.setProperty("maxFileSize", iNewMax, true);
444
+ this.getDefaultFileUploader().setMaximumFileSize(iNewMax);
445
+ }
446
+ return this;
447
+ };
448
+
449
+ UploadSetTable.prototype.setMediaTypes = function (aNewTypes) {
450
+ var aTypes = aNewTypes || null;
451
+ if (typeof aTypes === "string") {
452
+ aTypes = aTypes.split(",");
453
+ }
454
+ aTypes = (aTypes || []).map(function (s) {
455
+ return s ? s.toLowerCase() : "";
456
+ });
457
+ if (!deepEqual(this.getMediaTypes(), aTypes)) {
458
+ this.setProperty("mediaTypes", aTypes, true);
459
+ this.getDefaultFileUploader().setMimeType(aTypes);
460
+ }
461
+ return this;
462
+ };
463
+
464
+ UploadSetTable.prototype.setUploadButtonInvisible = function (bUploadButtonInvisible) {
465
+ if (bUploadButtonInvisible !== this.getUploadButtonInvisible()) {
466
+ this._setFileUploaderVisibility(bUploadButtonInvisible);
467
+ this.setProperty("uploadButtonInvisible", bUploadButtonInvisible, true);
468
+ }
469
+ return this;
470
+ };
471
+
472
+ UploadSetTable.prototype.setMultiple = function (bMultiple) {
473
+ if (this.getMultiple() !== bMultiple) {
474
+ this.setProperty("multiple", bMultiple);
475
+ this.getDefaultFileUploader().setMultiple(bMultiple);
476
+ }
477
+ return this;
478
+ };
479
+
480
+ UploadSetTable.prototype.setUploadEnabled = function (bEnable) {
481
+ if (bEnable !== this.getUploadEnabled()) {
482
+ this.getDefaultFileUploader().setEnabled(bEnable);
483
+ this.setProperty("uploadEnabled", bEnable, false);
484
+ }
485
+ return this;
486
+ };
487
+
488
+ /* ============== */
489
+ /* Public methods */
490
+ /* ============== */
491
+
492
+ /**
493
+ * Returns an instance of the default <code>sap.ui.unified.FileUploader</code> used for adding files using
494
+ * the operating system's open file dialog, so that it can be customized, for example made invisible or assigned a different icon.
495
+ * @return {sap.ui.unified.FileUploader} Instance of the default <code>sap.ui.unified.FileUploader</code>.
496
+ * @public
497
+ */
498
+ UploadSetTable.prototype.getDefaultFileUploader = function () {
499
+ var sTooltip = "Upload";
500
+ if (!this._oFileUploader) {
501
+ this._oFileUploader = new FileUploader(this.getId() + "-uploader", {
502
+ buttonOnly: true,
503
+ buttonText: sTooltip,
504
+ tooltip: sTooltip,
505
+ iconOnly: false,
506
+ enabled: this.getUploadEnabled(),
507
+ icon: "",
508
+ iconFirst: false,
509
+ style: "Transparent",
510
+ name: "uploadSetTableFileUploader",
511
+ sameFilenameAllowed: true,
512
+ fileType: this.getFileTypes(),
513
+ mimeType: this.getMediaTypes(),
514
+ maximumFilenameLength: this.getMaxFileNameLength(),
515
+ maximumFileSize: this.getMaxFileSize(),
516
+ multiple: this.getMultiple(),
517
+ useMultipart: false,
518
+ sendXHR: true,
519
+ change: [this._onFileUploaderChange, this],
520
+ typeMissmatch: [this._fireFileTypeMismatch, this],
521
+ fileSizeExceed: [this._fireFileSizeExceed, this],
522
+ filenameLengthExceed: [this._fireFilenameLengthExceed, this],
523
+ visible: true
524
+ });
525
+ }
526
+
527
+ return this._oFileUploader;
528
+ };
529
+
530
+ /**
531
+ * Returns sap icon based on mediaType and fileName passed
532
+ * @param {string} mediaType The list items the selection state is to be set for
533
+ * @param {string} fileName The new selection state
534
+ * @public
535
+ * @returns {string} sap icon.
536
+ */
537
+ UploadSetTable.getIconForFileType = function (mediaType, fileName) {
538
+ return UploadSetTableItem._getIconByMimeType(mediaType, fileName);
539
+ };
540
+
541
+ /**
542
+ * Returns sap icon based on mediaType and fileName passed
543
+ * @param {UploadSetTableItem[]} aItemsToDownload The list items the selection state is to be set for
544
+ * @param {boolean} bAskForLocation Whether to ask for a location where to download the file or not.
545
+ * @public
546
+ */
547
+ UploadSetTable.prototype.downloadItems = function (aItemsToDownload) {
548
+ if (aItemsToDownload && aItemsToDownload.length) {
549
+ aItemsToDownload.forEach(function(oItem){
550
+ // Check if items are instances of "sap.m.UploadSetTableItem"
551
+ var isUploadSetTableItemInstance = oItem && oItem instanceof UploadSetTableItem ? true : false;
552
+ var oParent = oItem && oItem.getParent ? oItem.getParent() : null;
553
+ // Download files individually
554
+ if (isUploadSetTableItemInstance && oParent === this) {
555
+ this._getActiveUploader().download(oItem, [], true);
556
+ } else {
557
+ Log.warning("Download cannot proceed without a parent association.");
558
+ }
559
+ }.bind(this));
560
+ }
561
+ };
562
+
563
+ /**
564
+ * Attaches all necessary handlers to the given uploader instance, so that the progress and status of the upload can be
565
+ * displayed and monitored.
566
+ * This is necessary in case when custom uploader is used.
567
+ * @param {sap.m.upload.UploaderTableItem} oUploader Instance of <code>sap.m.upload.UploaderTableItem</code> to which the default request handlers are attached.
568
+ * @public
569
+ */
570
+ UploadSetTable.prototype.registerUploaderEvents = function (oUploader) {
571
+ oUploader.attachUploadStarted(this._onUploadStarted.bind(this));
572
+ oUploader.attachUploadCompleted(this._onUploadCompleted.bind(this));
573
+ };
574
+
575
+ /**
576
+ * Invokes fileselection handler and return the selected files through the callback function passed (selectedItemsCallback)
577
+ * @param {function} fnSelectedItemsCallback Callback funtion which is invoked and returned with selected items from the fileselectionhandler
578
+ * @public
579
+ */
580
+ UploadSetTable.prototype.fileSelectionHandler = function(fnSelectedItemsCallback) {
581
+ if (!(typeof fnSelectedItemsCallback === "function")) {
582
+ Log.warning("Invalid Callback function passed.");
583
+ return;
584
+ }
585
+ this._fnSelectedItemsCallback = fnSelectedItemsCallback;
586
+ var oUploaderInstance = this.getDefaultFileUploader();
587
+ if (oUploaderInstance && oUploaderInstance.oFileUpload && oUploaderInstance.oFileUpload.click) {
588
+ oUploaderInstance.oFileUpload.click();
589
+ }
590
+ };
591
+
592
+ /**
593
+ * Uploads each item passed by validting the pre conditions set for file and instant upload configured.
594
+ * @param {sap.m.upload.UploadSetTableItem[]} aItemTobeUploaded Array of items to be uploaded individually
595
+ * @public
596
+ */
597
+ UploadSetTable.prototype.uploadItems = function(aItemTobeUploaded) {
598
+
599
+ if (!this.getUploadEnabled()) {
600
+ Log.warning("Upload is currently disabled for this upload set with Table.");
601
+ return;
602
+ }
603
+
604
+ if (!Array.isArray(aItemTobeUploaded)) {
605
+ return;
606
+ }
607
+
608
+ // only items of instance UploadSetTableItem are accepted.
609
+ aItemTobeUploaded = aItemTobeUploaded.filter(function(item) {
610
+ return item instanceof UploadSetTableItem;
611
+ });
612
+
613
+ aItemTobeUploaded.forEach(function(oItem) {
614
+ if (this.getInstantUpload()) {
615
+ this._uploadItemIfGoodToGo(oItem);
616
+ }
617
+ }.bind(this));
618
+ };
619
+
620
+ /**
621
+ * API to determine the Unit for file size in KB/MB/GB accepts file size
622
+ * @param {int} iFileSize fileSize to determine units
623
+ * @public
624
+ * @returns {sFileSizeWithUnit} file size in KB/MB/GB default unit is KB
625
+ */
626
+ UploadSetTable.getFileSizeWithUnits = function(iFileSize) {
627
+ var iKilobyte = 1024;
628
+ var iMegabyte = iKilobyte * 1024;
629
+ var iGigabyte = iMegabyte * 1024;
630
+ if (typeof iFileSize === "number") {
631
+ if (iFileSize < iMegabyte) {
632
+ return (iFileSize / iKilobyte).toFixed(2) + " KB";
633
+ } else if (iFileSize < iGigabyte) {
634
+ return (iFileSize / iMegabyte).toFixed(2) + " MB";
635
+ } else {
636
+ return (iFileSize / iGigabyte).toFixed(2) + " GB";
637
+ }
638
+ }
639
+ return iFileSize;
640
+ };
641
+
642
+ /**
643
+ * API to upload File via URL
644
+ * @param {string} sName file name to be set for the file to be uploaded.
645
+ * @param {sap.ui.core.Item[]} aHeaders addition headers to be set
646
+ * @public
647
+ */
648
+ UploadSetTable.prototype.uploadItemViaUrl = function (sName, aHeaders) {
649
+ var oFileObject = new File([new Blob([])], sName);
650
+ // resetting custom callback
651
+ this._fnSelectedItemsCallback = null;
652
+ this._processSelectedFileObjects([oFileObject], aHeaders);
653
+ };
654
+
655
+ /**
656
+ * API to upload Item without file
657
+ * @param {sap.ui.core.Item[]} aHeaders addition headers to be set
658
+ * @public
659
+ */
660
+ UploadSetTable.prototype.uploadItemWithoutFile = function (aHeaders) {
661
+ var oFileObject = new File([new Blob([])], '-');
662
+ this._fnSelectedItemsCallback = null;
663
+ this._processSelectedFileObjects([oFileObject], aHeaders);
664
+ };
665
+
666
+ /* ============== */
667
+ /* Private methods */
668
+ /* ============== */
669
+
670
+ UploadSetTable.prototype._setFileUploaderInToolbar = function(fileUploader) {
671
+ this._oToolbar.getContent()[this._iFileUploaderPH].setVisible(false);
672
+ this._oToolbar.insertContent(fileUploader, this._iFileUploaderPH);
673
+ };
674
+
675
+ UploadSetTable.prototype._getFileUploaderPlaceHolderPosition = function(toolbar) {
676
+ for (var i = 0; i < toolbar.getContent().length; i++) {
677
+ if (toolbar.getContent()[i] instanceof UploadSetToolbarPlaceholder) {
678
+ return i;
679
+ }
680
+ }
681
+ return -1;
682
+ };
683
+
684
+ UploadSetTable.prototype._onFileUploaderChange = function (oEvent) {
685
+ var oFiles = oEvent.getParameter("files");
686
+ if (oFiles && oFiles.length) {
687
+ this._processSelectedFileObjects(oFiles);
688
+ } else {
689
+ // resetting the callback funtion if cancel clicked
690
+ this._fnSelectedItemsCallback = null;
691
+ }
692
+ };
693
+
694
+ UploadSetTable.prototype._processSelectedFileObjects = function (oFiles, aHeaders) {
695
+ var aFiles = [];
696
+
697
+ // Need to explicitly copy the file list, FileUploader deliberately resets its form completely
698
+ // along with 'files' parameter when it (mistakenly) thinks that all is done.
699
+ for (var i = 0; i < oFiles.length; i++) {
700
+ aFiles.push(oFiles[i]);
701
+ }
702
+
703
+ var selectedFiles = [];
704
+ aFiles.forEach(function (oFile) {
705
+ var oItem = new UploadSetTableItem({
706
+ uploadState: UploadState.Ready
707
+ });
708
+ oItem._setFileObject(oFile);
709
+ oItem.setFileName(oFile.name);
710
+ selectedFiles.push(oItem);
711
+
712
+ if (aHeaders && aHeaders.length) {
713
+ aHeaders.forEach(function(oHeader){
714
+ oItem.addHeaderField(oHeader);
715
+ });
716
+ }
717
+
718
+ this.fireBeforeInitiatingItemUpload({item: oItem});
719
+ if (this.getInstantUpload() && !this._fnSelectedItemsCallback) {
720
+ this._uploadItemIfGoodToGo(oItem);
721
+ }
722
+ }.bind(this));
723
+
724
+ // fire the fncallback stored set through fileSelectionHandler invocation
725
+ if (this._fnSelectedItemsCallback) {
726
+ this._fnSelectedItemsCallback({selectedItems: selectedFiles});
727
+ this._fnSelectedItemsCallback = null;
728
+ }
729
+
730
+ };
731
+
732
+ UploadSetTable.prototype._fireFileTypeMismatch = function (oItem) {
733
+ var aMediaTypes = this.getMediaTypes();
734
+ var aFileTypes = this.getFileTypes();
735
+
736
+ var sFileType = oItem.getParameter("fileType");
737
+ var sMediaType = oItem.getParameter("mimeType");
738
+
739
+ var bMediaRestricted = (!!aMediaTypes && (aMediaTypes.length > 0) && !!sMediaType && aMediaTypes.indexOf(sMediaType) === -1);
740
+ var bFileRestricted = (!!aFileTypes && (aFileTypes.length > 0) && !!sFileType && aFileTypes.indexOf(sFileType) === -1);
741
+
742
+ var oMismatchItem = {
743
+ fileType: sFileType,
744
+ mimeType: sMediaType
745
+ };
746
+
747
+ if (bMediaRestricted){
748
+ this.fireMediaTypeMismatch({item: oMismatchItem});
749
+ } else if (bFileRestricted){
750
+ this.fireFileTypeMismatch({item: oMismatchItem});
751
+ }
752
+ };
753
+
754
+ UploadSetTable.prototype._fireFilenameLengthExceed = function (oItem) {
755
+ this.fireFileNameLengthExceeded({item: oItem});
756
+ };
757
+
758
+ UploadSetTable.prototype._fireFileSizeExceed = function (oItem) {
759
+ this.fireFileSizeExceeded({item: oItem});
760
+ };
761
+
762
+ UploadSetTable.prototype._onUploadStarted = function (oEvent) {
763
+ var oItem = oEvent.getParameter("item");
764
+ oItem.setUploadState(UploadState.Uploading);
765
+ };
766
+
767
+ UploadSetTable.prototype._onUploadCompleted = function (oEvent) {
768
+ var oItem = oEvent.getParameter("item"),
769
+ oResponseXHRParams = oEvent.getParameter("responseXHR"),
770
+ sResponse = null;
771
+
772
+ if (oResponseXHRParams.responseXML) {
773
+ sResponse = oResponseXHRParams.responseXML.documentElement.textContent;
774
+ }
775
+ var oXhrParams = {
776
+ "item": oItem,
777
+ "response": oResponseXHRParams.response,
778
+ "responseXML": sResponse,
779
+ "responseText": oResponseXHRParams.responseText,
780
+ "readyState": oResponseXHRParams.readyState,
781
+ "status": oResponseXHRParams.status,
782
+ "headers": oResponseXHRParams.headers
783
+ };
784
+ oItem.setUploadState(UploadState.Complete);
785
+ this.fireUploadCompleted(oXhrParams);
786
+ };
787
+
788
+ UploadSetTable.prototype._uploadItemIfGoodToGo = function (oItem) {
789
+ if (oItem.getUploadState() === UploadState.Ready && !oItem._isRestricted()) {
790
+ if (this.fireBeforeUploadStarts({item: oItem})) {
791
+ var oHeaderFields = oItem.getHeaderFields().length ? oItem.getHeaderFields() : this.getHeaderFields();
792
+ this._getActiveUploader().uploadItem(oItem, oHeaderFields);
793
+ }
794
+ }
795
+ };
796
+
797
+ UploadSetTable.prototype._getActiveUploader = function () {
798
+ return this.getUploader() || this._getImplicitUploader();
799
+ };
800
+
801
+ UploadSetTable.prototype._getImplicitUploader = function () {
802
+ if (!this._oUploader) {
803
+ this._oUploader = new Uploader({
804
+ httpRequestMethod : this.getHttpRequestMethod()
805
+ });
806
+ this._oUploader.setUploadUrl(this.getUploadUrl());
807
+ this.registerUploaderEvents(this._oUploader);
808
+ this.addDependent(this._oUploader);
809
+ }
810
+
811
+ return this._oUploader;
812
+ };
813
+
814
+ UploadSetTable.prototype._setIllustratedMessage = function () {
815
+ if (!this._illustratedMessage) {
816
+ this._illustratedMessage = new IllustratedMessage({
817
+ illustrationType: IllustratedMessageType.UploadCollection,
818
+ illustrationSize: IllustratedMessageSize.Spot,
819
+ title: this.getNoDataText() ? this.getNoDataText() : "No Data Available",
820
+ description: this.getNoDataDescription() ? this.getNoDataDescription() : "Drag and Drop files here to upload"
821
+ });
822
+ }
823
+
824
+ this.setAggregation("_noColumnsMessage", this._illustratedMessage);
825
+ this.setAggregation("noData", this._illustratedMessage);
826
+ };
827
+
828
+ UploadSetTable.prototype._setFileUploaderVisibility = function (bInvisible) {
829
+ if (this._oFileUploader) {
830
+ var buttonRef = this._oFileUploader.oBrowse && this._oFileUploader.oBrowse ? this._oFileUploader : null;
831
+ if (buttonRef) {
832
+ if (bInvisible) {
833
+ buttonRef.addStyleClass("sapMUSTFileUploaderVisibility");
834
+ } else {
835
+ buttonRef.removeStyleClass("sapMUSTFileUploaderVisibility");
836
+ }
837
+ }
838
+ }
839
+ };
840
+
841
+ UploadSetTable.prototype._setDragDropConfig = function () {
842
+ var oDragDropConfig = new DragDropInfo({
843
+ sourceAggregation: "items",
844
+ targetAggregation: "items",
845
+ dragStart: [this._onDragStartItem, this],
846
+ drop: [this._onDropItem, this]
847
+ });
848
+ var oDropConfig = new DropInfo({
849
+ targetAggregation: "",
850
+ dropEffect:"Move",
851
+ dropPosition:"OnOrBetween",
852
+ dragEnter: [this._onDragEnterFile, this],
853
+ drop: [this._onDropFile, this]
854
+ });
855
+ this.addDragDropConfig(oDragDropConfig);
856
+ this.addDragDropConfig(oDropConfig);
857
+ };
858
+
859
+ UploadSetTable.prototype._onDragStartItem = function (oEvent) {
860
+ this.fireItemDragStart(oEvent);
861
+ };
862
+
863
+ UploadSetTable.prototype._onDropItem = function (oEvent) {
864
+ this.fireItemDrop(oEvent);
865
+ };
866
+
867
+ UploadSetTable.prototype._onDragEnterFile = function (oEvent) {
868
+ var oDragSession = oEvent.getParameter("dragSession");
869
+ var oDraggedControl = oDragSession.getDragControl();
870
+ this._oDragIndicator = true;
871
+ if (oDraggedControl) {
872
+ oEvent.preventDefault();
873
+ }
874
+ };
875
+
876
+ // Drag and drop of files implmentation subject to change depending on the thr UX feedback for folder upload scenarios and warning message display scenarios
877
+ UploadSetTable.prototype._onDropFile = function (oEvent) {
878
+ this._oDragIndicator = false;
879
+ oEvent.preventDefault();
880
+ if (this.getUploadEnabled()) {
881
+ var aItems = oEvent.getParameter("browserEvent").dataTransfer.files;
882
+
883
+ // handlding multiple property drag & drop scenarios
884
+ if (aItems && aItems.length && aItems.length > 1 && !this.getMultiple()) {
885
+ // logging the message currently will display message box with UX improvements feedback.
886
+ Log.warning("Multiple files upload is retsricted for this multiple property set");
887
+ return;
888
+ }
889
+
890
+
891
+ if (aItems && aItems.length) {
892
+ var oFileUploaderInstance = this.getDefaultFileUploader();
893
+ if (oFileUploaderInstance && oFileUploaderInstance._areFilesAllowed && oFileUploaderInstance._areFilesAllowed(aItems)) {
894
+ var aFiles = [];
895
+
896
+ // Need to explicitly copy the file list, FileUploader deliberately resets its form completely
897
+ // along with 'files' parameter when it (mistakenly) thinks that all is done.
898
+ for (var i = 0; i < aItems.length; i++) {
899
+ aFiles.push(aItems[i]);
900
+ }
901
+
902
+ var selectedFiles = [];
903
+ aFiles.forEach(function (oFile) {
904
+ var oItem = new UploadSetTableItem({
905
+ uploadState: UploadState.Ready
906
+ });
907
+ oItem._setFileObject(oFile);
908
+ oItem.setFileName(oFile.name);
909
+ selectedFiles.push(oItem);
910
+ /* fire the beforeInitiatingUpload to support use case for non instant uploads,
911
+ where additional item properties can be set by the consumer of the control */
912
+ this.fireBeforeInitiatingItemUpload({item: oItem});
913
+ if (this.getInstantUpload() && !this.getCustomDropFilesHandler()) {
914
+ this._uploadItemIfGoodToGo(oItem);
915
+ }
916
+ }.bind(this));
917
+
918
+ // fire the fncallback stored set through customDropFileHandler invocation
919
+ // this would be use for the consumers to get the files dropped into the area and to have custom inputs taken for each file dropped.
920
+ if (this.getCustomDropFilesHandler()) {
921
+ this.getCustomDropFilesHandler()({selectedItems: selectedFiles});
922
+ }
923
+ }
924
+ }
925
+ }
926
+ };
927
+
928
+ return UploadSetTable;
929
+ });