@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.
- 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 +46 -5
- package/src/sap/m/AvatarRenderer.js +16 -10
- package/src/sap/m/Bar.js +1 -1
- package/src/sap/m/Breadcrumbs.js +6 -5
- 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 +24 -8
- package/src/sap/m/CarouselLayout.js +1 -1
- package/src/sap/m/CarouselRenderer.js +19 -4
- package/src/sap/m/CheckBox.js +8 -4
- 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 +7 -12
- 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 +31 -5
- package/src/sap/m/DatePickerRenderer.js +3 -2
- package/src/sap/m/DateRangeSelection.js +77 -25
- package/src/sap/m/DateTimeField.js +15 -10
- package/src/sap/m/DateTimeInput.js +1 -1
- package/src/sap/m/DateTimePicker.js +1 -1
- package/src/sap/m/DateTimePickerRenderer.js +3 -1
- package/src/sap/m/Dialog.js +16 -10
- package/src/sap/m/DialogRenderer.js +3 -3
- 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 +2 -2
- package/src/sap/m/DynamicDateRange.js +42 -5
- package/src/sap/m/DynamicDateValueHelpUIType.js +1 -1
- package/src/sap/m/ExpandableText.js +1 -1
- package/src/sap/m/FacetFilter.js +1 -3
- 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 +44 -50
- 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 +34 -32
- 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/HyphenationSupport.js +13 -4
- package/src/sap/m/IconTabBar.js +3 -1
- package/src/sap/m/IconTabBarSelectList.js +1 -1
- package/src/sap/m/IconTabFilter.js +3 -3
- 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 +4 -2
- package/src/sap/m/Illustration.js +1 -1
- package/src/sap/m/IllustrationPool.js +4 -3
- package/src/sap/m/Image.js +1 -1
- package/src/sap/m/ImageContent.js +1 -1
- package/src/sap/m/Input.js +21 -12
- package/src/sap/m/InputBase.js +7 -5
- package/src/sap/m/InputBaseRenderer.js +3 -3
- package/src/sap/m/InputListItem.js +1 -1
- package/src/sap/m/Label.js +1 -1
- package/src/sap/m/LabelRenderer.js +3 -3
- package/src/sap/m/LightBox.js +1 -1
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +36 -3
- package/src/sap/m/List.js +1 -1
- package/src/sap/m/ListBase.js +61 -28
- package/src/sap/m/ListBaseRenderer.js +12 -4
- package/src/sap/m/ListItemBase.js +17 -8
- package/src/sap/m/ListItemBaseRenderer.js +6 -6
- 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 +14 -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 +2 -2
- package/src/sap/m/MultiComboBox.js +3 -3
- package/src/sap/m/MultiEditField.js +1 -1
- package/src/sap/m/MultiInput.js +13 -2
- package/src/sap/m/NavContainer.js +21 -5
- 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 +6 -1
- package/src/sap/m/ObjectIdentifier.js +1 -1
- package/src/sap/m/ObjectListItem.js +9 -2
- package/src/sap/m/ObjectMarker.js +1 -1
- package/src/sap/m/ObjectNumber.js +1 -1
- package/src/sap/m/ObjectStatus.js +63 -4
- package/src/sap/m/ObjectStatusRenderer.js +21 -9
- package/src/sap/m/OverflowToolbar.js +30 -15
- package/src/sap/m/OverflowToolbarAssociativePopover.js +5 -5
- 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 +2 -8
- package/src/sap/m/P13nConditionPanel.js +1 -1
- package/src/sap/m/P13nDialog.js +2 -1
- package/src/sap/m/P13nDimMeasureItem.js +1 -1
- package/src/sap/m/P13nDimMeasurePanel.js +3 -10
- package/src/sap/m/P13nFilterItem.js +1 -1
- package/src/sap/m/P13nFilterPanel.js +28 -43
- 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 +5 -3
- 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/PDFViewerRenderer.js +1 -1
- package/src/sap/m/Page.js +8 -6
- package/src/sap/m/PageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/m/PagingButton.js +1 -1
- package/src/sap/m/Panel.js +11 -2
- package/src/sap/m/PanelRenderer.js +9 -0
- package/src/sap/m/PlanningCalendar.js +10 -4
- 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 +13 -17
- 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 +14 -1
- package/src/sap/m/QuickViewCardRenderer.js +0 -4
- package/src/sap/m/QuickViewGroup.js +1 -1
- package/src/sap/m/QuickViewGroupElement.js +1 -1
- package/src/sap/m/QuickViewPage.js +40 -28
- 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 +3 -3
- package/src/sap/m/SearchField.js +8 -12
- package/src/sap/m/SearchFieldRenderer.js +5 -5
- package/src/sap/m/SegmentedButton.js +4 -2
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/SegmentedButtonRenderer.js +3 -3
- package/src/sap/m/Select.js +18 -16
- package/src/sap/m/SelectDialog.js +1 -1
- package/src/sap/m/SelectDialogBase.js +28 -4
- package/src/sap/m/SelectList.js +5 -6
- 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 +43 -43
- 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 +8 -13
- package/src/sap/m/StandardDynamicDateOption.js +2 -2
- package/src/sap/m/StandardListItem.js +1 -1
- package/src/sap/m/StandardTile.js +1 -1
- package/src/sap/m/StandardTileRenderer.js +1 -1
- package/src/sap/m/StandardTreeItem.js +1 -1
- package/src/sap/m/StepInput.js +3 -3
- package/src/sap/m/SuggestionItem.js +4 -2
- 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 +59 -180
- 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 +98 -126
- 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/TextRenderer.js +3 -3
- 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/TileRenderer.js +7 -4
- package/src/sap/m/TimePicker.js +41 -12
- 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/TimePickerRenderer.js +3 -2
- 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 +4 -2
- package/src/sap/m/ToolbarLayoutData.js +1 -1
- package/src/sap/m/ToolbarSeparator.js +1 -1
- package/src/sap/m/ToolbarSpacer.js +1 -1
- package/src/sap/m/Tree.js +1 -1
- package/src/sap/m/TreeItemBase.js +1 -1
- package/src/sap/m/UploadCollection.js +2 -2
- package/src/sap/m/UploadCollectionItem.js +1 -1
- package/src/sap/m/UploadCollectionParameter.js +1 -1
- package/src/sap/m/UploadCollectionToolbarPlaceholder.js +1 -1
- package/src/sap/m/VBox.js +1 -1
- package/src/sap/m/ValueStateHeader.js +1 -1
- package/src/sap/m/VariantManagement.js +13 -50
- package/src/sap/m/ViewSettingsCustomItem.js +1 -1
- package/src/sap/m/ViewSettingsCustomTab.js +1 -1
- package/src/sap/m/ViewSettingsDialog.js +2 -2
- 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/inputUtils/SuggestionsPopoverDialogMixin.js +5 -5
- package/src/sap/m/inputUtils/SuggestionsPopoverPopoverMixin.js +4 -0
- package/src/sap/m/library.js +62 -7
- package/src/sap/m/messagebundle.properties +27 -13
- package/src/sap/m/messagebundle_ar.properties +36 -20
- package/src/sap/m/messagebundle_bg.properties +102 -86
- package/src/sap/m/messagebundle_ca.properties +34 -18
- package/src/sap/m/messagebundle_cs.properties +40 -24
- package/src/sap/m/messagebundle_cy.properties +35 -19
- package/src/sap/m/messagebundle_da.properties +35 -19
- package/src/sap/m/messagebundle_de.properties +35 -19
- package/src/sap/m/messagebundle_el.properties +36 -20
- package/src/sap/m/messagebundle_en.properties +35 -19
- package/src/sap/m/messagebundle_en_GB.properties +35 -19
- package/src/sap/m/messagebundle_en_US_sappsd.properties +34 -18
- package/src/sap/m/messagebundle_en_US_saprigi.properties +34 -18
- package/src/sap/m/messagebundle_en_US_saptrc.properties +34 -18
- package/src/sap/m/messagebundle_es.properties +33 -17
- package/src/sap/m/messagebundle_es_MX.properties +33 -17
- package/src/sap/m/messagebundle_et.properties +33 -17
- package/src/sap/m/messagebundle_fi.properties +37 -21
- package/src/sap/m/messagebundle_fr.properties +38 -22
- package/src/sap/m/messagebundle_fr_CA.properties +35 -19
- package/src/sap/m/messagebundle_hi.properties +36 -20
- package/src/sap/m/messagebundle_hr.properties +36 -20
- package/src/sap/m/messagebundle_hu.properties +39 -23
- package/src/sap/m/messagebundle_id.properties +38 -22
- package/src/sap/m/messagebundle_it.properties +33 -17
- package/src/sap/m/messagebundle_iw.properties +40 -24
- package/src/sap/m/messagebundle_ja.properties +70 -54
- package/src/sap/m/messagebundle_kk.properties +35 -19
- package/src/sap/m/messagebundle_ko.properties +36 -20
- package/src/sap/m/messagebundle_lt.properties +35 -19
- package/src/sap/m/messagebundle_lv.properties +33 -17
- package/src/sap/m/messagebundle_ms.properties +35 -19
- package/src/sap/m/messagebundle_nl.properties +35 -19
- package/src/sap/m/messagebundle_no.properties +38 -22
- package/src/sap/m/messagebundle_pl.properties +35 -19
- package/src/sap/m/messagebundle_pt.properties +33 -17
- package/src/sap/m/messagebundle_pt_PT.properties +33 -17
- package/src/sap/m/messagebundle_ro.properties +45 -29
- package/src/sap/m/messagebundle_ru.properties +32 -16
- package/src/sap/m/messagebundle_sh.properties +43 -27
- package/src/sap/m/messagebundle_sk.properties +35 -19
- package/src/sap/m/messagebundle_sl.properties +96 -80
- package/src/sap/m/messagebundle_sv.properties +37 -21
- package/src/sap/m/messagebundle_th.properties +42 -26
- package/src/sap/m/messagebundle_tr.properties +36 -20
- package/src/sap/m/messagebundle_uk.properties +38 -22
- package/src/sap/m/messagebundle_vi.properties +35 -19
- package/src/sap/m/messagebundle_zh_CN.properties +40 -24
- package/src/sap/m/messagebundle_zh_TW.properties +37 -21
- 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 -5
- package/src/sap/m/p13n/Container.js +9 -6
- package/src/sap/m/p13n/Engine.js +33 -5
- package/src/sap/m/p13n/FlexUtil.js +7 -3
- package/src/sap/m/p13n/GroupController.js +1 -1
- package/src/sap/m/p13n/GroupPanel.js +6 -1
- package/src/sap/m/p13n/MetadataHelper.js +1 -1
- package/src/sap/m/p13n/PersistenceProvider.js +2 -92
- package/src/sap/m/p13n/Popup.js +25 -2
- 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 +16 -5
- package/src/sap/m/p13n/SortController.js +1 -1
- package/src/sap/m/p13n/SortPanel.js +8 -4
- package/src/sap/m/p13n/enum/PersistenceMode.js +9 -0
- package/src/sap/m/p13n/handler/xConfigHandler.js +13 -13
- package/src/sap/m/p13n/modification/FlexModificationHandler.js +24 -1
- package/src/sap/m/p13n/modules/DefaultProviderRegistry.js +1 -13
- package/src/sap/m/p13n/modules/StateHandlerRegistry.js +1 -1
- package/src/sap/m/p13n/modules/UIManager.js +5 -4
- package/src/sap/m/p13n/modules/xConfigAPI.js +26 -0
- package/src/sap/m/plugins/CellSelector.js +534 -799
- 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 +8 -2
- 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 +6 -5
- 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 +78 -7
- package/src/sap/m/themes/base/Carousel.less +7 -0
- package/src/sap/m/themes/base/CellSelector.less +50 -105
- package/src/sap/m/themes/base/IconTabBar.less +1 -1
- package/src/sap/m/themes/base/Link.less +20 -24
- package/src/sap/m/themes/base/MessageStrip.less +1 -1
- package/src/sap/m/themes/base/NumericContent.less +4 -0
- package/src/sap/m/themes/base/ObjectStatus.less +1 -2
- package/src/sap/m/themes/base/Panel.less +14 -0
- 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 +13 -3
- package/src/sap/m/themes/base/Select.less +32 -2
- package/src/sap/m/themes/base/Table.less +4 -8
- package/src/sap/m/themes/base/TimePickerClocks.less +4 -0
- package/src/sap/m/themes/base/UploadSet.less +13 -1
- 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/VariantManagement.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 +257 -0
- package/src/sap/m/upload/UploadSet.js +140 -67
- package/src/sap/m/upload/UploadSetItem.js +51 -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
- 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 "body" 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
|
+
});
|