@openui5/sap.m 1.115.1 → 1.116.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.
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +4 -4
- package/src/sap/m/.library +1 -1
- package/src/sap/m/AccButton.js +1 -1
- package/src/sap/m/ActionListItem.js +1 -1
- package/src/sap/m/ActionSelect.js +1 -1
- package/src/sap/m/ActionSheet.js +6 -2
- package/src/sap/m/ActionTile.js +1 -1
- package/src/sap/m/ActionTileContent.js +1 -1
- package/src/sap/m/AdditionalTextButton.js +1 -1
- package/src/sap/m/App.js +1 -1
- package/src/sap/m/AssociativeOverflowToolbar.js +1 -1
- package/src/sap/m/Avatar.js +25 -2
- package/src/sap/m/Bar.js +1 -1
- package/src/sap/m/Breadcrumbs.js +1 -1
- package/src/sap/m/BusyDialog.js +5 -3
- package/src/sap/m/BusyIndicator.js +1 -1
- package/src/sap/m/Button.js +1 -1
- package/src/sap/m/Carousel.js +1 -1
- package/src/sap/m/CarouselLayout.js +1 -1
- package/src/sap/m/CarouselRenderer.js +1 -0
- package/src/sap/m/CheckBox.js +1 -1
- package/src/sap/m/ColorPalette.js +1 -1
- package/src/sap/m/ColorPalettePopover.js +1 -1
- package/src/sap/m/Column.js +29 -170
- package/src/sap/m/ColumnHeaderPopover.js +1 -1
- package/src/sap/m/ColumnListItem.js +5 -11
- package/src/sap/m/ColumnListItemRenderer.js +16 -27
- package/src/sap/m/ColumnPopoverActionItem.js +1 -1
- package/src/sap/m/ColumnPopoverCustomItem.js +1 -1
- package/src/sap/m/ColumnPopoverItem.js +1 -1
- package/src/sap/m/ColumnPopoverSelectListItem.js +1 -1
- package/src/sap/m/ColumnPopoverSortItem.js +1 -1
- package/src/sap/m/ComboBox.js +1 -1
- package/src/sap/m/ComboBoxBase.js +1 -1
- package/src/sap/m/ComboBoxTextField.js +1 -1
- package/src/sap/m/CustomListItem.js +1 -1
- package/src/sap/m/CustomTile.js +1 -1
- package/src/sap/m/CustomTreeItem.js +1 -1
- package/src/sap/m/DatePicker.js +23 -1
- package/src/sap/m/DateRangeSelection.js +34 -5
- package/src/sap/m/DateTimeField.js +13 -8
- package/src/sap/m/DateTimeInput.js +1 -1
- package/src/sap/m/DateTimePicker.js +1 -1
- package/src/sap/m/Dialog.js +1 -1
- package/src/sap/m/DisplayListItem.js +1 -1
- package/src/sap/m/DraftIndicator.js +1 -1
- package/src/sap/m/DynamicDate.js +1 -1
- package/src/sap/m/DynamicDateOption.js +1 -1
- package/src/sap/m/DynamicDateRange.js +1 -1
- package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
- package/src/sap/m/ExpandableText.js +1 -1
- package/src/sap/m/FacetFilter.js +1 -1
- package/src/sap/m/FacetFilterItem.js +1 -1
- package/src/sap/m/FacetFilterList.js +1 -1
- package/src/sap/m/FeedContent.js +1 -1
- package/src/sap/m/FeedInput.js +1 -1
- package/src/sap/m/FeedListItem.js +18 -1
- package/src/sap/m/FeedListItemAction.js +1 -1
- package/src/sap/m/Fiori20Adapter.js +2 -2
- package/src/sap/m/FlexBox.js +1 -1
- package/src/sap/m/FlexItemData.js +1 -1
- package/src/sap/m/FormattedText.js +43 -49
- package/src/sap/m/GenericTag.js +1 -1
- package/src/sap/m/GenericTile.js +1 -1
- package/src/sap/m/GroupHeaderListItem.js +1 -1
- package/src/sap/m/GroupHeaderListItemRenderer.js +5 -5
- package/src/sap/m/GrowingEnablement.js +22 -25
- package/src/sap/m/GrowingList.js +1 -1
- package/src/sap/m/HBox.js +1 -1
- package/src/sap/m/HeaderContainer.js +1 -1
- package/src/sap/m/HeaderContainerItemNavigator.js +1 -1
- package/src/sap/m/IconTabBar.js +1 -1
- package/src/sap/m/IconTabBarSelectList.js +1 -1
- package/src/sap/m/IconTabFilter.js +1 -2
- package/src/sap/m/IconTabFilterExpandButtonBadge.js +1 -1
- package/src/sap/m/IconTabHeader.js +1 -1
- package/src/sap/m/IconTabSeparator.js +1 -1
- package/src/sap/m/IllustratedMessage.js +1 -1
- package/src/sap/m/Illustration.js +1 -1
- package/src/sap/m/Image.js +1 -1
- package/src/sap/m/ImageContent.js +1 -1
- package/src/sap/m/Input.js +12 -7
- package/src/sap/m/InputBase.js +1 -1
- package/src/sap/m/InputListItem.js +1 -1
- package/src/sap/m/Label.js +1 -1
- package/src/sap/m/LightBox.js +1 -1
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +29 -1
- package/src/sap/m/List.js +1 -1
- package/src/sap/m/ListBase.js +3 -8
- package/src/sap/m/ListItemBase.js +1 -1
- package/src/sap/m/MaskEnabler.js +1 -1
- package/src/sap/m/MaskInput.js +1 -1
- package/src/sap/m/MaskInputRule.js +1 -1
- package/src/sap/m/Menu.js +1 -1
- package/src/sap/m/MenuButton.js +1 -1
- package/src/sap/m/MenuItem.js +1 -1
- package/src/sap/m/MenuListItem.js +1 -1
- package/src/sap/m/MessageItem.js +1 -1
- package/src/sap/m/MessageListItem.js +1 -1
- package/src/sap/m/MessagePage.js +1 -1
- package/src/sap/m/MessagePopover.js +1 -1
- package/src/sap/m/MessagePopoverItem.js +1 -1
- package/src/sap/m/MessageStrip.js +1 -1
- package/src/sap/m/MessageToast.js +1 -12
- package/src/sap/m/MessageView.js +1 -1
- package/src/sap/m/MultiComboBox.js +1 -1
- package/src/sap/m/MultiEditField.js +1 -1
- package/src/sap/m/MultiInput.js +1 -1
- package/src/sap/m/NavContainer.js +1 -1
- package/src/sap/m/NewsContent.js +1 -1
- package/src/sap/m/NotificationList.js +1 -1
- package/src/sap/m/NotificationListBase.js +1 -1
- package/src/sap/m/NotificationListGroup.js +1 -1
- package/src/sap/m/NotificationListItem.js +1 -1
- package/src/sap/m/NumericContent.js +1 -1
- package/src/sap/m/NumericInput.js +1 -1
- package/src/sap/m/ObjectAttribute.js +1 -1
- package/src/sap/m/ObjectHeader.js +1 -1
- package/src/sap/m/ObjectIdentifier.js +1 -1
- package/src/sap/m/ObjectListItem.js +1 -1
- package/src/sap/m/ObjectMarker.js +1 -1
- package/src/sap/m/ObjectNumber.js +1 -1
- package/src/sap/m/ObjectStatus.js +47 -4
- package/src/sap/m/ObjectStatusRenderer.js +7 -0
- package/src/sap/m/OverflowToolbar.js +7 -1
- package/src/sap/m/OverflowToolbarAssociativePopover.js +1 -1
- package/src/sap/m/OverflowToolbarButton.js +1 -1
- package/src/sap/m/OverflowToolbarLayoutData.js +1 -1
- package/src/sap/m/OverflowToolbarMenuButton.js +1 -1
- package/src/sap/m/OverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/P13nAnyFilterItem.js +1 -1
- package/src/sap/m/P13nColumnsItem.js +1 -1
- package/src/sap/m/P13nColumnsPanel.js +1 -1
- package/src/sap/m/P13nConditionPanel.js +1 -1
- package/src/sap/m/P13nDialog.js +1 -1
- package/src/sap/m/P13nDimMeasureItem.js +1 -1
- package/src/sap/m/P13nDimMeasurePanel.js +1 -1
- package/src/sap/m/P13nFilterItem.js +1 -1
- package/src/sap/m/P13nFilterPanel.js +1 -1
- package/src/sap/m/P13nGroupItem.js +1 -1
- package/src/sap/m/P13nGroupPanel.js +1 -1
- package/src/sap/m/P13nItem.js +1 -1
- package/src/sap/m/P13nPanel.js +1 -1
- package/src/sap/m/P13nSelectionItem.js +1 -1
- package/src/sap/m/P13nSelectionPanel.js +1 -1
- package/src/sap/m/P13nSortItem.js +1 -1
- package/src/sap/m/P13nSortPanel.js +1 -1
- package/src/sap/m/PDFViewer.js +1 -1
- package/src/sap/m/Page.js +1 -1
- package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/m/PagingButton.js +1 -1
- package/src/sap/m/Panel.js +1 -1
- package/src/sap/m/PlanningCalendar.js +1 -1
- package/src/sap/m/PlanningCalendarHeader.js +1 -1
- package/src/sap/m/PlanningCalendarLegend.js +1 -1
- package/src/sap/m/PlanningCalendarRow.js +1 -1
- package/src/sap/m/PlanningCalendarView.js +1 -1
- package/src/sap/m/Popover.js +1 -1
- package/src/sap/m/ProgressIndicator.js +1 -1
- package/src/sap/m/PullToRefresh.js +1 -1
- package/src/sap/m/QuickView.js +1 -1
- package/src/sap/m/QuickViewBase.js +1 -1
- package/src/sap/m/QuickViewCard.js +1 -1
- package/src/sap/m/QuickViewGroup.js +1 -1
- package/src/sap/m/QuickViewGroupElement.js +1 -1
- package/src/sap/m/QuickViewPage.js +1 -1
- package/src/sap/m/RadioButton.js +1 -1
- package/src/sap/m/RadioButtonGroup.js +1 -1
- package/src/sap/m/RangeSlider.js +1 -1
- package/src/sap/m/RatingIndicator.js +16 -4
- package/src/sap/m/RatingIndicatorRenderer.js +9 -2
- package/src/sap/m/ResponsivePopover.js +1 -1
- package/src/sap/m/ResponsiveScale.js +1 -1
- package/src/sap/m/ScrollBar.js +1 -1
- package/src/sap/m/ScrollContainer.js +1 -1
- package/src/sap/m/SearchField.js +1 -1
- package/src/sap/m/SearchFieldRenderer.js +1 -1
- package/src/sap/m/SegmentedButton.js +1 -1
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/Select.js +1 -1
- package/src/sap/m/SelectDialog.js +1 -1
- package/src/sap/m/SelectDialogBase.js +1 -1
- package/src/sap/m/SelectList.js +1 -1
- package/src/sap/m/SelectionDetails.js +1 -1
- package/src/sap/m/SelectionDetailsFacade.js +2 -2
- package/src/sap/m/SelectionDetailsItem.js +1 -1
- package/src/sap/m/SelectionDetailsItemLine.js +1 -1
- package/src/sap/m/Shell.js +1 -1
- package/src/sap/m/SimpleFixFlex.js +1 -1
- package/src/sap/m/SinglePlanningCalendar.js +1 -1
- package/src/sap/m/SinglePlanningCalendarDayView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthGrid.js +1 -1
- package/src/sap/m/SinglePlanningCalendarMonthView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWeekView.js +1 -1
- package/src/sap/m/SinglePlanningCalendarWorkWeekView.js +1 -1
- package/src/sap/m/SlideTile.js +1 -1
- package/src/sap/m/Slider.js +1 -1
- package/src/sap/m/SliderTooltip.js +1 -1
- package/src/sap/m/SliderTooltipBase.js +1 -1
- package/src/sap/m/SliderTooltipContainer.js +1 -1
- package/src/sap/m/SplitApp.js +1 -1
- package/src/sap/m/SplitButton.js +1 -1
- package/src/sap/m/SplitContainer.js +1 -1
- package/src/sap/m/StandardDynamicDateOption.js +1 -1
- package/src/sap/m/StandardListItem.js +1 -1
- package/src/sap/m/StandardTile.js +1 -1
- package/src/sap/m/StandardTreeItem.js +1 -1
- package/src/sap/m/StepInput.js +1 -1
- package/src/sap/m/SuggestionItem.js +1 -1
- package/src/sap/m/SuggestionsPopover.js +1 -1
- package/src/sap/m/Switch.js +1 -1
- package/src/sap/m/TabContainer.js +1 -1
- package/src/sap/m/TabContainerItem.js +1 -1
- package/src/sap/m/TabStrip.js +1 -1
- package/src/sap/m/TabStripItem.js +1 -1
- package/src/sap/m/Table.js +46 -169
- package/src/sap/m/TablePersoController.js +1 -1
- package/src/sap/m/TablePersoDialog.js +1 -1
- package/src/sap/m/TablePersoProvider.js +4 -1
- package/src/sap/m/TableRenderer.js +93 -121
- package/src/sap/m/TableSelectDialog.js +1 -1
- package/src/sap/m/Text.js +1 -1
- package/src/sap/m/TextArea.js +1 -1
- package/src/sap/m/Tile.js +1 -1
- package/src/sap/m/TileContainer.js +1 -1
- package/src/sap/m/TileContent.js +1 -1
- package/src/sap/m/TimePicker.js +29 -2
- package/src/sap/m/TimePickerClock.js +1 -1
- package/src/sap/m/TimePickerClocks.js +1 -1
- package/src/sap/m/TimePickerClocksRenderer.js +6 -13
- package/src/sap/m/TimePickerInputs.js +1 -1
- package/src/sap/m/TimePickerInputsRenderer.js +6 -10
- package/src/sap/m/TimePickerInternals.js +1 -44
- package/src/sap/m/TimePickerSlider.js +1 -1
- package/src/sap/m/TimePickerSliders.js +1 -1
- package/src/sap/m/Title.js +1 -1
- package/src/sap/m/TitlePropagationSupport.js +1 -1
- package/src/sap/m/ToggleButton.js +15 -3
- package/src/sap/m/Token.js +1 -1
- package/src/sap/m/Tokenizer.js +1 -1
- package/src/sap/m/Toolbar.js +1 -1
- package/src/sap/m/ToolbarLayoutData.js +1 -1
- package/src/sap/m/ToolbarSeparator.js +1 -1
- package/src/sap/m/ToolbarSpacer.js +1 -1
- package/src/sap/m/Tree.js +1 -1
- package/src/sap/m/TreeItemBase.js +1 -1
- package/src/sap/m/UploadCollection.js +1 -1
- package/src/sap/m/UploadCollectionItem.js +1 -1
- package/src/sap/m/UploadCollectionParameter.js +1 -1
- package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
- package/src/sap/m/VBox.js +1 -1
- package/src/sap/m/ValueStateHeader.js +1 -1
- package/src/sap/m/VariantManagement.js +1 -38
- package/src/sap/m/ViewSettingsCustomItem.js +1 -1
- package/src/sap/m/ViewSettingsCustomTab.js +1 -1
- package/src/sap/m/ViewSettingsDialog.js +1 -1
- package/src/sap/m/ViewSettingsFilterItem.js +1 -1
- package/src/sap/m/ViewSettingsItem.js +1 -1
- package/src/sap/m/VisibleItem.js +1 -1
- package/src/sap/m/WheelSlider.js +1 -1
- package/src/sap/m/WheelSliderContainer.js +1 -1
- package/src/sap/m/Wizard.js +1 -1
- package/src/sap/m/WizardProgressNavigator.js +1 -1
- package/src/sap/m/WizardStep.js +1 -1
- package/src/sap/m/changeHandler/AddTableColumn.js +1 -1
- package/src/sap/m/changeHandler/ChangeLinkTarget.js +1 -1
- package/src/sap/m/changeHandler/CombineButtons.js +1 -1
- package/src/sap/m/changeHandler/MoveTableColumns.js +1 -1
- package/src/sap/m/changeHandler/SelectIconTabBarFilter.js +1 -1
- package/src/sap/m/changeHandler/SplitMenuButton.js +1 -1
- package/src/sap/m/designtime/HBox.designtime.js +16 -0
- package/src/sap/m/designtime/IconTabFilter.designtime.js +0 -9
- package/src/sap/m/designtime/ObjectHeader.designtime.js +26 -0
- package/src/sap/m/designtime/Select.designtime.js +2 -1
- package/src/sap/m/designtime/VBox.designtime.js +16 -0
- package/src/sap/m/library.js +9 -2
- package/src/sap/m/messagebundle.properties +22 -11
- package/src/sap/m/messagebundle_ar.properties +16 -10
- package/src/sap/m/messagebundle_bg.properties +83 -77
- package/src/sap/m/messagebundle_ca.properties +14 -8
- package/src/sap/m/messagebundle_cs.properties +20 -14
- package/src/sap/m/messagebundle_cy.properties +15 -9
- package/src/sap/m/messagebundle_da.properties +15 -9
- package/src/sap/m/messagebundle_de.properties +15 -9
- package/src/sap/m/messagebundle_el.properties +16 -10
- package/src/sap/m/messagebundle_en.properties +15 -9
- package/src/sap/m/messagebundle_en_GB.properties +15 -9
- package/src/sap/m/messagebundle_en_US_sappsd.properties +13 -7
- package/src/sap/m/messagebundle_en_US_saprigi.properties +15 -7
- package/src/sap/m/messagebundle_en_US_saptrc.properties +13 -7
- package/src/sap/m/messagebundle_es.properties +13 -7
- package/src/sap/m/messagebundle_es_MX.properties +13 -7
- package/src/sap/m/messagebundle_et.properties +13 -7
- package/src/sap/m/messagebundle_fi.properties +18 -12
- package/src/sap/m/messagebundle_fr.properties +18 -12
- package/src/sap/m/messagebundle_fr_CA.properties +15 -9
- package/src/sap/m/messagebundle_hi.properties +16 -10
- package/src/sap/m/messagebundle_hr.properties +16 -10
- package/src/sap/m/messagebundle_hu.properties +20 -14
- package/src/sap/m/messagebundle_id.properties +17 -11
- package/src/sap/m/messagebundle_it.properties +13 -7
- package/src/sap/m/messagebundle_iw.properties +19 -13
- package/src/sap/m/messagebundle_ja.properties +50 -44
- package/src/sap/m/messagebundle_kk.properties +15 -9
- package/src/sap/m/messagebundle_ko.properties +15 -9
- package/src/sap/m/messagebundle_lt.properties +15 -9
- package/src/sap/m/messagebundle_lv.properties +13 -7
- package/src/sap/m/messagebundle_ms.properties +15 -9
- package/src/sap/m/messagebundle_nl.properties +13 -7
- package/src/sap/m/messagebundle_no.properties +18 -12
- package/src/sap/m/messagebundle_pl.properties +17 -11
- package/src/sap/m/messagebundle_pt.properties +13 -7
- package/src/sap/m/messagebundle_pt_PT.properties +13 -7
- package/src/sap/m/messagebundle_ro.properties +25 -19
- package/src/sap/m/messagebundle_ru.properties +14 -8
- package/src/sap/m/messagebundle_sh.properties +23 -17
- package/src/sap/m/messagebundle_sk.properties +15 -9
- package/src/sap/m/messagebundle_sl.properties +77 -71
- package/src/sap/m/messagebundle_sv.properties +17 -11
- package/src/sap/m/messagebundle_th.properties +21 -15
- package/src/sap/m/messagebundle_tr.properties +16 -10
- package/src/sap/m/messagebundle_uk.properties +18 -12
- package/src/sap/m/messagebundle_vi.properties +15 -9
- package/src/sap/m/messagebundle_zh_CN.properties +20 -14
- package/src/sap/m/messagebundle_zh_TW.properties +17 -11
- package/src/sap/m/p13n/AbstractContainer.js +2 -2
- package/src/sap/m/p13n/AbstractContainerItem.js +2 -2
- package/src/sap/m/p13n/BasePanel.js +11 -4
- package/src/sap/m/p13n/Container.js +9 -6
- package/src/sap/m/p13n/Engine.js +2 -1
- package/src/sap/m/p13n/GroupController.js +1 -1
- package/src/sap/m/p13n/GroupPanel.js +6 -1
- package/src/sap/m/p13n/PersistenceProvider.js +11 -6
- package/src/sap/m/p13n/Popup.js +1 -1
- package/src/sap/m/p13n/QueryPanel.js +18 -3
- package/src/sap/m/p13n/SelectionController.js +6 -7
- package/src/sap/m/p13n/SelectionPanel.js +11 -4
- package/src/sap/m/p13n/SortController.js +1 -1
- package/src/sap/m/p13n/SortPanel.js +8 -4
- package/src/sap/m/p13n/handler/xConfigHandler.js +1 -1
- package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +1 -1
- package/src/sap/m/p13n/modules/StateHandlerRegistry.js +1 -1
- package/src/sap/m/p13n/modules/UIManager.js +1 -1
- package/src/sap/m/plugins/CellSelector.js +1 -1
- package/src/sap/m/plugins/ColumnResizer.js +1 -9
- package/src/sap/m/plugins/CopyProvider.js +2 -10
- package/src/sap/m/plugins/DataStateIndicator.js +1 -1
- package/src/sap/m/plugins/PasteProvider.js +1 -1
- package/src/sap/m/plugins/PluginBase.js +1 -1
- package/src/sap/m/semantic/AddAction.js +1 -1
- package/src/sap/m/semantic/CancelAction.js +1 -1
- package/src/sap/m/semantic/DeleteAction.js +1 -1
- package/src/sap/m/semantic/DetailPage.js +1 -1
- package/src/sap/m/semantic/DiscussInJamAction.js +1 -1
- package/src/sap/m/semantic/EditAction.js +1 -1
- package/src/sap/m/semantic/FavoriteAction.js +1 -1
- package/src/sap/m/semantic/FilterAction.js +1 -1
- package/src/sap/m/semantic/FilterSelect.js +1 -1
- package/src/sap/m/semantic/FlagAction.js +1 -1
- package/src/sap/m/semantic/ForwardAction.js +1 -1
- package/src/sap/m/semantic/FullscreenPage.js +1 -1
- package/src/sap/m/semantic/GroupAction.js +1 -1
- package/src/sap/m/semantic/GroupSelect.js +1 -1
- package/src/sap/m/semantic/MainAction.js +1 -1
- package/src/sap/m/semantic/MasterPage.js +1 -1
- package/src/sap/m/semantic/MessagesIndicator.js +1 -1
- package/src/sap/m/semantic/MultiSelectAction.js +1 -1
- package/src/sap/m/semantic/NegativeAction.js +1 -1
- package/src/sap/m/semantic/OpenInAction.js +1 -1
- package/src/sap/m/semantic/PositiveAction.js +1 -1
- package/src/sap/m/semantic/PrintAction.js +1 -1
- package/src/sap/m/semantic/SaveAction.js +1 -1
- package/src/sap/m/semantic/Segment.js +1 -1
- package/src/sap/m/semantic/SegmentedContainer.js +1 -1
- package/src/sap/m/semantic/SemanticButton.js +1 -1
- package/src/sap/m/semantic/SemanticConfiguration.js +3 -3
- package/src/sap/m/semantic/SemanticControl.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarButton.js +1 -1
- package/src/sap/m/semantic/SemanticOverflowToolbarToggleButton.js +1 -1
- package/src/sap/m/semantic/SemanticPage.js +1 -1
- package/src/sap/m/semantic/SemanticSelect.js +1 -1
- package/src/sap/m/semantic/SemanticToggleButton.js +1 -1
- package/src/sap/m/semantic/SendEmailAction.js +1 -1
- package/src/sap/m/semantic/SendMessageAction.js +1 -1
- package/src/sap/m/semantic/ShareInJamAction.js +1 -1
- package/src/sap/m/semantic/ShareMenu.js +1 -1
- package/src/sap/m/semantic/ShareMenuPage.js +1 -1
- package/src/sap/m/semantic/SortAction.js +1 -1
- package/src/sap/m/semantic/SortSelect.js +1 -1
- package/src/sap/m/table/Util.js +1 -1
- package/src/sap/m/table/columnmenu/ActionItem.js +1 -1
- package/src/sap/m/table/columnmenu/Entry.js +1 -1
- package/src/sap/m/table/columnmenu/Item.js +1 -1
- package/src/sap/m/table/columnmenu/ItemBase.js +1 -1
- package/src/sap/m/table/columnmenu/Menu.js +1 -1
- package/src/sap/m/table/columnmenu/QuickAction.js +1 -1
- package/src/sap/m/table/columnmenu/QuickActionBase.js +1 -1
- package/src/sap/m/table/columnmenu/QuickActionItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickGroup.js +1 -1
- package/src/sap/m/table/columnmenu/QuickGroupItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickSort.js +1 -1
- package/src/sap/m/table/columnmenu/QuickSortItem.js +1 -1
- package/src/sap/m/table/columnmenu/QuickTotal.js +1 -1
- package/src/sap/m/table/columnmenu/QuickTotalItem.js +1 -1
- package/src/sap/m/themes/base/Avatar.less +32 -0
- package/src/sap/m/themes/base/MessageStrip.less +1 -1
- package/src/sap/m/themes/base/ObjectStatus.less +1 -2
- package/src/sap/m/themes/base/PlanningCalendarHeader.less +2 -1
- package/src/sap/m/themes/base/RadioButton.less +3 -1
- package/src/sap/m/themes/base/SearchField.less +8 -3
- package/src/sap/m/themes/base/Select.less +31 -2
- package/src/sap/m/themes/base/Table.less +0 -8
- package/src/sap/m/themes/base/TimePickerClocks.less +4 -0
- package/src/sap/m/themes/base/UploadSetTable.less +80 -0
- package/src/sap/m/themes/base/ValueStateMessage.less +1 -0
- package/src/sap/m/themes/base/Wizard.less +1 -1
- package/src/sap/m/themes/base/library.source.less +1 -0
- package/src/sap/m/upload/FilePreviewDialog.js +223 -0
- package/src/sap/m/upload/UploadSet.js +5 -4
- package/src/sap/m/upload/UploadSetItem.js +1 -27
- package/src/sap/m/upload/UploadSetTable.js +929 -0
- package/src/sap/m/upload/UploadSetTableItem.js +327 -0
- package/src/sap/m/upload/UploadSetTableItemRenderer.js +22 -0
- package/src/sap/m/upload/UploadSetTableRenderer.js +34 -0
- package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
- package/src/sap/m/upload/UploaderTableItem.js +276 -0
|
@@ -0,0 +1,327 @@
|
|
|
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.UploadSetTableItem.
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"sap/m/ColumnListItem",
|
|
10
|
+
"sap/ui/core/IconPool",
|
|
11
|
+
"sap/m/upload/UploadSetTableItemRenderer",
|
|
12
|
+
"sap/base/Log",
|
|
13
|
+
"sap/m/upload/FilePreviewDialog"
|
|
14
|
+
], function (ColumnListItem, IconPool, UploadSetTableItemRenderer, Log, FilePreviewDialog) {
|
|
15
|
+
"use strict";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Constructor for a new UploadSetTableItem.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} [sId] ID for the new control, will be generated automatically if no ID is provided.
|
|
21
|
+
* @param {object} [mSettings] Initial settings for the new control.
|
|
22
|
+
* @class ColumnListItem that represents one item to be uploaded using the {@link sap.m.upload.UploadSetTable} control.
|
|
23
|
+
* @extends sap.m.ColumnListItem
|
|
24
|
+
* @author SAP SE
|
|
25
|
+
* @constructor
|
|
26
|
+
* @private
|
|
27
|
+
* @experimental
|
|
28
|
+
* @internal
|
|
29
|
+
* @alias sap.m.upload.UploadSetTableItem
|
|
30
|
+
*/
|
|
31
|
+
var UploadSetTableItem = ColumnListItem.extend("sap.m.upload.UploadSetTableItem", {
|
|
32
|
+
metadata: {
|
|
33
|
+
properties: {
|
|
34
|
+
/**
|
|
35
|
+
* Specifies the name of the uploaded file.
|
|
36
|
+
*/
|
|
37
|
+
fileName: {type: "string", defaultValue: null},
|
|
38
|
+
/**
|
|
39
|
+
* Specifies the MIME type of the file.
|
|
40
|
+
*/
|
|
41
|
+
mediaType: {type: "string", defaultValue: null},
|
|
42
|
+
/**
|
|
43
|
+
* Specifies the URL where the file is located.
|
|
44
|
+
*/
|
|
45
|
+
url: {type: "string", defaultValue: null},
|
|
46
|
+
/**
|
|
47
|
+
* URL where the uploaded files will be stored. If empty, uploadUrl from the uploader is considered.
|
|
48
|
+
*/
|
|
49
|
+
uploadUrl: {type: "string", defaultValue: null},
|
|
50
|
+
/**
|
|
51
|
+
* State of the item relevant to its upload process.
|
|
52
|
+
*/
|
|
53
|
+
uploadState: {type: "sap.m.UploadState", defaultValue: null}
|
|
54
|
+
},
|
|
55
|
+
aggregations: {
|
|
56
|
+
/**
|
|
57
|
+
* Header fields to be included in the header section of an XMLHttpRequest (XHR) request
|
|
58
|
+
*/
|
|
59
|
+
headerFields: {type: "sap.ui.core.Item", multiple: true, singularName: "headerField"}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
render: UploadSetTableItemRenderer
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/* ================== */
|
|
66
|
+
/* Lifecycle handling */
|
|
67
|
+
/* ================== */
|
|
68
|
+
|
|
69
|
+
UploadSetTableItem.prototype.init = function () {
|
|
70
|
+
ColumnListItem.prototype.init.apply(this, arguments);
|
|
71
|
+
this._oFileObject = null;
|
|
72
|
+
this._fFileSize = null;
|
|
73
|
+
// Restriction flags
|
|
74
|
+
this._bFileTypeRestricted = false;
|
|
75
|
+
this._bNameLengthRestricted = false;
|
|
76
|
+
this._bSizeRestricted = false;
|
|
77
|
+
this._bMediaTypeRestricted = false;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
UploadSetTableItem.prototype.onBeforeRendering = function () {
|
|
81
|
+
ColumnListItem.prototype.onBeforeRendering.apply(this, arguments);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
UploadSetTableItem.prototype.onAfterRendering = function() {
|
|
85
|
+
ColumnListItem.prototype.onAfterRendering.call(this);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
UploadSetTableItem.prototype.exit = function() {
|
|
89
|
+
ColumnListItem.prototype.exit.call(this);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/* ===================== */
|
|
93
|
+
/* Overriden API methods */
|
|
94
|
+
/* ===================== */
|
|
95
|
+
|
|
96
|
+
UploadSetTableItem.prototype.setFileName = function (sFileName) {
|
|
97
|
+
if (this.getFileName() !== sFileName) {
|
|
98
|
+
this.setProperty("fileName", sFileName, true);
|
|
99
|
+
// File name related controls available no sooner than a parent is set
|
|
100
|
+
if (this.getParent()) {
|
|
101
|
+
this._checkNameLengthRestriction(this.getParent().getMaxFileNameLength());
|
|
102
|
+
this._checkTypeRestriction(this.getParent().getFileTypes());
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return this;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/* ============== */
|
|
110
|
+
/* Public methods */
|
|
111
|
+
/* ============== */
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Returns file object.
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
* @returns {File|Blob} File object.
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
UploadSetTableItem.prototype.getFileObject = function () {
|
|
121
|
+
return this._oFileObject;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Previews pressed file.
|
|
126
|
+
* @param {sap.m.upload.UploadSetTableItem} oItem The pressed UploadSetTableItem.
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
UploadSetTableItem.openPreview = function (oItem) {
|
|
130
|
+
oItem._previewCarousel();
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Downloads the item. Only possible when the item has a valid URL specified in the <code>url</code> property.
|
|
135
|
+
* @param {boolean} bAskForLocation Whether to ask for a location where to download the file or not.
|
|
136
|
+
* @public
|
|
137
|
+
* @returns {boolean} <code>true</code> if download is possible, <code>false</code> otherwise.
|
|
138
|
+
*/
|
|
139
|
+
UploadSetTableItem.prototype.download = function (bAskForLocation) {
|
|
140
|
+
var oParent = this.getParent();
|
|
141
|
+
if (!oParent) {
|
|
142
|
+
Log.warning("Download cannot proceed without a parent association.");
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return oParent._getActiveUploader ? oParent._getActiveUploader().download(this, [], bAskForLocation) : false;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Validates if the item is restricted, which means that it is restricted for the file type, media type, maximum file name length and maximum file size limit.
|
|
151
|
+
*
|
|
152
|
+
* @public
|
|
153
|
+
* @since 1.98
|
|
154
|
+
* @returns {boolean} <code>true</code> if item is restricted, <code>false</code> otherwise.
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
UploadSetTableItem.prototype.isRestricted = function () {
|
|
158
|
+
return this._isRestricted();
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/* =============== */
|
|
162
|
+
/* Private methods */
|
|
163
|
+
/* =============== */
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Previews file in a dialog with carousel.
|
|
167
|
+
*/
|
|
168
|
+
UploadSetTableItem.prototype._previewCarousel = function () {
|
|
169
|
+
var filePreviewDialog = new FilePreviewDialog(this);
|
|
170
|
+
filePreviewDialog.open();
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
UploadSetTableItem._getIconByMimeType = function(sMimeType, fileName) {
|
|
174
|
+
|
|
175
|
+
var mimeTypeForImages = ["image/png", "image/tiff", "image/bmp", "image/jpeg", "image/gif"];
|
|
176
|
+
|
|
177
|
+
if (sMimeType) {
|
|
178
|
+
if (mimeTypeForImages.indexOf(sMimeType) === -1) {
|
|
179
|
+
return IconPool.getIconForMimeType(sMimeType);
|
|
180
|
+
}
|
|
181
|
+
return UploadSetTableItem._getIconByFileType(fileName);
|
|
182
|
+
} else {
|
|
183
|
+
return UploadSetTableItem._getIconByFileType(fileName);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
UploadSetTableItem._getIconByFileType = function (fileName) {
|
|
188
|
+
var sFileExtension = UploadSetTableItem._splitFileName(fileName).extension;
|
|
189
|
+
if (!sFileExtension) {
|
|
190
|
+
return "sap-icon://document";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
switch (sFileExtension.toLowerCase()) {
|
|
194
|
+
case "bmp" :
|
|
195
|
+
case "jpg" :
|
|
196
|
+
case "jpeg" :
|
|
197
|
+
case "png" :
|
|
198
|
+
return UploadSetTableItem.IMAGE_FILE_ICON;
|
|
199
|
+
case "csv" :
|
|
200
|
+
case "xls" :
|
|
201
|
+
case "xlsx" :
|
|
202
|
+
return "sap-icon://excel-attachment";
|
|
203
|
+
case "doc" :
|
|
204
|
+
case "docx" :
|
|
205
|
+
case "odt" :
|
|
206
|
+
return "sap-icon://doc-attachment";
|
|
207
|
+
case "pdf" :
|
|
208
|
+
return "sap-icon://pdf-attachment";
|
|
209
|
+
case "ppt" :
|
|
210
|
+
case "pptx" :
|
|
211
|
+
return "sap-icon://ppt-attachment";
|
|
212
|
+
case "txt" :
|
|
213
|
+
return "sap-icon://document-text";
|
|
214
|
+
default :
|
|
215
|
+
return "sap-icon://document";
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
UploadSetTableItem._splitFileName = function (sFileName, bWithDot) {
|
|
220
|
+
var oResult = {};
|
|
221
|
+
var oRegex = /(?:\.([^.]+))?$/;
|
|
222
|
+
var aFileExtension = oRegex.exec(sFileName);
|
|
223
|
+
if (!aFileExtension[0]) {
|
|
224
|
+
aFileExtension[0] = "";
|
|
225
|
+
oResult.name = sFileName;
|
|
226
|
+
} else {
|
|
227
|
+
oResult.name = sFileName ? sFileName.slice(0, sFileName.indexOf(aFileExtension[0])) : "";
|
|
228
|
+
}
|
|
229
|
+
if (bWithDot) {
|
|
230
|
+
oResult.extension = aFileExtension[0];
|
|
231
|
+
} else {
|
|
232
|
+
oResult.extension = aFileExtension[1];
|
|
233
|
+
}
|
|
234
|
+
return oResult;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
UploadSetTableItem.prototype._setFileObject = function (oFileObject) {
|
|
238
|
+
this._oFileObject = oFileObject;
|
|
239
|
+
if (oFileObject) {
|
|
240
|
+
this._fFileSize = oFileObject.size / UploadSetTableItem.MEGABYTE;
|
|
241
|
+
this.setMediaType(oFileObject.type);
|
|
242
|
+
} else {
|
|
243
|
+
this._fFileSize = null;
|
|
244
|
+
this.setMediaType(null);
|
|
245
|
+
}
|
|
246
|
+
if (this.getParent()) {
|
|
247
|
+
this._checkSizeRestriction(this.getParent().getMaxFileSize());
|
|
248
|
+
this._checkMediaTypeRestriction(this.getParent().getMediaTypes());
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Checks if and how compliance with the file name length restriction changed for this item.
|
|
254
|
+
* @param {int} iMaxLength Maximum length of file name.
|
|
255
|
+
* @private
|
|
256
|
+
*/
|
|
257
|
+
UploadSetTableItem.prototype._checkNameLengthRestriction = function (iMaxLength) {
|
|
258
|
+
var bRestricted = (iMaxLength && !!this.getFileName() && this.getFileName().length > iMaxLength);
|
|
259
|
+
if (bRestricted !== this._bNameLengthRestricted) {
|
|
260
|
+
this._bNameLengthRestricted = bRestricted;
|
|
261
|
+
this.invalidate();
|
|
262
|
+
if (bRestricted && this.getParent()) {
|
|
263
|
+
this.getParent().fireFileNameLengthExceeded({item: this});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Checks if and how compliance with the file size restriction changed for this item.
|
|
270
|
+
* @param {float} fMaxSize Maximum file size allowed in megabytes.
|
|
271
|
+
* @private
|
|
272
|
+
*/
|
|
273
|
+
UploadSetTableItem.prototype._checkSizeRestriction = function (fMaxSize) {
|
|
274
|
+
var bRestricted = (fMaxSize && this._fFileSize > fMaxSize);
|
|
275
|
+
if (bRestricted !== this._bSizeRestricted) {
|
|
276
|
+
this._bSizeRestricted = bRestricted;
|
|
277
|
+
this.invalidate();
|
|
278
|
+
if (bRestricted && this.getParent()) {
|
|
279
|
+
this.getParent().fireFileSizeExceeded({item: this});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Checks if and how compliance with the mime type restriction changed for this item.
|
|
286
|
+
* @param {string[]} aTypes List of allowed mime types.
|
|
287
|
+
* @private
|
|
288
|
+
*/
|
|
289
|
+
UploadSetTableItem.prototype._checkMediaTypeRestriction = function (aTypes) {
|
|
290
|
+
var bRestricted = (!!aTypes && (aTypes.length > 0) && !!this.getMediaType() && aTypes.indexOf(this.getMediaType()) === -1);
|
|
291
|
+
if (bRestricted !== this._bMediaTypeRestricted) {
|
|
292
|
+
this._bMediaTypeRestricted = bRestricted;
|
|
293
|
+
this.invalidate();
|
|
294
|
+
if (bRestricted && this.getParent()) {
|
|
295
|
+
this.getParent().fireMediaTypeMismatch({item: this});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Checks if and how compliance with the file type restriction changed for this item.
|
|
302
|
+
* @param {string[]} aTypes List of allowed file types.
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
UploadSetTableItem.prototype._checkTypeRestriction = function (aTypes) {
|
|
306
|
+
var oFile = UploadSetTableItem._splitFileName(this.getFileName()),
|
|
307
|
+
bRestricted =
|
|
308
|
+
(!!this.getFileName() && !!aTypes && (aTypes.length > 0)
|
|
309
|
+
&& oFile.extension && aTypes.indexOf(oFile.extension.toLowerCase()) === -1);
|
|
310
|
+
if (bRestricted !== this._bFileTypeRestricted) {
|
|
311
|
+
this._bFileTypeRestricted = bRestricted;
|
|
312
|
+
this.invalidate();
|
|
313
|
+
if (bRestricted && this.getParent()) {
|
|
314
|
+
this.getParent().fireFileTypeMismatch({item: this});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
UploadSetTableItem.prototype._isRestricted = function () {
|
|
320
|
+
return this._bFileTypeRestricted || this._bNameLengthRestricted || this._bSizeRestricted || this._bMediaTypeRestricted;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
UploadSetTableItem.IMAGE_FILE_ICON = "sap-icon://card";
|
|
324
|
+
UploadSetTableItem.MEGABYTE = 1048576;
|
|
325
|
+
|
|
326
|
+
return UploadSetTableItem;
|
|
327
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
sap.ui.define(["sap/ui/core/Renderer", "sap/m/ColumnListItemRenderer", "sap/m/ListItemBaseRenderer"], function (Renderer, ColumnListItemRenderer) {
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* UploadSetTableItem renderer.
|
|
12
|
+
* @namespace
|
|
13
|
+
*/
|
|
14
|
+
var UploadSetTableItemRenderer = Renderer.extend(ColumnListItemRenderer);
|
|
15
|
+
UploadSetTableItemRenderer.apiVersion = 2;
|
|
16
|
+
|
|
17
|
+
UploadSetTableItemRenderer.render = function(rm, oLI) {
|
|
18
|
+
ColumnListItemRenderer.render.apply(this, arguments);
|
|
19
|
+
};
|
|
20
|
+
// enable in-place DOM patching
|
|
21
|
+
return UploadSetTableItemRenderer;
|
|
22
|
+
}, /* bExport= */ true);
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
sap.ui.define(["sap/ui/core/Renderer", "sap/m/TableRenderer", "sap/m/Table"
|
|
8
|
+
], function (Renderer, TableRenderer, Table) {
|
|
9
|
+
"use strict";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* UploadSetTable renderer.
|
|
13
|
+
* @namespace
|
|
14
|
+
*/
|
|
15
|
+
var UploadSetTableRenderer = Renderer.extend(TableRenderer);
|
|
16
|
+
UploadSetTableRenderer.apiVersion = 2; // enable in-place DOM patching
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
|
|
21
|
+
*
|
|
22
|
+
* @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer.
|
|
23
|
+
* @param {sap.m.upload.UploadSetTable} oControl an object representation of the control that should be rendered.
|
|
24
|
+
*/
|
|
25
|
+
UploadSetTableRenderer.render = function (oRm, oControl) {
|
|
26
|
+
oRm.openStart("div",oControl);
|
|
27
|
+
oRm.class("sapMUST");
|
|
28
|
+
oRm.openEnd();
|
|
29
|
+
TableRenderer.render.apply(this,arguments);
|
|
30
|
+
oRm.close("div");
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return UploadSetTableRenderer;
|
|
34
|
+
});
|
|
@@ -0,0 +1,276 @@
|
|
|
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
|
+
sap.ui.define([
|
|
8
|
+
"sap/base/Log",
|
|
9
|
+
"sap/m/library",
|
|
10
|
+
"sap/ui/core/Element",
|
|
11
|
+
"sap/ui/core/util/File",
|
|
12
|
+
"sap/ui/Device",
|
|
13
|
+
"sap/m/upload/UploadSetTableItem",
|
|
14
|
+
"sap/m/upload/UploaderHttpRequestMethod"
|
|
15
|
+
], function (Log, MobileLibrary, Element, FileUtil, Device, UploadSetItem, UploaderHttpRequestMethod) {
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Constructor for a new Uploader.
|
|
20
|
+
*
|
|
21
|
+
* @class
|
|
22
|
+
* A basic implementation for uploading and downloading one or multiple files.
|
|
23
|
+
*
|
|
24
|
+
* @extends sap.ui.core.Element
|
|
25
|
+
*
|
|
26
|
+
* @constructor
|
|
27
|
+
* @private
|
|
28
|
+
* @alias sap.m.upload.UploaderTableItem
|
|
29
|
+
*/
|
|
30
|
+
var Uploader = Element.extend("sap.m.upload.UploaderTableItem", {
|
|
31
|
+
metadata: {
|
|
32
|
+
library: "sap.m",
|
|
33
|
+
publicMethods: [
|
|
34
|
+
"uploadItem",
|
|
35
|
+
"downloadItem"
|
|
36
|
+
],
|
|
37
|
+
properties: {
|
|
38
|
+
/**
|
|
39
|
+
* URL where the next file is going to be uploaded to.
|
|
40
|
+
*/
|
|
41
|
+
uploadUrl: {type: "string", defaultValue: null},
|
|
42
|
+
/**
|
|
43
|
+
* URL where the next file is going to be download from.
|
|
44
|
+
*/
|
|
45
|
+
downloadUrl: {type: "string", defaultValue: null},
|
|
46
|
+
/**
|
|
47
|
+
* HTTP request method chosen for file upload.
|
|
48
|
+
* @since 1.90
|
|
49
|
+
*/
|
|
50
|
+
httpRequestMethod: {type: "sap.m.upload.UploaderHttpRequestMethod", defaultValue: UploaderHttpRequestMethod.Post},
|
|
51
|
+
/**
|
|
52
|
+
* This property decides the type of request. If set to "true", the request gets sent as a multipart/form-data request instead of file only request.
|
|
53
|
+
* @since 1.92
|
|
54
|
+
*/
|
|
55
|
+
useMultipart: { type: "boolean", defaultValue: false }
|
|
56
|
+
},
|
|
57
|
+
events: {
|
|
58
|
+
/**
|
|
59
|
+
* The event is fired just after the POST request was sent.
|
|
60
|
+
*/
|
|
61
|
+
uploadStarted: {
|
|
62
|
+
parameters: {
|
|
63
|
+
/**
|
|
64
|
+
* The item that is going to be uploaded.
|
|
65
|
+
*/
|
|
66
|
+
item: {type: "sap.m.upload.UploadSetTableItem"}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* The event is fired every time an XHR request reports progress in uploading.
|
|
71
|
+
*/
|
|
72
|
+
uploadProgressed: {
|
|
73
|
+
parameters: {
|
|
74
|
+
/**
|
|
75
|
+
* The item that is being uploaded.
|
|
76
|
+
*/
|
|
77
|
+
item: {type: "sap.m.upload.UploadSetTableItem"},
|
|
78
|
+
/**
|
|
79
|
+
* The number of bytes transferred since the beginning of the operation.
|
|
80
|
+
* This doesn't include headers and other overhead, but only the content itself
|
|
81
|
+
*/
|
|
82
|
+
loaded: {type: "int"},
|
|
83
|
+
/**
|
|
84
|
+
* The total number of bytes of content that will be transferred during the operation.
|
|
85
|
+
* If the total size is unknown, this value is zero.
|
|
86
|
+
*/
|
|
87
|
+
total: {type: "int"}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* The event is fired when an XHR request reports successful completion of upload process.
|
|
92
|
+
*/
|
|
93
|
+
uploadCompleted: {
|
|
94
|
+
parameters: {
|
|
95
|
+
/**
|
|
96
|
+
* The item that was uploaded.
|
|
97
|
+
*/
|
|
98
|
+
item: {type: "sap.m.upload.UploadSetTableItem"},
|
|
99
|
+
/**
|
|
100
|
+
* A JSON object containing the additional response parameters like response, responseXML, readyState, status and headers.
|
|
101
|
+
* <i>Sample response object:</i>
|
|
102
|
+
* <pre><code>
|
|
103
|
+
* {
|
|
104
|
+
* response: "<!DOCTYPE html>\n<html>...</html>\n",
|
|
105
|
+
* responseXML: null,
|
|
106
|
+
* readyState: 2,
|
|
107
|
+
* status: 404,
|
|
108
|
+
* headers: "allow: GET, HEAD"
|
|
109
|
+
* }
|
|
110
|
+
* </code></pre>
|
|
111
|
+
*/
|
|
112
|
+
responseXHR: {type: "object"}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
Uploader.prototype.init = function () {
|
|
120
|
+
this._mRequestHandlers = {};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Starts function for uploading one file object to given url. Returns promise that resolves when the upload is finished or rejects when the upload fails.
|
|
125
|
+
*
|
|
126
|
+
* @param {File|Blob} oFile File or Blob object to be uploaded.
|
|
127
|
+
* @param {string} sUrl Upload Url.
|
|
128
|
+
* @param {sap.ui.core.Item[]} [aHeaderFields] Collection of request header fields to be send along.
|
|
129
|
+
* @returns {Promise} Promise that resolves when the upload is finished or rejects when the upload fails.
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
Uploader.uploadFile = function (oFile, sUrl, aHeaderFields) {
|
|
133
|
+
var oXhr = new window.XMLHttpRequest();
|
|
134
|
+
var sHttpRequestMethod = this.getHttpRequestMethod();
|
|
135
|
+
|
|
136
|
+
return new Promise(function(resolve, reject) {
|
|
137
|
+
oXhr.open(sHttpRequestMethod, sUrl, true);
|
|
138
|
+
|
|
139
|
+
if ((Device.browser.edge || Device.browser.internet_explorer) && oFile.type && oXhr.readyState === 1) {
|
|
140
|
+
oXhr.setRequestHeader("Content-Type", oFile.type);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (aHeaderFields) {
|
|
144
|
+
aHeaderFields.forEach(function (oHeader) {
|
|
145
|
+
oXhr.setRequestHeader(oHeader.getKey(), oHeader.getText());
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
oXhr.onreadystatechange = function () {
|
|
150
|
+
if (this.readyState === window.XMLHttpRequest.DONE) {
|
|
151
|
+
if (this.status === 200) {
|
|
152
|
+
resolve(this);
|
|
153
|
+
} else {
|
|
154
|
+
reject(this);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
oXhr.send(oFile);
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Starts the process of uploading the specified file.
|
|
165
|
+
*
|
|
166
|
+
* @param {sap.m.upload.UploadSetTableItem} oItem Item representing the file to be uploaded.
|
|
167
|
+
* @param {sap.ui.core.Item[]} [aHeaderFields] Collection of request header fields to be send along.
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
Uploader.prototype.uploadItem = function (oItem, aHeaderFields) {
|
|
171
|
+
var oXhr = new window.XMLHttpRequest(),
|
|
172
|
+
oFile = oItem.getFileObject(),
|
|
173
|
+
that = this,
|
|
174
|
+
oRequestHandler = {
|
|
175
|
+
xhr: oXhr,
|
|
176
|
+
item: oItem
|
|
177
|
+
},
|
|
178
|
+
sHttpRequestMethod = this.getHttpRequestMethod(),
|
|
179
|
+
sUploadUrl = oItem.getUploadUrl() || this.getUploadUrl();
|
|
180
|
+
|
|
181
|
+
oXhr.open(sHttpRequestMethod, sUploadUrl, true);
|
|
182
|
+
|
|
183
|
+
if ((Device.browser.edge || Device.browser.internet_explorer) && oFile.type && oXhr.readyState === 1) {
|
|
184
|
+
oXhr.setRequestHeader("Content-Type", oFile.type);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (aHeaderFields) {
|
|
188
|
+
aHeaderFields.forEach(function (oHeader) {
|
|
189
|
+
oXhr.setRequestHeader(oHeader.getKey(), oHeader.getText());
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
oXhr.onreadystatechange = function () {
|
|
194
|
+
var oHandler = that._mRequestHandlers[oItem.getId()],
|
|
195
|
+
oResponseXHRParams = {};
|
|
196
|
+
if (this.readyState === window.XMLHttpRequest.DONE && !oHandler.aborted) {
|
|
197
|
+
oResponseXHRParams = {
|
|
198
|
+
"response": this.response,
|
|
199
|
+
"responseXML": this.responseXML,
|
|
200
|
+
"responseText": this.responseText,
|
|
201
|
+
"readyState": this.readyState,
|
|
202
|
+
"status": this.status,
|
|
203
|
+
"headers": this.getAllResponseHeaders()
|
|
204
|
+
};
|
|
205
|
+
that.fireUploadCompleted({item: oItem, responseXHR: oResponseXHRParams});
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
if (this.getUseMultipart()) {
|
|
210
|
+
var oFormData = new window.FormData();
|
|
211
|
+
var name = oFile ? oFile.name : null;
|
|
212
|
+
if (oFile instanceof window.Blob && name) {
|
|
213
|
+
oFormData.append(name, oFile, oFile.name);
|
|
214
|
+
} else {
|
|
215
|
+
oFormData.append(name, oFile);
|
|
216
|
+
}
|
|
217
|
+
oFormData.append("_charset_", "UTF-8");
|
|
218
|
+
oFile = oFormData;
|
|
219
|
+
|
|
220
|
+
this._mRequestHandlers[oItem.getId()] = oRequestHandler;
|
|
221
|
+
oXhr.send(oFile);
|
|
222
|
+
this.fireUploadStarted({item: oItem});
|
|
223
|
+
} else {
|
|
224
|
+
this._mRequestHandlers[oItem.getId()] = oRequestHandler;
|
|
225
|
+
oXhr.send(oFile);
|
|
226
|
+
this.fireUploadStarted({item: oItem});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Starts the process of downloading a file.
|
|
233
|
+
*
|
|
234
|
+
* @param {sap.m.upload.UploadSetTableItem} oItem Item representing the file to be downloaded.
|
|
235
|
+
* @param {sap.ui.core.Item[]} aHeaderFields List of header fields to be added to the GET request.
|
|
236
|
+
* @param {boolean} bAskForLocation True if the location to where download the file should be first queried by a browser dialog.
|
|
237
|
+
* @return {boolean} True if the download process successfully
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
Uploader.prototype.download = function (oItem, aHeaderFields, bAskForLocation) {
|
|
241
|
+
var sUrl = this.getDownloadUrl() || oItem.getUrl();
|
|
242
|
+
|
|
243
|
+
// File.save doesn't work in Safari but URLHelper.redirect does work.
|
|
244
|
+
// So, this overwrites the value of bAskForLocation in order to make it work.
|
|
245
|
+
if (Device.browser.name === "sf") {
|
|
246
|
+
bAskForLocation = false;
|
|
247
|
+
}
|
|
248
|
+
if (!oItem.getUrl()) {
|
|
249
|
+
Log.warning("Items to download do not have a URL.");
|
|
250
|
+
return false;
|
|
251
|
+
} else if (bAskForLocation) {
|
|
252
|
+
var oBlob = null,
|
|
253
|
+
oXhr = new window.XMLHttpRequest();
|
|
254
|
+
oXhr.open("GET", sUrl);
|
|
255
|
+
|
|
256
|
+
aHeaderFields.forEach(function (oHeader) {
|
|
257
|
+
oXhr.setRequestHeader(oHeader.getKey(), oHeader.getText());
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
oXhr.responseType = "blob"; // force the HTTP response, response-type header to be blob
|
|
261
|
+
oXhr.onload = function () {
|
|
262
|
+
var sFileName = oItem.getFileName(),
|
|
263
|
+
oSplit = UploadSetItem._splitFileName(sFileName, false);
|
|
264
|
+
oBlob = oXhr.response;
|
|
265
|
+
FileUtil.save(oBlob, oSplit.name, oSplit.extension, oItem.getMediaType(), "utf-8");
|
|
266
|
+
};
|
|
267
|
+
oXhr.send();
|
|
268
|
+
return true;
|
|
269
|
+
} else {
|
|
270
|
+
MobileLibrary.URLHelper.redirect(sUrl, true);
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
return Uploader;
|
|
276
|
+
});
|