@openui5/sap.m 1.129.0 → 1.130.1
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/THIRDPARTY.txt +1 -1
- package/package.json +4 -4
- package/src/sap/m/.library +2 -4
- 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 +1 -1
- package/src/sap/m/ActionTile.js +7 -8
- package/src/sap/m/ActionTileContent.js +1 -2
- 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 +30 -11
- package/src/sap/m/AvatarRenderer.js +8 -4
- package/src/sap/m/Bar.js +1 -1
- package/src/sap/m/Breadcrumbs.js +8 -2
- package/src/sap/m/BreadcrumbsRenderer.js +1 -1
- package/src/sap/m/BusyDialog.js +1 -1
- package/src/sap/m/BusyIndicator.js +1 -1
- package/src/sap/m/Button.js +1 -1
- package/src/sap/m/Carousel.js +31 -30
- package/src/sap/m/CarouselLayout.js +1 -1
- package/src/sap/m/CarouselRenderer.js +5 -5
- package/src/sap/m/CheckBox.js +13 -1
- package/src/sap/m/CheckBoxRenderer.js +40 -29
- package/src/sap/m/ColorPalette.js +1 -1
- package/src/sap/m/ColorPalettePopover.js +1 -1
- package/src/sap/m/Column.js +1 -1
- package/src/sap/m/ColumnHeaderPopover.js +1 -1
- package/src/sap/m/ColumnListItem.js +1 -1
- 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/ContentConfig.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 +1 -1
- package/src/sap/m/DateRangeSelection.js +2 -2
- package/src/sap/m/DateTimeField.js +1 -1
- 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/DynamicDateFormat.js +14 -0
- package/src/sap/m/DynamicDateOption.js +1 -1
- package/src/sap/m/DynamicDateRange.js +89 -19
- package/src/sap/m/DynamicDateUtil.js +28 -0
- package/src/sap/m/DynamicDateValueHelpUIType.js +8 -3
- 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 +1 -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 +1 -1
- package/src/sap/m/GenericTag.js +1 -1
- package/src/sap/m/GenericTile.js +7 -19
- package/src/sap/m/GroupHeaderListItem.js +1 -1
- package/src/sap/m/GrowingList.js +1 -1
- package/src/sap/m/HBox.js +1 -1
- package/src/sap/m/HeaderContainer.js +1 -2
- 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 -1
- 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 +7 -4
- package/src/sap/m/InputBase.js +15 -3
- package/src/sap/m/InputListItem.js +8 -2
- package/src/sap/m/InputListItemRenderer.js +16 -6
- package/src/sap/m/Label.js +14 -3
- package/src/sap/m/LabelRenderer.js +48 -5
- package/src/sap/m/LightBox.js +1 -1
- package/src/sap/m/LightBoxItem.js +1 -1
- package/src/sap/m/Link.js +15 -3
- package/src/sap/m/LinkTileContent.js +1 -1
- package/src/sap/m/List.js +1 -1
- package/src/sap/m/ListBase.js +4 -4
- 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 +24 -6
- package/src/sap/m/MenuButton.js +1 -1
- package/src/sap/m/MenuItem.js +1 -1
- package/src/sap/m/MenuItemGroup.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 -1
- package/src/sap/m/MessageView.js +6 -2
- 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 +15 -4
- package/src/sap/m/OverflowToolbar.js +1 -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 +12 -1
- package/src/sap/m/PlanningCalendarLegendRenderer.js +10 -4
- 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 +1 -1
- 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/SegmentedButton.js +1 -1
- package/src/sap/m/SegmentedButtonItem.js +1 -1
- package/src/sap/m/Select.js +22 -6
- 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 +2 -2
- package/src/sap/m/SinglePlanningCalendarMonthGridRenderer.js +11 -4
- 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 -2
- package/src/sap/m/Slider.js +2 -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 +371 -30
- 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 +39 -44
- package/src/sap/m/TabContainerItem.js +40 -1
- package/src/sap/m/TabStrip.js +1 -1
- package/src/sap/m/TabStripItem.js +1 -1
- package/src/sap/m/Table.js +2 -4
- package/src/sap/m/TablePersoController.js +1 -1
- package/src/sap/m/TablePersoDialog.js +1 -1
- package/src/sap/m/TablePersoProvider.js +1 -1
- package/src/sap/m/TableSelectDialog.js +99 -29
- package/src/sap/m/Text.js +15 -3
- 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 +3 -3
- package/src/sap/m/TileInfo.js +1 -1
- package/src/sap/m/TimePicker.js +1 -1
- package/src/sap/m/TimePickerClock.js +1 -1
- package/src/sap/m/TimePickerClocks.js +1 -1
- package/src/sap/m/TimePickerInputs.js +1 -1
- package/src/sap/m/TimePickerInternals.js +1 -1
- 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 +1 -1
- 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/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/_thirdparty/purify.js +632 -697
- 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/messagebundle_da.properties +2 -2
- package/src/sap/m/designtime/messagebundle_mk.properties +3 -3
- package/src/sap/m/inputUtils/ListHelpers.js +4 -0
- package/src/sap/m/library.js +111 -6
- package/src/sap/m/messagebundle.properties +39 -28
- package/src/sap/m/messagebundle_ar.properties +26 -10
- package/src/sap/m/messagebundle_bg.properties +29 -13
- package/src/sap/m/messagebundle_ca.properties +21 -5
- package/src/sap/m/messagebundle_cnr.properties +23 -7
- package/src/sap/m/messagebundle_cs.properties +23 -7
- package/src/sap/m/messagebundle_cy.properties +30 -14
- package/src/sap/m/messagebundle_da.properties +34 -18
- package/src/sap/m/messagebundle_de.properties +21 -5
- package/src/sap/m/messagebundle_el.properties +22 -6
- package/src/sap/m/messagebundle_en.properties +22 -20
- package/src/sap/m/messagebundle_en_GB.properties +21 -5
- package/src/sap/m/messagebundle_en_US_saprigi.properties +22 -6
- package/src/sap/m/messagebundle_es.properties +25 -9
- package/src/sap/m/messagebundle_es_MX.properties +22 -6
- package/src/sap/m/messagebundle_et.properties +21 -5
- package/src/sap/m/messagebundle_fi.properties +22 -6
- package/src/sap/m/messagebundle_fr.properties +34 -18
- package/src/sap/m/messagebundle_fr_CA.properties +20 -4
- package/src/sap/m/messagebundle_hi.properties +23 -7
- package/src/sap/m/messagebundle_hr.properties +76 -60
- package/src/sap/m/messagebundle_hu.properties +21 -5
- package/src/sap/m/messagebundle_id.properties +23 -7
- package/src/sap/m/messagebundle_it.properties +25 -9
- package/src/sap/m/messagebundle_iw.properties +21 -5
- package/src/sap/m/messagebundle_ja.properties +23 -7
- package/src/sap/m/messagebundle_kk.properties +23 -7
- package/src/sap/m/messagebundle_ko.properties +23 -7
- package/src/sap/m/messagebundle_lt.properties +21 -5
- package/src/sap/m/messagebundle_lv.properties +22 -6
- package/src/sap/m/messagebundle_mk.properties +28 -12
- package/src/sap/m/messagebundle_ms.properties +22 -6
- package/src/sap/m/messagebundle_nl.properties +23 -7
- package/src/sap/m/messagebundle_no.properties +23 -7
- package/src/sap/m/messagebundle_pl.properties +21 -5
- package/src/sap/m/messagebundle_pt.properties +21 -5
- package/src/sap/m/messagebundle_pt_PT.properties +21 -5
- package/src/sap/m/messagebundle_ro.properties +22 -6
- package/src/sap/m/messagebundle_ru.properties +23 -7
- package/src/sap/m/messagebundle_sh.properties +23 -7
- package/src/sap/m/messagebundle_sk.properties +23 -7
- package/src/sap/m/messagebundle_sl.properties +23 -7
- package/src/sap/m/messagebundle_sr.properties +23 -7
- package/src/sap/m/messagebundle_sv.properties +26 -10
- package/src/sap/m/messagebundle_th.properties +24 -8
- package/src/sap/m/messagebundle_tr.properties +22 -6
- package/src/sap/m/messagebundle_uk.properties +22 -6
- package/src/sap/m/messagebundle_vi.properties +26 -10
- package/src/sap/m/messagebundle_zh_CN.properties +23 -7
- package/src/sap/m/messagebundle_zh_TW.properties +21 -5
- 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 +1 -1
- package/src/sap/m/p13n/Container.js +1 -1
- package/src/sap/m/p13n/Engine.js +1 -1
- package/src/sap/m/p13n/FilterController.js +1 -1
- package/src/sap/m/p13n/FilterPanel.js +1 -1
- package/src/sap/m/p13n/GroupController.js +1 -1
- package/src/sap/m/p13n/GroupPanel.js +1 -1
- package/src/sap/m/p13n/MessageStrip.js +1 -1
- package/src/sap/m/p13n/Popup.js +1 -1
- package/src/sap/m/p13n/QueryPanel.js +1 -1
- package/src/sap/m/p13n/SelectionController.js +1 -1
- package/src/sap/m/p13n/SelectionPanel.js +1 -1
- package/src/sap/m/p13n/SortController.js +1 -1
- package/src/sap/m/p13n/SortPanel.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 +10 -6
- package/src/sap/m/plugins/ColumnResizer.js +1 -1
- package/src/sap/m/plugins/ContextMenuSetting.js +1 -1
- package/src/sap/m/plugins/CopyProvider.js +1 -1
- package/src/sap/m/plugins/DataStateIndicator.js +3 -2
- package/src/sap/m/plugins/PasteProvider.js +1 -1
- package/src/sap/m/plugins/PluginBase.js +1 -1
- package/src/sap/m/plugins/UploadSetwithTable.js +54 -12
- 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 +1 -1
- 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/ColumnWidthController.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/MenuBase.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/Breadcrumbs.less +5 -0
- package/src/sap/m/themes/base/Carousel.less +21 -7
- package/src/sap/m/themes/base/ColumnListItem.less +29 -22
- package/src/sap/m/themes/base/ColumnResizer.less +4 -4
- package/src/sap/m/themes/base/DisplayListItem.less +5 -10
- package/src/sap/m/themes/base/DynamicDateRange.less +3 -1
- package/src/sap/m/themes/base/GroupHeaderListItem.less +11 -15
- package/src/sap/m/themes/base/IconTabBar.less +168 -134
- package/src/sap/m/themes/base/IconTabBarSelectList.less +22 -25
- package/src/sap/m/themes/base/Illustration.less +26 -10
- package/src/sap/m/themes/base/InputListItem.less +16 -17
- package/src/sap/m/themes/base/Label.less +32 -81
- package/src/sap/m/themes/base/Link.less +16 -17
- package/src/sap/m/themes/base/ObjectStatus.less +29 -0
- package/src/sap/m/themes/base/RatingIndicator.less +2 -2
- package/src/sap/m/themes/base/StandardListItem.less +21 -0
- package/src/sap/m/themes/base/TabContainer.less +1 -1
- package/src/sap/m/themes/base/Table.less +9 -1
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-BeforeSearch.svg +10 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoActivities.svg +23 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoData.svg +9 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoEntries.svg +12 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoMail.svg +10 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoNotifications.svg +10 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoSavedItems.svg +9 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-NoTasks.svg +20 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-SuccessBalloon.svg +19 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-SuccessCheckMark.svg +7 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-UnableToLoad.svg +10 -0
- package/src/sap/m/themes/base/illustrations/sapIllus-Dot-UnableToUpload.svg +10 -0
- package/src/sap/m/upload/ActionsPlaceholder.js +12 -2
- package/src/sap/m/upload/Column.js +1 -1
- package/src/sap/m/upload/FilePreviewDialog.js +1 -2
- package/src/sap/m/upload/UploadItem.js +1 -1
- package/src/sap/m/upload/UploadItemConfiguration.js +1 -1
- package/src/sap/m/upload/UploadSet.js +6 -3
- package/src/sap/m/upload/UploadSetItem.js +1 -1
- package/src/sap/m/upload/UploadSetToolbarPlaceholder.js +1 -1
- package/src/sap/m/upload/UploaderTableItem.js +7 -10
- package/src/sap/m/upload/UploadSetwithTable.js +0 -1607
- package/src/sap/m/upload/UploadSetwithTableItem.js +0 -344
- package/src/sap/m/upload/UploadSetwithTableItemRenderer.js +0 -23
- package/src/sap/m/upload/UploadSetwithTableRenderer.js +0 -31
- package/src/sap/m/upload/p13n/PersManager.js +0 -253
- package/src/sap/m/upload/p13n/flexibility/UploadSetwithTable.flexibility.js +0 -32
- package/src/sap/m/upload/p13n/handlers/BaseConfigHandler.js +0 -44
- package/src/sap/m/upload/p13n/handlers/ChangeHandler.js +0 -98
- package/src/sap/m/upload/p13n/handlers/ColumnConfigHandler.js +0 -57
- package/src/sap/m/upload/p13n/handlers/ColumnsStateChangeHandler.js +0 -43
- package/src/sap/m/upload/p13n/handlers/FilterConfigHandler.js +0 -71
- package/src/sap/m/upload/p13n/handlers/FilterStateChangeHandler.js +0 -65
- package/src/sap/m/upload/p13n/handlers/GroupConfigHandler.js +0 -57
- package/src/sap/m/upload/p13n/handlers/GroupStateChangeHandler.js +0 -46
- package/src/sap/m/upload/p13n/handlers/SortConfigHandler.js +0 -57
- package/src/sap/m/upload/p13n/handlers/SortStateChangeHandler.js +0 -48
- package/src/sap/m/upload/p13n/mediator/BaseMediator.js +0 -183
- package/src/sap/m/upload/p13n/mediator/ColumnsMediator.js +0 -211
- package/src/sap/m/upload/p13n/mediator/FilterMediator.js +0 -199
- package/src/sap/m/upload/p13n/mediator/GroupMediator.js +0 -193
- package/src/sap/m/upload/p13n/mediator/SortMediator.js +0 -201
- package/src/sap/m/upload/p13n/modules/CustomDataConfig.js +0 -100
- package/src/sap/m/upload/p13n/modules/PersPopupManager.js +0 -76
|
@@ -1,1607 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2024 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.UploadSetwithTable.
|
|
8
|
-
sap.ui.define([
|
|
9
|
-
"sap/m/Table",
|
|
10
|
-
"sap/m/ToolbarSpacer",
|
|
11
|
-
"sap/m/upload/UploadSetwithTableRenderer",
|
|
12
|
-
"sap/ui/core/Lib",
|
|
13
|
-
"sap/ui/unified/FileUploader",
|
|
14
|
-
"sap/m/upload/UploaderHttpRequestMethod",
|
|
15
|
-
"sap/m/OverflowToolbar",
|
|
16
|
-
"sap/m/upload/UploadSetwithTableItem",
|
|
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/m/upload/FilePreviewDialog",
|
|
27
|
-
"sap/ui/base/Event",
|
|
28
|
-
"sap/m/Dialog",
|
|
29
|
-
"sap/m/Label",
|
|
30
|
-
"sap/m/Input",
|
|
31
|
-
"sap/m/MessageBox",
|
|
32
|
-
"sap/m/Button",
|
|
33
|
-
"sap/ui/core/Core",
|
|
34
|
-
"sap/ui/fl/variants/VariantManagement",
|
|
35
|
-
"sap/m/upload/p13n/PersManager",
|
|
36
|
-
"sap/m/upload/p13n/mediator/ColumnsMediator",
|
|
37
|
-
"sap/m/upload/p13n/mediator/SortMediator",
|
|
38
|
-
"sap/m/upload/p13n/mediator/GroupMediator",
|
|
39
|
-
"sap/m/upload/p13n/mediator/FilterMediator",
|
|
40
|
-
"sap/ui/core/mvc/XMLView",
|
|
41
|
-
"sap/ui/core/Element",
|
|
42
|
-
"sap/m/MenuButton",
|
|
43
|
-
"sap/m/MenuItem",
|
|
44
|
-
"sap/m/Menu"
|
|
45
|
-
], function(Table, ToolbarSpacer, UploadSetwithTableRenderer, Library1, FileUploader, UploaderHttpRequestMethod, OverFlowToolbar, UploadSetwithTableItem, deepEqual, Log, Library, IllustratedMessageType, IllustratedMessage, IllustratedMessageSize, Uploader, DragDropInfo, DropInfo, FilePreviewDialog, EventBase, Dialog, Label, Input, MessageBox, Button, Core, VariantManagement, PersManager, ColumnsMediator, SortMediator, GroupMediator, FilterMediator, View, Element, MenuButton, MenuItem, Menu) {
|
|
46
|
-
"use strict";
|
|
47
|
-
|
|
48
|
-
var MenuButtonMode = Library.MenuButtonMode;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Constructor for a new UploadSetwithTable.
|
|
52
|
-
*
|
|
53
|
-
* @param {string} [sId] Id for the new control, it is generated automatically if no id is provided.
|
|
54
|
-
* @param {object} [mSettings] Initial settings for the new control.
|
|
55
|
-
* @class This control allows you to upload one or more files from your device, such as desktop, tablet or phone, and attach them to your application in a responsive tabular manner.<br>
|
|
56
|
-
* This control builds on the {@link sap.m.upload.UploadSet UploadSet} control. Provides flexibility to tailor the design of the table including columns, cells and the content to suit specific requirements.
|
|
57
|
-
*
|
|
58
|
-
* To render the <code> sap.m.upload.UploadSetwithTable </code>control properly, the order of the columns aggregation should match the order of the cells aggregation (sap.m.upload.UploadSetwithTableItem).
|
|
59
|
-
*
|
|
60
|
-
* <b>Note:</b> Control recommends to use <code> sap.m.upload.Column </code> with the columns aggregation. <code>sap.m.upload.Column</code> control is built on <code> sap.m.Column </code> ({@link sap.m.Column Column}) control and provides ability to define personalization specific properties for column and is essential to setup personalization for the <code>sap.m.upload.UploadSetwithTable</code> control.
|
|
61
|
-
* @extends sap.m.Table
|
|
62
|
-
* @author SAP SE
|
|
63
|
-
* @constructor
|
|
64
|
-
* @public
|
|
65
|
-
* @deprecated as of version 1.124, replaced by {@link sap.m.plugins.UploadSetwithTable}
|
|
66
|
-
* @version 1.129.0
|
|
67
|
-
* @alias sap.m.upload.UploadSetwithTable
|
|
68
|
-
*/
|
|
69
|
-
var UploadSetwithTable = Table.extend("sap.m.upload.UploadSetwithTable", {
|
|
70
|
-
metadata: {
|
|
71
|
-
library: "sap.m",
|
|
72
|
-
properties: {
|
|
73
|
-
/**
|
|
74
|
-
* File types that are allowed to be uploaded.
|
|
75
|
-
* <br>If this property is not set, any file can be uploaded.
|
|
76
|
-
*/
|
|
77
|
-
fileTypes: {type: "string[]", defaultValue: null},
|
|
78
|
-
/**
|
|
79
|
-
* Defined maximum length for a name of files that are to be uploaded.
|
|
80
|
-
* <br>If set to <code>null</code> or <code>0</code>, any file can be uploaded regardless length of its name.
|
|
81
|
-
*/
|
|
82
|
-
maxFileNameLength: {type: "int", defaultValue: null},
|
|
83
|
-
/**
|
|
84
|
-
* Defined size limit in megabytes for files that are to be uploaded.
|
|
85
|
-
* <br>If set to <code>null</code> or <code>0</code>, files of any size can be uploaded.
|
|
86
|
-
*/
|
|
87
|
-
maxFileSize: {type: "float", defaultValue: null},
|
|
88
|
-
/**
|
|
89
|
-
* Media types of files that are allowed to be uploaded.
|
|
90
|
-
* <br>If this property is not set, any file can be uploaded.
|
|
91
|
-
*/
|
|
92
|
-
mediaTypes: {type: "string[]", defaultValue: null},
|
|
93
|
-
/**
|
|
94
|
-
* Custom text can be defined for the 'No data' text label. Customisation of text can be done for the empty state of the control.
|
|
95
|
-
*/
|
|
96
|
-
noDataText: {type: "string", defaultValue: "No documents available" },
|
|
97
|
-
/**
|
|
98
|
-
* Custom text can be defined for the 'No data' text description. Customisation of text can be done for the empty state of the control.
|
|
99
|
-
*/
|
|
100
|
-
noDataDescription: {type: "string", defaultValue: "Drag and drop files here to upload" },
|
|
101
|
-
/**
|
|
102
|
-
* Url where the uploaded files are stored.
|
|
103
|
-
*/
|
|
104
|
-
uploadUrl: {type: "string", defaultValue: null},
|
|
105
|
-
/**
|
|
106
|
-
* HTTP request method chosen for file upload.
|
|
107
|
-
*/
|
|
108
|
-
httpRequestMethod: {type: "sap.m.upload.UploaderHttpRequestMethod", defaultValue: UploaderHttpRequestMethod.Post},
|
|
109
|
-
/**
|
|
110
|
-
* Lets the user select multiple files from the same folder and then upload them.
|
|
111
|
-
*
|
|
112
|
-
* If multiple property is set to false, the control shows an error message if more than one file is chosen for drag & drop.
|
|
113
|
-
*/
|
|
114
|
-
multiple: {type: "boolean", group: "Behavior", defaultValue: false},
|
|
115
|
-
/**
|
|
116
|
-
* If set to true, the button used for uploading files becomes invisible.
|
|
117
|
-
*/
|
|
118
|
-
uploadButtonInvisible: {type: "boolean", group: "Appearance", defaultValue: false},
|
|
119
|
-
/**
|
|
120
|
-
* Defines whether the upload action is allowed.
|
|
121
|
-
*/
|
|
122
|
-
uploadEnabled: {type: "boolean", defaultValue: true},
|
|
123
|
-
/** Callback function to perform additional validations or configurations for the item queued up for upload and to finally trigger the upload.
|
|
124
|
-
* @callback sap.m.upload.UploadSetwithTable.itemValidationHandler
|
|
125
|
-
* @param {sap.m.upload.UploadSetwithTable.ItemInfo} oItemInfo The info of the item queued for upload.
|
|
126
|
-
* @returns {Promise<sap.m.upload.UploadSetwithTableItem>} oPromise, once resolved the UploadSetWithTable control initiates the upload.
|
|
127
|
-
* @public
|
|
128
|
-
* @deprecated as of version 1.124, replaced by {@link sap.m.plugins.UploadSetwithTable.itemValidationHandler}
|
|
129
|
-
**/
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @typedef {object} sap.m.upload.UploadSetwithTable.ItemInfo
|
|
133
|
-
* @description Item info object sent as paramter to {@link sap.m.upload.UploadSetwithTable.itemValidationHandler itemValidationHandler callback}
|
|
134
|
-
* @property {sap.m.upload.UploadSetwithTableItem} oItem Current item queued for upload.
|
|
135
|
-
* @property {number} iTotalItemsForUpload Total count of items queued for upload.
|
|
136
|
-
* @property {sap.m.upload.UploadSetwithTable} oSource Source on which the callback was invoked.
|
|
137
|
-
* @public
|
|
138
|
-
* @deprecated as of version 1.124, replaced by {@link sap.m.plugins.UploadSetwithTable.ItemInfo}
|
|
139
|
-
**/
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Defines a {@link sap.m.upload.UploadSetwithTable.itemValidationHandler callback function} that is invoked when each UploadSetwithTableItem is queued up for upload.
|
|
143
|
-
* This callback is invoked with {@link sap.m.upload.UploadSetwithTable.ItemInfo parameters} and the callback is expected to return a promise to the control. Once the promise is resolved, the control initiates the upload process.
|
|
144
|
-
* Configure this property only when any additional configuration or validations are to be performed before the upload of each item.
|
|
145
|
-
* The upload process is triggered manually by resolving the promise returned to the control.
|
|
146
|
-
**/
|
|
147
|
-
itemValidationHandler: {type: "function", defaultValue: null},
|
|
148
|
-
/**
|
|
149
|
-
* Lets the user upload entire files from directories and sub directories.
|
|
150
|
-
*/
|
|
151
|
-
directory: {type: "boolean", group: "Behavior", defaultValue: false},
|
|
152
|
-
/**
|
|
153
|
-
* Determines which illustration type is displayed when the control holds no data.
|
|
154
|
-
*/
|
|
155
|
-
noDataIllustrationType: {type: "sap.m.IllustratedMessageType", group: "Appearance", defaultValue: IllustratedMessageType.UploadCollection},
|
|
156
|
-
/**
|
|
157
|
-
* If set to true, the variant management gets enabled.
|
|
158
|
-
*/
|
|
159
|
-
enableVariantManagement: {type: "boolean", defaultValue: false},
|
|
160
|
-
/**
|
|
161
|
-
* Enables CloudFile picker feature to upload files from cloud.
|
|
162
|
-
* @experimental Since 1.120
|
|
163
|
-
*/
|
|
164
|
-
cloudFilePickerEnabled: { type: "boolean", group: "Behavior", defaultValue: false },
|
|
165
|
-
/**
|
|
166
|
-
* Url of the FileShare OData V4 service supplied for CloudFile picker control.
|
|
167
|
-
* @experimental Since 1.120.
|
|
168
|
-
*/
|
|
169
|
-
cloudFilePickerServiceUrl: { type: "sap.ui.core.URI", group: "Data", defaultValue: "" },
|
|
170
|
-
/**
|
|
171
|
-
* The text of the CloudFile picker button. The default text is "Upload from cloud" (translated to the respective language).
|
|
172
|
-
* @experimental Since 1.120.
|
|
173
|
-
*/
|
|
174
|
-
cloudFilePickerButtonText: { type: 'string', defaultValue: "" }
|
|
175
|
-
},
|
|
176
|
-
aggregations: {
|
|
177
|
-
/**
|
|
178
|
-
* Defines the uploader to be used. If not specified, the default implementation is used.
|
|
179
|
-
*/
|
|
180
|
-
uploader: {type: "sap.m.upload.UploaderTableItem", multiple: false},
|
|
181
|
-
/**
|
|
182
|
-
* Header fields to be included in the header section of an XHR request.
|
|
183
|
-
*/
|
|
184
|
-
headerFields: {type: "sap.ui.core.Item", multiple: true, singularName: "headerField"}
|
|
185
|
-
},
|
|
186
|
-
associations: {
|
|
187
|
-
/**
|
|
188
|
-
* Dialog with a carousel to preview files uploaded.
|
|
189
|
-
* <br>If it is not defined, the control creates and uses the instance of {@link sap.m.upload.FilePreviewDialog FilePreviewDialog}.
|
|
190
|
-
*/
|
|
191
|
-
previewDialog: {type: "sap.m.upload.FilePreviewDialog", multiple: false}
|
|
192
|
-
},
|
|
193
|
-
events: {
|
|
194
|
-
/**
|
|
195
|
-
* The event is triggered when the file name is changed.
|
|
196
|
-
*/
|
|
197
|
-
itemRenamed: {
|
|
198
|
-
parameters: {
|
|
199
|
-
/**
|
|
200
|
-
* The renamed UI element is of UploadSetwithTableItem type.
|
|
201
|
-
*/
|
|
202
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
/**
|
|
206
|
-
* This event is fired right before the upload process begins.
|
|
207
|
-
*/
|
|
208
|
-
beforeUploadStarts: {
|
|
209
|
-
parameters: {
|
|
210
|
-
/**
|
|
211
|
-
* The file whose upload is just about to start.
|
|
212
|
-
*/
|
|
213
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
214
|
-
},
|
|
215
|
-
allowPreventDefault: true
|
|
216
|
-
},
|
|
217
|
-
/**
|
|
218
|
-
* This event is fired right after the upload process is finished.
|
|
219
|
-
* <br>Based on the backend response of the application, listeners can use the parameters to determine if the upload was successful or if it failed.
|
|
220
|
-
*/
|
|
221
|
-
uploadCompleted: {
|
|
222
|
-
parameters: {
|
|
223
|
-
/**
|
|
224
|
-
* The file whose upload has just been completed.
|
|
225
|
-
*/
|
|
226
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"},
|
|
227
|
-
/**
|
|
228
|
-
* Response message that comes from the server.
|
|
229
|
-
*
|
|
230
|
-
* On the server side this response has to be put within the "body" tags of the response
|
|
231
|
-
* document of the iFrame. It can consist of a return code and an optional message. This does not
|
|
232
|
-
* work in cross-domain scenarios.
|
|
233
|
-
*/
|
|
234
|
-
response : {type : "string"},
|
|
235
|
-
/**
|
|
236
|
-
* ReadyState of the XHR request.
|
|
237
|
-
*
|
|
238
|
-
* Required for receiving a <code>readyState</code> is to set the property <code>sendXHR</code>
|
|
239
|
-
* to true. This property is not supported by Internet Explorer 9.
|
|
240
|
-
*/
|
|
241
|
-
readyState : {type : "string"},
|
|
242
|
-
/**
|
|
243
|
-
* Status of the XHR request.
|
|
244
|
-
*
|
|
245
|
-
* Required for receiving a <code>status</code> is to set the property <code>sendXHR</code> to true.
|
|
246
|
-
* This property is not supported by Internet Explorer 9.
|
|
247
|
-
*/
|
|
248
|
-
status : {type : "string"},
|
|
249
|
-
/**
|
|
250
|
-
* Http-Response which comes from the server.
|
|
251
|
-
*
|
|
252
|
-
* Required for receiving <code>responseXML</code> is to set the property <code>sendXHR</code> to true.
|
|
253
|
-
*
|
|
254
|
-
* This property is not supported by Internet Explorer 9.
|
|
255
|
-
*/
|
|
256
|
-
responseXML : {type : "string"},
|
|
257
|
-
/**
|
|
258
|
-
* Http-Response which comes from the server.
|
|
259
|
-
*
|
|
260
|
-
* Required for receiving <code>responseText</code> is to set the property <code>sendXHR</code> to true.
|
|
261
|
-
*
|
|
262
|
-
* This property is not supported by Internet Explorer 9.
|
|
263
|
-
*/
|
|
264
|
-
responseText : {type : "string"},
|
|
265
|
-
/**
|
|
266
|
-
* Http-Response-Headers which come from the server.
|
|
267
|
-
*
|
|
268
|
-
* Provided as a JSON-map, i.e. each header-field is reflected by a property in the <code>headers</code>
|
|
269
|
-
* object, with the property value reflecting the header-field's content.
|
|
270
|
-
*
|
|
271
|
-
* Required for receiving <code>headers</code> is to set the property <code>sendXHR</code> to true.
|
|
272
|
-
* This property is not supported by Internet Explorer 9.
|
|
273
|
-
*/
|
|
274
|
-
headers : {type : "object"}
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
/**
|
|
278
|
-
* This event is fired in either of the following cases:
|
|
279
|
-
* <ul>
|
|
280
|
-
* <li>When a file that is selected to be uploaded fails to meet the file type restriction
|
|
281
|
-
* (<code>fileType</code> property).</li>
|
|
282
|
-
* <li>When the file type restriction changes, and the file to be uploaded fails to meet the new
|
|
283
|
-
* restriction.</li>
|
|
284
|
-
* </ul>
|
|
285
|
-
*/
|
|
286
|
-
fileTypeMismatch: {
|
|
287
|
-
parameters: {
|
|
288
|
-
/**
|
|
289
|
-
* The file that fails to meet the file type restriction specified in the
|
|
290
|
-
* <code>fileType</code> property.
|
|
291
|
-
*/
|
|
292
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
/**
|
|
296
|
-
* This event is fired in either of the following cases:
|
|
297
|
-
* <ul>
|
|
298
|
-
* <li>When a file that is selected to be uploaded fails to meet the file name length restriction specified in the
|
|
299
|
-
* <code>maxFileNameLength</code> property.</li>
|
|
300
|
-
* <li>When the file name length restriction changes, and the file to be uploaded fails to meet the new
|
|
301
|
-
* restriction.</li>
|
|
302
|
-
* </ul>
|
|
303
|
-
*/
|
|
304
|
-
fileNameLengthExceeded: {
|
|
305
|
-
parameters: {
|
|
306
|
-
/**
|
|
307
|
-
* The file that fails to meet the file name length restriction specified in the
|
|
308
|
-
* <code>maxFileNameLength</code> property.
|
|
309
|
-
*/
|
|
310
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
/**
|
|
314
|
-
* This event is fired in either of the following cases:
|
|
315
|
-
* <ul>
|
|
316
|
-
* <li>When a file that is selected to be uploaded fails to meet the file size restriction specified in the
|
|
317
|
-
* <code>maxFileSize</code> property.</li>
|
|
318
|
-
* <li>When the file size restriction changes, and the file to be uploaded fails to meet the new
|
|
319
|
-
* restriction.</li>
|
|
320
|
-
* </ul>
|
|
321
|
-
*/
|
|
322
|
-
fileSizeExceeded: {
|
|
323
|
-
parameters: {
|
|
324
|
-
/**
|
|
325
|
-
* The file that fails to meet the file size restriction specified in the
|
|
326
|
-
* <code>maxFileSize</code> property.
|
|
327
|
-
*/
|
|
328
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
/**
|
|
332
|
-
* This event is fired in either of the following cases:
|
|
333
|
-
* <ul>
|
|
334
|
-
* <li>When a file that is selected to be uploaded fails to meet the media type restriction specified in the
|
|
335
|
-
* <code>mediaTypes</code> property.</li>
|
|
336
|
-
* <li>When the media type restriction changes, and the file to be uploaded fails to meet the new
|
|
337
|
-
* restriction.</li>
|
|
338
|
-
* </ul>
|
|
339
|
-
*/
|
|
340
|
-
mediaTypeMismatch: {
|
|
341
|
-
parameters: {
|
|
342
|
-
/**
|
|
343
|
-
* The file that fails to meet the media type restriction specified in the
|
|
344
|
-
* <code>mediaTypes</code> property.
|
|
345
|
-
*/
|
|
346
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
/**
|
|
350
|
-
* This event is fired just before initiating the file upload process when a file is selected to be uploaded.
|
|
351
|
-
* Use this event to set additional info dynamically, specific for each item before upload process is initiated.
|
|
352
|
-
*/
|
|
353
|
-
beforeInitiatingItemUpload: {
|
|
354
|
-
parameters: {
|
|
355
|
-
/**
|
|
356
|
-
* Items in ready state for upload process
|
|
357
|
-
*/
|
|
358
|
-
item: {type: "sap.m.upload.UploadSetwithTableItem"}
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
/**
|
|
362
|
-
* This event is fired when the user starts dragging an uploaded item.
|
|
363
|
-
* @event
|
|
364
|
-
* @param {sap.ui.base.Event} oControlEvent
|
|
365
|
-
* @param {sap.ui.base.EventProvider} oControlEvent.getSource
|
|
366
|
-
* @param {object} oControlEvent.getParameters
|
|
367
|
-
* @param {sap.ui.core.Element} oControlEvent.getParameters.target The target element that is dragged
|
|
368
|
-
* @param {sap.ui.core.dnd.DragSession} oControlEvent.getParameters.dragSession The UI5 <code>dragSession</code> object that exists only during drag and drop
|
|
369
|
-
* @param {Event} oControlEvent.getParameters.browserEvent The underlying browser event
|
|
370
|
-
* @public
|
|
371
|
-
*/
|
|
372
|
-
itemDragStart: {
|
|
373
|
-
},
|
|
374
|
-
/**
|
|
375
|
-
* This event is fired when an uploaded item is dropped on the new table row position.
|
|
376
|
-
* @event
|
|
377
|
-
* @param {sap.ui.base.Event} oControlEvent
|
|
378
|
-
* @param {sap.ui.base.EventProvider} oControlEvent.getSource
|
|
379
|
-
* @param {object} oControlEvent.getParameters
|
|
380
|
-
* @param {sap.ui.core.dnd.DragSession} oControlEvent.getParameters.dragSession The UI5 <code>dragSession</code> object that exists only during drag and drop
|
|
381
|
-
* @param {sap.ui.core.Element} oControlEvent.getParameters.draggedControl The element being dragged
|
|
382
|
-
* @param {sap.ui.core.Element} oControlEvent.getParameters.droppedControl The element being dropped
|
|
383
|
-
* @param {sap.ui.core.dnd.RelativeDropPosition} oControlEvent.getParameters.dropPosition The calculated position of the drop action relative to the <code>droppedControl</code>.
|
|
384
|
-
* @param {Event} oControlEvent.getParameters.browserEvent The underlying browser event
|
|
385
|
-
* @public
|
|
386
|
-
*/
|
|
387
|
-
itemDrop: {
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
renderer: UploadSetwithTableRenderer
|
|
392
|
-
});
|
|
393
|
-
|
|
394
|
-
var UploadState = Library.UploadState;
|
|
395
|
-
var UploadSetwithTableActionPlaceHolder = Library.UploadSetwithTableActionPlaceHolder;
|
|
396
|
-
|
|
397
|
-
/* ================== */
|
|
398
|
-
/* Lifecycle handling */
|
|
399
|
-
/* ================== */
|
|
400
|
-
|
|
401
|
-
UploadSetwithTable.prototype.init = function () {
|
|
402
|
-
Table.prototype.init.call(this);
|
|
403
|
-
this._setDragDropConfig();
|
|
404
|
-
this._filesTobeUploaded = [];
|
|
405
|
-
this._filePreviewDialogControl = null;
|
|
406
|
-
this._oRb = Library1.getResourceBundleFor("sap.m");
|
|
407
|
-
this._bPersoRegistered = false;
|
|
408
|
-
this._setIllustratedMessage();
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
UploadSetwithTable.prototype.onBeforeRendering = function() {
|
|
412
|
-
Table.prototype.onBeforeRendering.call(this);
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
UploadSetwithTable.prototype.onAfterRendering = function() {
|
|
416
|
-
Table.prototype.onAfterRendering.call(this);
|
|
417
|
-
if (!this._bPersoRegistered){
|
|
418
|
-
PersManager.getInstance().register(this, { mediators: {
|
|
419
|
-
columns: new ColumnsMediator({control: this, targetAggregation: "columns", p13nMetadataTarget: "columns"}),
|
|
420
|
-
sort: new SortMediator({control: this, targetAggregation: "sortConditions", p13nMetadataTarget: "sort"}),
|
|
421
|
-
group: new GroupMediator({control: this, targetAggregation: "groupConditions", p13nMetadataTarget: "group"}),
|
|
422
|
-
filter: new FilterMediator({control: this, targetAggregation: "filterConditions", p13nMetadataTarget: "filter"})
|
|
423
|
-
}});
|
|
424
|
-
this._bPersoRegistered = true;
|
|
425
|
-
}
|
|
426
|
-
if (this.getCloudFilePickerEnabled()) {
|
|
427
|
-
this._oFileUploader.addStyleClass("sapMUSTFileUploaderVisibility");
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
UploadSetwithTable.prototype.exit = function () {
|
|
432
|
-
Table.prototype.exit.call(this);
|
|
433
|
-
if (this._oToolbar) {
|
|
434
|
-
this._oToolbar.destroy();
|
|
435
|
-
this._oToolbar = null;
|
|
436
|
-
}
|
|
437
|
-
if (this._oFileUploader) {
|
|
438
|
-
this._oFileUploader.destroy();
|
|
439
|
-
this._oFileUploader = null;
|
|
440
|
-
}
|
|
441
|
-
if (this._illustratedMessage) {
|
|
442
|
-
this._illustratedMessage.destroy();
|
|
443
|
-
this._illustratedMessage = null;
|
|
444
|
-
}
|
|
445
|
-
this._bPersoRegistered = false;
|
|
446
|
-
PersManager.getInstance().deregister(this);
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
/* ====================== */
|
|
450
|
-
/* Overridden API methods */
|
|
451
|
-
/* ====================== */
|
|
452
|
-
|
|
453
|
-
UploadSetwithTable.prototype.getHeaderToolbar = function () {
|
|
454
|
-
if (!this._oToolbar) {
|
|
455
|
-
this._oToolbar = this.getAggregation("headerToolbar");
|
|
456
|
-
|
|
457
|
-
var oUploaderButton = this.getCloudFilePickerEnabled() && !this.getUploadButtonInvisible() ? this._getCloudFilePickerMenu() : this.getDefaultFileUploader();
|
|
458
|
-
var oCloudFilPickerButton = this.getCloudFilePickerEnabled() && this.getUploadButtonInvisible() ? this._getCloudFilePickerButton() : null;
|
|
459
|
-
var oPersonalizationSettingsButton = this.getEnableVariantManagement() ? this._getPersonalizationControl() : null;
|
|
460
|
-
|
|
461
|
-
if (!this._oToolbar) {
|
|
462
|
-
const aToolbarContent = [new ToolbarSpacer(), oUploaderButton, oCloudFilPickerButton , oPersonalizationSettingsButton];
|
|
463
|
-
if (this.getEnableVariantManagement()) {
|
|
464
|
-
aToolbarContent.unshift(this._getVariantManagementControl());
|
|
465
|
-
}
|
|
466
|
-
this._oToolbar = new OverFlowToolbar(this.getId() + "-toolbar", {
|
|
467
|
-
content: aToolbarContent
|
|
468
|
-
});
|
|
469
|
-
this.addDependent(this._oToolbar);
|
|
470
|
-
} else {
|
|
471
|
-
const iFileUploaderPH = this._getPlaceholderPosition(this._oToolbar, UploadSetwithTableActionPlaceHolder.UploadButtonPlaceholder);
|
|
472
|
-
if (this._oToolbar && iFileUploaderPH > -1) {
|
|
473
|
-
this._setControlInToolbar(iFileUploaderPH, oUploaderButton);
|
|
474
|
-
} else if (this._oToolbar) {
|
|
475
|
-
// fallback position to add file uploader control if UploadSetwithTableActionPlaceHolder.UploadButtonPlaceholder instance not found
|
|
476
|
-
this._oToolbar.addContent(oUploaderButton);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
const iCloudFilePickerPH = this._getPlaceholderPosition(this._oToolbar, UploadSetwithTableActionPlaceHolder.CloudFilePickerButtonPlaceholder);
|
|
480
|
-
if (this._oToolbar && iCloudFilePickerPH > -1) {
|
|
481
|
-
this._setControlInToolbar(iCloudFilePickerPH, oCloudFilPickerButton);
|
|
482
|
-
} else if (this._oToolbar) {
|
|
483
|
-
// fallback position to add cloud file picker control if UploadSetwithTableActionPlaceHolder.CloudFilePickerButtonPlaceholder instance not found
|
|
484
|
-
this._oToolbar.addContent(oCloudFilPickerButton);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
const iPersonalizationPH = this._getPlaceholderPosition(this._oToolbar, UploadSetwithTableActionPlaceHolder.PersonalizationSettingsPlaceholder);
|
|
488
|
-
if (this._oToolbar && iPersonalizationPH > -1) {
|
|
489
|
-
this._setControlInToolbar(iPersonalizationPH, this._getPersonalizationControl());
|
|
490
|
-
} else if (this._oToolbar) {
|
|
491
|
-
// fallback position to add file uploader control if UploadSetwithTableActionPlaceHolder.PersonalizationSettingsPlaceholder instance not found
|
|
492
|
-
// add personalization settings button only if variant management is enabled and placeholder not provided by default.
|
|
493
|
-
if (this.getEnableVariantManagement()) {
|
|
494
|
-
this._oToolbar.addContent(this._getPersonalizationControl());
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
if (this.getEnableVariantManagement()) {
|
|
499
|
-
const iVmPH = this._getPlaceholderPosition(this._oToolbar, UploadSetwithTableActionPlaceHolder.VariantManagementPlaceholder);
|
|
500
|
-
if (iVmPH > -1) {
|
|
501
|
-
this._setControlInToolbar(iVmPH, this._getVariantManagementControl());
|
|
502
|
-
} else {
|
|
503
|
-
this._oToolbar.insertContent(this._getVariantManagementControl(), 0);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
// Rendering the upload button on the toolbar which is required to maintain the FUEL instance in case we hide it and reuse it for cloudfilepicker menu.
|
|
508
|
-
if (this.getCloudFilePickerEnabled()) {
|
|
509
|
-
this._oToolbar.addContent(this.getDefaultFileUploader());
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
return this._oToolbar;
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* Returns the button that is used to open p13n dialog.
|
|
517
|
-
* @private
|
|
518
|
-
* @returns {sap.m.Button} button.
|
|
519
|
-
*/
|
|
520
|
-
UploadSetwithTable.prototype._getPersonalizationControl = function () {
|
|
521
|
-
return new Button({
|
|
522
|
-
icon: "sap-icon://action-settings",
|
|
523
|
-
press: function () {
|
|
524
|
-
PersManager.getInstance().show(this, ["columns", "sort", "group", "filter"]);
|
|
525
|
-
}.bind(this)
|
|
526
|
-
});
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Returns variant management control.
|
|
531
|
-
* @private
|
|
532
|
-
* @returns {sap.ui.fl.variants.VariantManagement} control.
|
|
533
|
-
*/
|
|
534
|
-
UploadSetwithTable.prototype._getVariantManagementControl = function () {
|
|
535
|
-
if (!this._oVariantManagement) {
|
|
536
|
-
this._oVariantManagement = new VariantManagement({
|
|
537
|
-
"id": this.getId() + "-variantManagement",
|
|
538
|
-
"for": [
|
|
539
|
-
this//container
|
|
540
|
-
]
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
return this._oVariantManagement;
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
UploadSetwithTable.prototype.getView = function () {
|
|
547
|
-
return this.getControlOfType(this, View);
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
UploadSetwithTable.prototype.getControlOfType = function (oControl, oType) {
|
|
551
|
-
if (oControl instanceof oType) {
|
|
552
|
-
return oControl;
|
|
553
|
-
}
|
|
554
|
-
if (oControl && typeof oControl["getParent" === "function"]) {
|
|
555
|
-
return this.getControlOfType(oControl.getParent(), oType);
|
|
556
|
-
}
|
|
557
|
-
return undefined;
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Collects and return p13n metadata from UploadSetwithTable column for p13n dialog panels.
|
|
562
|
-
* @private
|
|
563
|
-
* @returns {object} object with data for p13n panels.
|
|
564
|
-
*/
|
|
565
|
-
UploadSetwithTable.prototype._getP13nMetadata = function () {
|
|
566
|
-
if (!this._p13nMetadata) {
|
|
567
|
-
const oView = this.getView(),
|
|
568
|
-
aInitMetadata = this.getColumns().map(function(entry) {
|
|
569
|
-
return {
|
|
570
|
-
key: oView ? oView.getLocalId(entry.getId()) : entry.getId(),
|
|
571
|
-
label: entry.getColumnPersonalizationText(),
|
|
572
|
-
path: entry.getPath(),
|
|
573
|
-
visible: entry.getVisible(),
|
|
574
|
-
sortable: entry.getSortable(),
|
|
575
|
-
groupable: entry.getGroupable(),
|
|
576
|
-
filterable: entry.getFilterable()
|
|
577
|
-
};
|
|
578
|
-
});
|
|
579
|
-
this._p13nMetadata = {columns: [], sort: [], group: [], filter: []};
|
|
580
|
-
aInitMetadata.forEach((entry) => {
|
|
581
|
-
this._p13nMetadata.columns.push({key: entry.key, label: entry.label});
|
|
582
|
-
if (entry.sortable && entry.path) {
|
|
583
|
-
this._p13nMetadata.sort.push({key: entry.key, label: entry.label, path: entry.path});
|
|
584
|
-
}
|
|
585
|
-
if (entry.groupable && entry.path) {
|
|
586
|
-
this._p13nMetadata.group.push({key: entry.key, label: entry.label, path: entry.path});
|
|
587
|
-
}
|
|
588
|
-
if (entry.filterable && entry.path) {
|
|
589
|
-
this._p13nMetadata.filter.push({key: entry.key, label: entry.label, path: entry.path});
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
return this._p13nMetadata;
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
UploadSetwithTable.prototype.setFileTypes = function (aNewTypes) {
|
|
597
|
-
var aTypes = aNewTypes || null;
|
|
598
|
-
if (typeof aTypes === "string") {
|
|
599
|
-
aTypes = aTypes.split(",");
|
|
600
|
-
}
|
|
601
|
-
aTypes = (aTypes || []).map(function (s) {
|
|
602
|
-
return s ? s.toLowerCase() : "";
|
|
603
|
-
});
|
|
604
|
-
if (!deepEqual(this.getFileTypes(), aTypes)) {
|
|
605
|
-
this.setProperty("fileTypes", aTypes, true);
|
|
606
|
-
this.getDefaultFileUploader().setFileType(aTypes);
|
|
607
|
-
}
|
|
608
|
-
return this;
|
|
609
|
-
};
|
|
610
|
-
|
|
611
|
-
UploadSetwithTable.prototype.setMaxFileNameLength = function (iNewMax) {
|
|
612
|
-
if (this.getMaxFileNameLength() !== iNewMax) {
|
|
613
|
-
this.setProperty("maxFileNameLength", iNewMax, true);
|
|
614
|
-
this.getDefaultFileUploader().setMaximumFilenameLength(iNewMax);
|
|
615
|
-
}
|
|
616
|
-
return this;
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
UploadSetwithTable.prototype.setMaxFileSize = function (iNewMax) {
|
|
620
|
-
if (this.getMaxFileSize() !== iNewMax) {
|
|
621
|
-
this.setProperty("maxFileSize", iNewMax, true);
|
|
622
|
-
this.getDefaultFileUploader().setMaximumFileSize(iNewMax);
|
|
623
|
-
}
|
|
624
|
-
return this;
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
UploadSetwithTable.prototype.setMediaTypes = function (aNewTypes) {
|
|
628
|
-
var aTypes = aNewTypes || null;
|
|
629
|
-
if (typeof aTypes === "string") {
|
|
630
|
-
aTypes = aTypes.split(",");
|
|
631
|
-
}
|
|
632
|
-
aTypes = (aTypes || []).map(function (s) {
|
|
633
|
-
return s ? s.toLowerCase() : "";
|
|
634
|
-
});
|
|
635
|
-
if (!deepEqual(this.getMediaTypes(), aTypes)) {
|
|
636
|
-
this.setProperty("mediaTypes", aTypes, true);
|
|
637
|
-
this.getDefaultFileUploader().setMimeType(aTypes);
|
|
638
|
-
}
|
|
639
|
-
return this;
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
UploadSetwithTable.prototype.setUploadButtonInvisible = function (bUploadButtonInvisible) {
|
|
643
|
-
if (bUploadButtonInvisible !== this.getUploadButtonInvisible()) {
|
|
644
|
-
var bVisible = !bUploadButtonInvisible;
|
|
645
|
-
this.getDefaultFileUploader().setVisible(bVisible);
|
|
646
|
-
this.setProperty("uploadButtonInvisible", bUploadButtonInvisible, true);
|
|
647
|
-
}
|
|
648
|
-
return this;
|
|
649
|
-
};
|
|
650
|
-
|
|
651
|
-
UploadSetwithTable.prototype.setMultiple = function (bMultiple) {
|
|
652
|
-
if (this.getMultiple() !== bMultiple) {
|
|
653
|
-
this.setProperty("multiple", bMultiple);
|
|
654
|
-
this.getDefaultFileUploader().setMultiple(bMultiple);
|
|
655
|
-
}
|
|
656
|
-
return this;
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
UploadSetwithTable.prototype.setUploadEnabled = function (bEnable) {
|
|
660
|
-
if (bEnable !== this.getUploadEnabled()) {
|
|
661
|
-
this.getDefaultFileUploader().setEnabled(bEnable);
|
|
662
|
-
this.setProperty("uploadEnabled", bEnable, false);
|
|
663
|
-
}
|
|
664
|
-
return this;
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
UploadSetwithTable.prototype.setDirectory = function (bDirectory) {
|
|
668
|
-
if (this.getDirectory() !== bDirectory) {
|
|
669
|
-
this.setProperty("directory", bDirectory);
|
|
670
|
-
this.getDefaultFileUploader().setDirectory(bDirectory);
|
|
671
|
-
if (bDirectory) {
|
|
672
|
-
this.setProperty("multiple", false); // disable multiple files selection when directory selection is enabled.
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
return this;
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
UploadSetwithTable.prototype.setNoDataIllustrationType = function (setIllustrationType) {
|
|
679
|
-
if (this.getNoDataIllustrationType() !== setIllustrationType) {
|
|
680
|
-
this.setProperty("noDataIllustrationType", setIllustrationType);
|
|
681
|
-
if (this._illustratedMessage) {
|
|
682
|
-
this._illustratedMessage.setIllustrationType(this.getNoDataIllustrationType());
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
return this;
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
UploadSetwithTable.prototype.setNoDataText = function(sNoDataTxt) {
|
|
689
|
-
if (this.getNoData() !== sNoDataTxt) {
|
|
690
|
-
this.setProperty("noDataText", sNoDataTxt);
|
|
691
|
-
if (this._illustratedMessage) {
|
|
692
|
-
this._illustratedMessage.setTitle(this.getNoDataText());
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
return this;
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
UploadSetwithTable.prototype.setNoDataDescription = function(sNoDataDescription) {
|
|
699
|
-
if (this.getNoDataDescription() !== sNoDataDescription) {
|
|
700
|
-
this.setProperty("noDataDescription", sNoDataDescription);
|
|
701
|
-
if (this._illustratedMessage) {
|
|
702
|
-
this._illustratedMessage.setDescription(this.getNoDataDescription());
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
return this;
|
|
706
|
-
};
|
|
707
|
-
|
|
708
|
-
/* ============== */
|
|
709
|
-
/* Public methods */
|
|
710
|
-
/* ============== */
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Returns an instance of the default <code>sap.ui.unified.FileUploader</code> icon/button, used for adding files
|
|
714
|
-
* from the open file dialog of the operating system. It can be customized, for example made invisible or assigned a different icon.
|
|
715
|
-
* @return {sap.ui.unified.FileUploader} Instance of the default <code>sap.ui.unified.FileUploader</code>.
|
|
716
|
-
* @public
|
|
717
|
-
*/
|
|
718
|
-
UploadSetwithTable.prototype.getDefaultFileUploader = function () {
|
|
719
|
-
var sTooltip = "Upload";
|
|
720
|
-
if (!this._oFileUploader) {
|
|
721
|
-
this._oFileUploader = new FileUploader(this.getId() + "-uploader", {
|
|
722
|
-
buttonOnly: true,
|
|
723
|
-
buttonText: sTooltip,
|
|
724
|
-
tooltip: sTooltip,
|
|
725
|
-
iconOnly: false,
|
|
726
|
-
enabled: this.getUploadEnabled(),
|
|
727
|
-
icon: "",
|
|
728
|
-
iconFirst: false,
|
|
729
|
-
style: "Transparent",
|
|
730
|
-
name: "UploadSetwithTableFileUploader",
|
|
731
|
-
sameFilenameAllowed: true,
|
|
732
|
-
fileType: this.getFileTypes(),
|
|
733
|
-
mimeType: this.getMediaTypes(),
|
|
734
|
-
maximumFilenameLength: this.getMaxFileNameLength(),
|
|
735
|
-
maximumFileSize: this.getMaxFileSize(),
|
|
736
|
-
multiple: this.getDirectory() ? false : this.getMultiple(),
|
|
737
|
-
useMultipart: false,
|
|
738
|
-
sendXHR: true,
|
|
739
|
-
change: [this._onFileUploaderChange, this],
|
|
740
|
-
typeMissmatch: [this._fireFileTypeMismatch, this],
|
|
741
|
-
fileSizeExceed: [this._fireFileSizeExceed, this],
|
|
742
|
-
filenameLengthExceed: [this._fireFilenameLengthExceed, this],
|
|
743
|
-
visible: !this.getUploadButtonInvisible(),
|
|
744
|
-
directory: this.getDirectory()
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
return this._oFileUploader;
|
|
749
|
-
};
|
|
750
|
-
|
|
751
|
-
/**
|
|
752
|
-
* Returns sap icon based on the passed mediaType and filename
|
|
753
|
-
* @param {string} mediaType The media type of the selected file
|
|
754
|
-
* @param {string} fileName The name of the selected file
|
|
755
|
-
* @public
|
|
756
|
-
* @returns {string} sap icon.
|
|
757
|
-
*/
|
|
758
|
-
UploadSetwithTable.getIconForFileType = function (mediaType, fileName) {
|
|
759
|
-
return UploadSetwithTableItem._getIconByMimeType(mediaType, fileName);
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
/**
|
|
763
|
-
* Attaches all necessary handlers to the given uploader instance, so that the progress and status of the upload can be
|
|
764
|
-
* displayed and monitored.
|
|
765
|
-
* This is necessary in case when custom uploader is used.
|
|
766
|
-
* @param {sap.m.upload.UploaderTableItem} oUploader Instance of <code>sap.m.upload.UploaderTableItem</code> to which the default request handlers are attached.
|
|
767
|
-
* @public
|
|
768
|
-
*/
|
|
769
|
-
UploadSetwithTable.prototype.registerUploaderEvents = function (oUploader) {
|
|
770
|
-
oUploader.attachUploadStarted(this._onUploadStarted.bind(this));
|
|
771
|
-
oUploader.attachUploadCompleted(this._onUploadCompleted.bind(this));
|
|
772
|
-
};
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Invokes native files selection handler.
|
|
776
|
-
* @public
|
|
777
|
-
*/
|
|
778
|
-
UploadSetwithTable.prototype.fileSelectionHandler = function() {
|
|
779
|
-
var oUploaderInstance = this.getDefaultFileUploader();
|
|
780
|
-
if (oUploaderInstance && oUploaderInstance.oFileUpload && oUploaderInstance.oFileUpload.click) {
|
|
781
|
-
oUploaderInstance.oFileUpload.click();
|
|
782
|
-
}
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
* API to determine the unit for file size in KB/MB/GB.
|
|
787
|
-
* API recommended for file size formatting purpose.
|
|
788
|
-
* @param {int} iFileSize fileSize to determine units
|
|
789
|
-
* @public
|
|
790
|
-
* @returns {string} sFileSizeWithUnit file size in KB/MB/GB default unit is KB
|
|
791
|
-
*/
|
|
792
|
-
UploadSetwithTable.getFileSizeWithUnits = function(iFileSize) {
|
|
793
|
-
var iKilobyte = 1024;
|
|
794
|
-
var iMegabyte = iKilobyte * 1024;
|
|
795
|
-
var iGigabyte = iMegabyte * 1024;
|
|
796
|
-
if (typeof iFileSize === "number") {
|
|
797
|
-
if (iFileSize < iMegabyte) {
|
|
798
|
-
return (iFileSize / iKilobyte).toFixed(2) + " KB";
|
|
799
|
-
} else if (iFileSize < iGigabyte) {
|
|
800
|
-
return (iFileSize / iMegabyte).toFixed(2) + " MB";
|
|
801
|
-
} else {
|
|
802
|
-
return (iFileSize / iGigabyte).toFixed(2) + " GB";
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
return iFileSize;
|
|
806
|
-
};
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* API to upload file using URL
|
|
810
|
-
* @param {string} sName file name to be set for the file that is to be uploaded.
|
|
811
|
-
* @param {string} sUrl Url for the file.
|
|
812
|
-
* @param {Promise} oPromise Promise when resolved, the control initiates the upload process.
|
|
813
|
-
* @returns {UploadSetwithTableItem} oItem, UploadSetwithTableItem instance created with the file object.
|
|
814
|
-
* @public
|
|
815
|
-
*/
|
|
816
|
-
UploadSetwithTable.prototype.uploadItemViaUrl = function (sName, sUrl, oPromise) {
|
|
817
|
-
var oFileObject = new File([new Blob([])], sName);
|
|
818
|
-
|
|
819
|
-
var oItem = new UploadSetwithTableItem({
|
|
820
|
-
uploadState: UploadState.Ready
|
|
821
|
-
});
|
|
822
|
-
oItem._setFileObject(oFileObject);
|
|
823
|
-
oItem.setFileName(oFileObject.name);
|
|
824
|
-
oItem.setUrl(sUrl);
|
|
825
|
-
|
|
826
|
-
oPromise
|
|
827
|
-
.then(() => this._initateItemUpload(oItem).bind(this))
|
|
828
|
-
.catch(() => oItem.destroy()); // cancelling the upload.
|
|
829
|
-
|
|
830
|
-
return oItem;
|
|
831
|
-
};
|
|
832
|
-
|
|
833
|
-
/**
|
|
834
|
-
* API to upload Item without file
|
|
835
|
-
* @param {Promise} oPromise Promise when resolved, control initiates the upload process.
|
|
836
|
-
* @return {UploadSetwithTableItem} oItem, UploadSetwithTableItem instance created with the file object.
|
|
837
|
-
* @public
|
|
838
|
-
*/
|
|
839
|
-
UploadSetwithTable.prototype.uploadItemWithoutFile = function (oPromise) {
|
|
840
|
-
var oFileObject = new File([new Blob([])], '-');
|
|
841
|
-
var oItem = new UploadSetwithTableItem({
|
|
842
|
-
uploadState: UploadState.Ready
|
|
843
|
-
});
|
|
844
|
-
oItem._setFileObject(oFileObject);
|
|
845
|
-
oItem.setFileName(oFileObject.name);
|
|
846
|
-
|
|
847
|
-
oPromise
|
|
848
|
-
.then(() => this._initateItemUpload(oItem))
|
|
849
|
-
.catch(() => oItem.destroy()); // cancelling the upload.
|
|
850
|
-
|
|
851
|
-
return oItem;
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* API to rename the document of an item.
|
|
856
|
-
* @param {sap.m.upload.UploadSetwithTableItem} oItem target item.
|
|
857
|
-
* @public
|
|
858
|
-
*/
|
|
859
|
-
UploadSetwithTable.prototype.renameItem = function (oItem) {
|
|
860
|
-
if (oItem && oItem instanceof UploadSetwithTableItem) {
|
|
861
|
-
const oDialog = this._getFileRenameDialog(oItem);
|
|
862
|
-
oDialog.open();
|
|
863
|
-
}
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
/* ============== */
|
|
867
|
-
/* Private methods */
|
|
868
|
-
/* ============== */
|
|
869
|
-
|
|
870
|
-
UploadSetwithTable.prototype._setControlInToolbar = function(iIndex, control) {
|
|
871
|
-
this._oToolbar.getContent()[iIndex].setVisible(false);
|
|
872
|
-
this._oToolbar.insertContent(control, iIndex);
|
|
873
|
-
};
|
|
874
|
-
|
|
875
|
-
UploadSetwithTable.prototype._getPlaceholderPosition = function(toolbar, placeholderType) {
|
|
876
|
-
for (var i = 0; i < toolbar.getContent().length; i++) {
|
|
877
|
-
if (toolbar.getContent()[i].isA("sap.m.upload.ActionsPlaceholder") && toolbar.getContent()[i].getPlaceholderFor() === placeholderType) {
|
|
878
|
-
return i;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return -1;
|
|
882
|
-
};
|
|
883
|
-
|
|
884
|
-
UploadSetwithTable.prototype._onFileUploaderChange = function (oEvent) {
|
|
885
|
-
var oFiles = oEvent.getParameter("files");
|
|
886
|
-
|
|
887
|
-
if (oFiles && oFiles.length) {
|
|
888
|
-
var aSelectedItems = this.getSelectedItems();
|
|
889
|
-
var oSelectedItem = aSelectedItems && aSelectedItems.length == 1 ? aSelectedItems[0] : null;
|
|
890
|
-
var bEmptyFileSelected = oSelectedItem ? oSelectedItem && oSelectedItem.getFileName && oSelectedItem.getFileName() === "-" : false;
|
|
891
|
-
|
|
892
|
-
// update existing file after upload
|
|
893
|
-
if (bEmptyFileSelected) {
|
|
894
|
-
this._oItemToUpdate = oFiles[0];
|
|
895
|
-
}
|
|
896
|
-
this._processSelectedFileObjects(oFiles);
|
|
897
|
-
}
|
|
898
|
-
};
|
|
899
|
-
|
|
900
|
-
UploadSetwithTable.prototype._processSelectedFileObjects = function (oFiles) {
|
|
901
|
-
var aFiles = [];
|
|
902
|
-
|
|
903
|
-
// Need to explicitly copy the file list, FileUploader deliberately resets its form completely
|
|
904
|
-
// along with 'files' parameter when it (mistakenly) thinks that all is done.
|
|
905
|
-
for (var i = 0; i < oFiles.length; i++) {
|
|
906
|
-
aFiles.push(oFiles[i]);
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
aFiles.forEach((oFile) => {
|
|
910
|
-
var oItem = new UploadSetwithTableItem({
|
|
911
|
-
uploadState: UploadState.Ready
|
|
912
|
-
});
|
|
913
|
-
oItem.setParent(this); // setting the parent as UploadSetwithTable for file validations
|
|
914
|
-
oItem._setFileObject(oFile);
|
|
915
|
-
oItem.setFileName(oFile.name);
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
if (this.getItemValidationHandler() && typeof this.getItemValidationHandler() === "function" ) {
|
|
919
|
-
|
|
920
|
-
const oItemInfo = {
|
|
921
|
-
oItem: oItem,
|
|
922
|
-
iTotalItemsForUpload: aFiles.length,
|
|
923
|
-
oSource: this
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
var oPromise = this.getItemValidationHandler()(oItemInfo);
|
|
927
|
-
if (oPromise && oPromise instanceof Promise) {
|
|
928
|
-
oPromise
|
|
929
|
-
.then((item) => {
|
|
930
|
-
if (item instanceof UploadSetwithTableItem) {
|
|
931
|
-
this._initateItemUpload(item);
|
|
932
|
-
}
|
|
933
|
-
})
|
|
934
|
-
.catch((item) => {
|
|
935
|
-
// Reset variable to avoid update if upload rejected.
|
|
936
|
-
if (item && this._oItemToUpdate && item instanceof UploadSetwithTableItem && item.getId() === this._oItemToUpdate.getId()) {
|
|
937
|
-
this._oItemToUpdate = null;
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
} else {
|
|
941
|
-
oItem.destroy();
|
|
942
|
-
// if promise is not returned to the ItemValidation hook log error and destroy the item
|
|
943
|
-
Log.error("Invalid usage, missing Promise: ItemValidationHandler callback expects Promise to be returned.");
|
|
944
|
-
}
|
|
945
|
-
} else {
|
|
946
|
-
/* if no validation handler is provided control continues with normal upload else waits for the application to manually
|
|
947
|
-
trigger the upload by resolving the promise */
|
|
948
|
-
this._initateItemUpload(oItem);
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
|
|
953
|
-
UploadSetwithTable.prototype._initateItemUpload = function(oItem) {
|
|
954
|
-
this.fireBeforeInitiatingItemUpload({item: oItem});
|
|
955
|
-
if (this._oItemToUpdate) {
|
|
956
|
-
// Registering item to be update with selected file contents post successful upload.
|
|
957
|
-
this._oItemToUpdate = oItem;
|
|
958
|
-
}
|
|
959
|
-
this._uploadItemIfGoodToGo(oItem);
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
UploadSetwithTable.prototype._fireFileTypeMismatch = function (oItem) {
|
|
963
|
-
var aMediaTypes = this.getMediaTypes();
|
|
964
|
-
var aFileTypes = this.getFileTypes();
|
|
965
|
-
|
|
966
|
-
var sFileType = oItem.getParameter("fileType");
|
|
967
|
-
var sMediaType = oItem.getParameter("mimeType");
|
|
968
|
-
|
|
969
|
-
var bMediaRestricted = (!!aMediaTypes && (aMediaTypes.length > 0) && !!sMediaType && aMediaTypes.indexOf(sMediaType) === -1);
|
|
970
|
-
var bFileRestricted = (!!aFileTypes && (aFileTypes.length > 0) && !!sFileType && aFileTypes.indexOf(sFileType) === -1);
|
|
971
|
-
|
|
972
|
-
var parts = [new Blob([])];
|
|
973
|
-
|
|
974
|
-
var oFileMetaData = {
|
|
975
|
-
type: oItem.getParameter('fileType'),
|
|
976
|
-
webkitRelativePath: '',
|
|
977
|
-
name: oItem.getParameter('fileName')
|
|
978
|
-
};
|
|
979
|
-
var oFileObject = new File(parts, oItem.getParameter('fileName'), oFileMetaData);
|
|
980
|
-
var oMismatchItem = new UploadSetwithTableItem();
|
|
981
|
-
oMismatchItem._setFileObject(oFileObject);
|
|
982
|
-
oMismatchItem.setFileName(oFileObject.name);
|
|
983
|
-
|
|
984
|
-
if (bMediaRestricted){
|
|
985
|
-
this.fireMediaTypeMismatch({item: oMismatchItem});
|
|
986
|
-
} else if (bFileRestricted){
|
|
987
|
-
this.fireFileTypeMismatch({item: oMismatchItem});
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
|
|
991
|
-
UploadSetwithTable.prototype._fireFilenameLengthExceed = function (oItem) {
|
|
992
|
-
var oTargetItem = new UploadSetwithTableItem();
|
|
993
|
-
oTargetItem.setFileName(oItem.getParameter('fileName'));
|
|
994
|
-
this.fireFileNameLengthExceeded({item: oTargetItem});
|
|
995
|
-
};
|
|
996
|
-
|
|
997
|
-
UploadSetwithTable.prototype._fireFileSizeExceed = function (oItem) {
|
|
998
|
-
var oTargetItem = new UploadSetwithTableItem();
|
|
999
|
-
oTargetItem.setFileName(oItem.getParameter('fileName'));
|
|
1000
|
-
this.fireFileSizeExceeded({item: oTargetItem});
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
UploadSetwithTable.prototype._onUploadStarted = function (oEvent) {
|
|
1004
|
-
var oItem = oEvent.getParameter("item");
|
|
1005
|
-
oItem.setUploadState(UploadState.Uploading);
|
|
1006
|
-
};
|
|
1007
|
-
|
|
1008
|
-
UploadSetwithTable.prototype._onUploadCompleted = function (oEvent) {
|
|
1009
|
-
var oItem = oEvent.getParameter("item"),
|
|
1010
|
-
oResponseXHRParams = oEvent.getParameter("responseXHR"),
|
|
1011
|
-
sResponse = null;
|
|
1012
|
-
|
|
1013
|
-
if (oResponseXHRParams.responseXML) {
|
|
1014
|
-
sResponse = oResponseXHRParams.responseXML.documentElement.textContent;
|
|
1015
|
-
}
|
|
1016
|
-
var oXhrParams = {
|
|
1017
|
-
"item": oItem,
|
|
1018
|
-
"response": oResponseXHRParams.response,
|
|
1019
|
-
"responseXML": sResponse,
|
|
1020
|
-
"responseText": oResponseXHRParams.responseText,
|
|
1021
|
-
"readyState": oResponseXHRParams.readyState,
|
|
1022
|
-
"status": oResponseXHRParams.status,
|
|
1023
|
-
"headers": oResponseXHRParams.headers
|
|
1024
|
-
};
|
|
1025
|
-
if (this._oItemToUpdate) {
|
|
1026
|
-
this._oItemToUpdate.setFileName(oItem.getFileName());
|
|
1027
|
-
this._oItemToUpdate._setFileObject(oItem.getFileObject());
|
|
1028
|
-
this._oItemToUpdate = null;
|
|
1029
|
-
}
|
|
1030
|
-
oItem.setUploadState(UploadState.Complete);
|
|
1031
|
-
this.fireUploadCompleted(oXhrParams);
|
|
1032
|
-
};
|
|
1033
|
-
|
|
1034
|
-
UploadSetwithTable.prototype._uploadItemIfGoodToGo = function (oItem) {
|
|
1035
|
-
if (oItem.getUploadState() === UploadState.Ready && !oItem._isRestricted()) {
|
|
1036
|
-
if (this.fireBeforeUploadStarts({item: oItem})) {
|
|
1037
|
-
const aHeaderFields = this.getHeaderFields()?.length ? this.getHeaderFields() : [];
|
|
1038
|
-
const aItemHeaderFields = oItem.getHeaderFields()?.length ? oItem.getHeaderFields() : [];
|
|
1039
|
-
const oHeaderFields = [...aHeaderFields, ...aItemHeaderFields]; //Merging headers for request.
|
|
1040
|
-
this._getActiveUploader().uploadItem(oItem, oHeaderFields);
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
};
|
|
1044
|
-
|
|
1045
|
-
UploadSetwithTable.prototype._getActiveUploader = function () {
|
|
1046
|
-
return this.getUploader() || this._getImplicitUploader();
|
|
1047
|
-
};
|
|
1048
|
-
|
|
1049
|
-
UploadSetwithTable.prototype._getImplicitUploader = function () {
|
|
1050
|
-
if (!this._oUploader) {
|
|
1051
|
-
this._oUploader = new Uploader({
|
|
1052
|
-
httpRequestMethod : this.getHttpRequestMethod()
|
|
1053
|
-
});
|
|
1054
|
-
this._oUploader.setUploadUrl(this.getUploadUrl());
|
|
1055
|
-
this.registerUploaderEvents(this._oUploader);
|
|
1056
|
-
this.addDependent(this._oUploader);
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
return this._oUploader;
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
|
-
UploadSetwithTable.prototype._setIllustratedMessage = function () {
|
|
1063
|
-
if (!this._illustratedMessage) {
|
|
1064
|
-
this._illustratedMessage = new IllustratedMessage({
|
|
1065
|
-
illustrationType: this.getNoDataIllustrationType(),
|
|
1066
|
-
illustrationSize: IllustratedMessageSize.Spot,
|
|
1067
|
-
title: this.getNoDataText() ? this.getNoDataText() : this._oRb.getText("UPLOADSET_WITH_TABLE_NO_DATA_TEXT"),
|
|
1068
|
-
description: this.getNoDataDescription() ? this.getNoDataDescription() : this._oRb.getText("UPLOADSET_WITH_TABLE_NO_DATA_DESCRIPTION")
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
this.setAggregation("_noColumnsMessage", this._illustratedMessage);
|
|
1073
|
-
this.setAggregation("noData", this._illustratedMessage);
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
UploadSetwithTable.prototype._setDragDropConfig = function () {
|
|
1077
|
-
var oDragDropConfig = new DragDropInfo({
|
|
1078
|
-
sourceAggregation: "items",
|
|
1079
|
-
targetAggregation: "items",
|
|
1080
|
-
dragStart: [this._onDragStartItem, this],
|
|
1081
|
-
drop: [this._onDropItem, this]
|
|
1082
|
-
});
|
|
1083
|
-
var oDropConfig = new DropInfo({
|
|
1084
|
-
dropEffect:"Move",
|
|
1085
|
-
dropPosition:"OnOrBetween",
|
|
1086
|
-
dragEnter: [this._onDragEnterFile, this],
|
|
1087
|
-
drop: [this._onDropFile, this]
|
|
1088
|
-
});
|
|
1089
|
-
this.addDragDropConfig(oDragDropConfig);
|
|
1090
|
-
this.addDragDropConfig(oDropConfig);
|
|
1091
|
-
};
|
|
1092
|
-
|
|
1093
|
-
UploadSetwithTable.prototype._onDragStartItem = function (oEvent) {
|
|
1094
|
-
this.fireItemDragStart(oEvent);
|
|
1095
|
-
};
|
|
1096
|
-
|
|
1097
|
-
UploadSetwithTable.prototype._onDropItem = function (oEvent) {
|
|
1098
|
-
this.fireItemDrop(oEvent);
|
|
1099
|
-
};
|
|
1100
|
-
|
|
1101
|
-
UploadSetwithTable.prototype._onDragEnterFile = function (oEvent) {
|
|
1102
|
-
var oDragSession = oEvent.getParameter("dragSession");
|
|
1103
|
-
var oDraggedControl = oDragSession.getDragControl();
|
|
1104
|
-
if (oDraggedControl) {
|
|
1105
|
-
oEvent.preventDefault();
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
/**
|
|
1110
|
-
* Drag and drop of files implmentation subject to change depending on the thr UX feedback for folder upload scenarios and warning message display scenarios
|
|
1111
|
-
* @param {sap.ui.base.Event} oEvent Drop Event when file is dropped on the Table.
|
|
1112
|
-
* @private
|
|
1113
|
-
*/
|
|
1114
|
-
UploadSetwithTable.prototype._onDropFile = function (oEvent) {
|
|
1115
|
-
oEvent.preventDefault();
|
|
1116
|
-
if (!this.getUploadEnabled()) {
|
|
1117
|
-
Log.error("Upload is not enabled, to continue uploading with drag and drop of files enable property 'UploadEnabled' ");
|
|
1118
|
-
return;
|
|
1119
|
-
}
|
|
1120
|
-
let oItems = oEvent.getParameter("browserEvent").dataTransfer.items;
|
|
1121
|
-
oItems = Array.from(oItems);
|
|
1122
|
-
|
|
1123
|
-
// Filtering out only webkitentries (files/folders system entries) by excluding non file / directory types.
|
|
1124
|
-
oItems = oItems.filter(function(item){
|
|
1125
|
-
return item.webkitGetAsEntry() ? true : false;
|
|
1126
|
-
});
|
|
1127
|
-
const aEntryTypes = oItems.map(function (oEntry) {
|
|
1128
|
-
const oWebKitEntry = oEntry.webkitGetAsEntry();
|
|
1129
|
-
return {
|
|
1130
|
-
entryType: oWebKitEntry && oWebKitEntry.isFile ? 'File' : 'Directory'
|
|
1131
|
-
};
|
|
1132
|
-
});
|
|
1133
|
-
// handlding multiple property drag & drop scenarios
|
|
1134
|
-
if (oItems && oItems.length > 1 && !this.getMultiple() && !this.getDirectory()) {
|
|
1135
|
-
// Handling drag and drop of multiple files to upload with multiple property set
|
|
1136
|
-
const sMessage = this._oRb.getText("UPLOADSET_WITH_TABLE_MULTIPLE_RESTRICTED");
|
|
1137
|
-
Log.warning("Multiple files upload is retsricted for this multiple property set");
|
|
1138
|
-
MessageBox.error(sMessage);
|
|
1139
|
-
return;
|
|
1140
|
-
} else if (oItems && oItems.length > 1 && this.getMultiple() && !isFileOrFolderEntry('File', aEntryTypes)) {
|
|
1141
|
-
const sMessageDropFilesOnly = this._oRb.getText("UPLOADSET_WITH_TABLE_DIRECTORY_RESTRICTED");
|
|
1142
|
-
Log.warning("Multiple files upload is retsricted, drag & drop only files");
|
|
1143
|
-
MessageBox.error(sMessageDropFilesOnly);
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
// handling directory property drag & drop scenarios
|
|
1148
|
-
if (oItems && oItems.length && !this.getDirectory() && isFileOrFolderEntry('Directory', aEntryTypes)) {
|
|
1149
|
-
const sMessageDirectory = this._oRb.getText("UPLOADSET_WITH_TABLE_DIRECTORY_RESTRICTED");
|
|
1150
|
-
Log.warning("Directory of files upload is retsricted for this directory property set");
|
|
1151
|
-
MessageBox.error(sMessageDirectory);
|
|
1152
|
-
return;
|
|
1153
|
-
} else if (oItems && oItems.length && this.getDirectory() && !isFileOrFolderEntry('Directory', aEntryTypes)) {
|
|
1154
|
-
const sMessageDragDropDirectory = this._oRb.getText("UPLOADSET_WITH_TABLE_DROP_DIRECTORY_ALLOWED");
|
|
1155
|
-
Log.warning("Directory of files upload is retsricted, drag & drop only directories here.");
|
|
1156
|
-
MessageBox.error(sMessageDragDropDirectory);
|
|
1157
|
-
return;
|
|
1158
|
-
}
|
|
1159
|
-
if (oItems && oItems.length) {
|
|
1160
|
-
this._getFilesFromDataTransferItems(oItems).then( (oFiles) => {
|
|
1161
|
-
if (oFiles && oFiles.length) {
|
|
1162
|
-
this._processSelectedFileObjects(oFiles);
|
|
1163
|
-
}
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
function isFileOrFolderEntry(sType, aEntries) {
|
|
1168
|
-
return aEntries.every(function (oEntry) {
|
|
1169
|
-
return oEntry.entryType === sType;
|
|
1170
|
-
});
|
|
1171
|
-
}
|
|
1172
|
-
};
|
|
1173
|
-
/**
|
|
1174
|
-
* Method to extract files from dataTransfer items contianing files / directory of files.
|
|
1175
|
-
* @param {Object} dataTransferItems, DataTransfer items extracted from browserEvent for drop.
|
|
1176
|
-
* @returns {Promise} oPromise, Promise on resolved returns list of files dropped for upload.
|
|
1177
|
-
* @private
|
|
1178
|
-
*/
|
|
1179
|
-
UploadSetwithTable.prototype._getFilesFromDataTransferItems = function (dataTransferItems) {
|
|
1180
|
-
const aFiles = [];
|
|
1181
|
-
return new Promise((resolve, reject) => {
|
|
1182
|
-
const aEntriesPromises = [];
|
|
1183
|
-
for (let i = 0; i < dataTransferItems.length; i++) {
|
|
1184
|
-
aEntriesPromises.push(traverseFileTreePromise(dataTransferItems[i]?.webkitGetAsEntry()));
|
|
1185
|
-
}
|
|
1186
|
-
Promise.all(aEntriesPromises)
|
|
1187
|
-
.then( (entries) => {
|
|
1188
|
-
resolve(aFiles);
|
|
1189
|
-
}, (err) => {
|
|
1190
|
-
reject(err);
|
|
1191
|
-
});
|
|
1192
|
-
});
|
|
1193
|
-
|
|
1194
|
-
function traverseFileTreePromise(item) {
|
|
1195
|
-
return new Promise((resolve, reject) => {
|
|
1196
|
-
if (item.isFile) {
|
|
1197
|
-
item.file((oFile) => {
|
|
1198
|
-
aFiles.push(oFile);
|
|
1199
|
-
resolve(oFile);
|
|
1200
|
-
}, (err) => {
|
|
1201
|
-
reject(err);
|
|
1202
|
-
});
|
|
1203
|
-
} else if (item.isDirectory) {
|
|
1204
|
-
const dirReader = item.createReader();
|
|
1205
|
-
dirReader.readEntries(function (entries) {
|
|
1206
|
-
const aEntriesPromises = [];
|
|
1207
|
-
for (let i = 0; i < entries.length; i++) {
|
|
1208
|
-
aEntriesPromises.push(traverseFileTreePromise(entries[i]));
|
|
1209
|
-
}
|
|
1210
|
-
resolve(Promise.all(aEntriesPromises));
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
|
-
});
|
|
1214
|
-
}
|
|
1215
|
-
};
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
* Opens preview of the item pressed.
|
|
1219
|
-
* @param {sap.m.upload.UploadSetwithTableItem} oItem item to be previewed.
|
|
1220
|
-
* @private
|
|
1221
|
-
*/
|
|
1222
|
-
UploadSetwithTable.prototype._openFilePreview = function (oItem) {
|
|
1223
|
-
if (!this.getPreviewDialog()) {
|
|
1224
|
-
const oAssociatedPreviewDialog = new FilePreviewDialog();
|
|
1225
|
-
this.setPreviewDialog(oAssociatedPreviewDialog);
|
|
1226
|
-
}
|
|
1227
|
-
this._filePreviewDialogControl = Element.getElementById(this.getPreviewDialog());
|
|
1228
|
-
|
|
1229
|
-
if (this._filePreviewDialogControl) {
|
|
1230
|
-
this._filePreviewDialogControl._previewItem = oItem;
|
|
1231
|
-
this._filePreviewDialogControl._items = this.getItems();
|
|
1232
|
-
this._filePreviewDialogControl._open();
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
* Internal API return the dialog for document rename.
|
|
1238
|
-
* @param {sap.m.upload.UploadSetwithTableItem} oItem item to be renamed.
|
|
1239
|
-
* @private
|
|
1240
|
-
* @returns {sap.m.Dialog} oDialog, created dialog instance
|
|
1241
|
-
*/
|
|
1242
|
-
UploadSetwithTable.prototype._getFileRenameDialog = function(oItem) {
|
|
1243
|
-
const oSplit = UploadSetwithTableItem._splitFileName(oItem.getFileName());
|
|
1244
|
-
let iMaxLength = this.getMaxFileNameLength();
|
|
1245
|
-
const iFileExtensionLength = oSplit.extension ? oSplit.extension.length + 1 : 0;
|
|
1246
|
-
iMaxLength = iMaxLength ? iMaxLength : 0;
|
|
1247
|
-
let iNameMaxLength = iMaxLength - iFileExtensionLength;
|
|
1248
|
-
iNameMaxLength = iNameMaxLength < 0 ? 0 : iNameMaxLength;
|
|
1249
|
-
|
|
1250
|
-
// Input field
|
|
1251
|
-
const oInput = new Input({
|
|
1252
|
-
type: Library.InputType.Text,
|
|
1253
|
-
value: oSplit.name,
|
|
1254
|
-
width: "90%",
|
|
1255
|
-
maxLength: iNameMaxLength,
|
|
1256
|
-
liveChange: [this._handleItemNameValidation, this]
|
|
1257
|
-
});
|
|
1258
|
-
oInput.addStyleClass("sapUiTinyMarginTop");
|
|
1259
|
-
oInput.addStyleClass("sapUiSmallMarginBegin");
|
|
1260
|
-
// Label for Input
|
|
1261
|
-
const oLabel = new Label({
|
|
1262
|
-
text: this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_INPUT_LABEL"),
|
|
1263
|
-
labelFor: oInput.getId()
|
|
1264
|
-
});
|
|
1265
|
-
oLabel.addStyleClass("sapUiSmallMarginTop");
|
|
1266
|
-
oLabel.addStyleClass("sapUiSmallMarginBegin");
|
|
1267
|
-
oLabel.addStyleClass("sapUiSmallMarginEnd");
|
|
1268
|
-
// Dialog creation
|
|
1269
|
-
var oDialog = new Dialog({
|
|
1270
|
-
title: this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_DIALOG_TEXT"),
|
|
1271
|
-
contentWidth: "22.5rem",
|
|
1272
|
-
contentHeight: "12rem",
|
|
1273
|
-
content: [oLabel,oInput],
|
|
1274
|
-
beginButton: new Button({
|
|
1275
|
-
type: Library.ButtonType.Emphasized,
|
|
1276
|
-
text: this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_APPLY_BUTTON_TEXT"),
|
|
1277
|
-
press: this._handleItemRenameConfirmation.bind(this),
|
|
1278
|
-
enabled: oInput.getValueState() !== "Error"
|
|
1279
|
-
}),
|
|
1280
|
-
endButton: new Button({
|
|
1281
|
-
text: this._oRb.getText("UPLOADSET_WITH_TABLE_CANCELBUTTON_TEXT"),
|
|
1282
|
-
press: this._handleItemRenameCancel.bind(this)
|
|
1283
|
-
}),
|
|
1284
|
-
customData: {
|
|
1285
|
-
key: "item",
|
|
1286
|
-
value: oItem
|
|
1287
|
-
},
|
|
1288
|
-
afterClose: function () {
|
|
1289
|
-
oDialog.destroy();
|
|
1290
|
-
}
|
|
1291
|
-
});
|
|
1292
|
-
|
|
1293
|
-
return oDialog;
|
|
1294
|
-
};
|
|
1295
|
-
|
|
1296
|
-
/**
|
|
1297
|
-
* Handler for item rename cancel operation.
|
|
1298
|
-
* @param {object} oEvent cancel button click event.
|
|
1299
|
-
* @private
|
|
1300
|
-
*/
|
|
1301
|
-
UploadSetwithTable.prototype._handleItemRenameCancel = function(oEvent) {
|
|
1302
|
-
const oDialog = oEvent.getSource().getParent();
|
|
1303
|
-
const oInput = oDialog.getContent()[1];
|
|
1304
|
-
const oItem = oDialog && oDialog.data ? oDialog.data().item : null;
|
|
1305
|
-
const oSplit = UploadSetwithTableItem._splitFileName(oItem.getFileName());
|
|
1306
|
-
// Check if there are changes made to the existing file name.
|
|
1307
|
-
if (oItem && oInput && oSplit.name !== oInput.getValue()) {
|
|
1308
|
-
MessageBox.warning(this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_DISCARD_POPUP_CHANGES_TEXT"), {
|
|
1309
|
-
actions: [this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_SAVE_BUTTON_TEXT"), this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_DISCARD_CHANGES_BUTTON_TEXT")],
|
|
1310
|
-
emphasizedAction: this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_SAVE_BUTTON_TEXT"),
|
|
1311
|
-
onClose: (sAction) => {
|
|
1312
|
-
if (sAction !== this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_SAVE_BUTTON_TEXT")) {
|
|
1313
|
-
oDialog.close();
|
|
1314
|
-
} else {
|
|
1315
|
-
// fire beginbutton event to save the filename
|
|
1316
|
-
var oBeginButton = oDialog.getBeginButton();
|
|
1317
|
-
var oEvent = new EventBase("click", oBeginButton);
|
|
1318
|
-
oBeginButton.firePress(oEvent);
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
});
|
|
1322
|
-
} else {
|
|
1323
|
-
oDialog.close();
|
|
1324
|
-
}
|
|
1325
|
-
};
|
|
1326
|
-
|
|
1327
|
-
/**
|
|
1328
|
-
* Handler for item rename confirm operation.
|
|
1329
|
-
* @param {object} oEvent confirm button click event.
|
|
1330
|
-
* @private
|
|
1331
|
-
*/
|
|
1332
|
-
UploadSetwithTable.prototype._handleItemRenameConfirmation = function(oEvent) {
|
|
1333
|
-
const oDialog = oEvent.getSource().getParent();
|
|
1334
|
-
const oInput = oDialog.getContent()[1];
|
|
1335
|
-
if (oInput && oInput.getValueState() === "Error") {
|
|
1336
|
-
oInput.focus(oInput);
|
|
1337
|
-
oInput.setShowValueStateMessage(true);
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
const oItem = oDialog && oDialog.data ? oDialog.data().item : null;
|
|
1341
|
-
const oSplit = UploadSetwithTableItem._splitFileName(oItem.getFileName());
|
|
1342
|
-
// update only if there is change
|
|
1343
|
-
if (oItem && oSplit.name !== oInput.getValue()) {
|
|
1344
|
-
if (oSplit && oSplit.extension) {
|
|
1345
|
-
oItem.setFileName(oInput.getValue() + "." + oSplit.extension);
|
|
1346
|
-
} else {
|
|
1347
|
-
oItem.setFileName(oInput.getValue());
|
|
1348
|
-
}
|
|
1349
|
-
oDialog.close();
|
|
1350
|
-
this.fireItemRenamed({item: oItem});
|
|
1351
|
-
} else {
|
|
1352
|
-
oDialog.close();
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
|
|
1356
|
-
/**
|
|
1357
|
-
* Handler for file name validation.
|
|
1358
|
-
* @param {object} oEvent Input keyevent.
|
|
1359
|
-
* @private
|
|
1360
|
-
*/
|
|
1361
|
-
UploadSetwithTable.prototype._handleItemNameValidation = function(oEvent) {
|
|
1362
|
-
const oInput = oEvent.getSource();
|
|
1363
|
-
let sValue = oInput.getValue();
|
|
1364
|
-
sValue = sValue.trim();
|
|
1365
|
-
|
|
1366
|
-
// empty file validation
|
|
1367
|
-
if (sValue === "") {
|
|
1368
|
-
oInput.setProperty("valueState", "Error", true);
|
|
1369
|
-
oInput.setValueStateText(this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_EMPTY_NAME_VALIDATION_ERROR_MESSAGE"));
|
|
1370
|
-
oInput.setShowValueStateMessage(true);
|
|
1371
|
-
return;
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
const oCharacterRegex = new RegExp(/[@#$]/);
|
|
1375
|
-
if (oCharacterRegex.test(sValue)) {
|
|
1376
|
-
oInput.setShowValueStateMessage(true);
|
|
1377
|
-
oInput.setProperty("valueState", "Error", true);
|
|
1378
|
-
oInput.setValueStateText(this._oRb.getText("UPLOADSET_WITH_TABLE_DOCUMENT_RENAME_SPLC_VALIDATION_ERROR_MESSAGE", '@#$'));
|
|
1379
|
-
} else {
|
|
1380
|
-
oInput.setShowValueStateMessage(false);
|
|
1381
|
-
oInput.setProperty("valueState", "None", true);
|
|
1382
|
-
}
|
|
1383
|
-
};
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* Returns CloudFile picker menu button
|
|
1387
|
-
* @return {sap.m.MenuButton} CloudPicker & LocalFileUpload Menu button
|
|
1388
|
-
* @private
|
|
1389
|
-
*/
|
|
1390
|
-
UploadSetwithTable.prototype._getCloudFilePickerMenu = function () {
|
|
1391
|
-
this._oMenuButton = new MenuButton({
|
|
1392
|
-
text: this._oRb.getText("UPLOAD_SET_DEFAULT_LFP_BUTTON_TEXT"),
|
|
1393
|
-
buttonMode: MenuButtonMode.Split,
|
|
1394
|
-
menu: this._getMenuButtonItems(),
|
|
1395
|
-
defaultAction: this.fileSelectionHandler.bind(this)
|
|
1396
|
-
});
|
|
1397
|
-
return this._oMenuButton;
|
|
1398
|
-
};
|
|
1399
|
-
|
|
1400
|
-
/**
|
|
1401
|
-
* Returns Cloud File picker button
|
|
1402
|
-
* @return {sap.m.Button} Cloudfile Picker button
|
|
1403
|
-
* @private
|
|
1404
|
-
*/
|
|
1405
|
-
UploadSetwithTable.prototype._getCloudFilePickerButton = function () {
|
|
1406
|
-
this._oCloudFilePickerButton = new Button({
|
|
1407
|
-
text: this.getCloudFilePickerButtonText() ? this.getCloudFilePickerButtonText() : this._oRb.getText("UPLOAD_SET_DEFAULT_CFP_BUTTON_TEXT"),
|
|
1408
|
-
press: this._invokeCloudFilePicker.bind(this)
|
|
1409
|
-
});
|
|
1410
|
-
return this._oCloudFilePickerButton;
|
|
1411
|
-
};
|
|
1412
|
-
|
|
1413
|
-
UploadSetwithTable.prototype._itemSelectedCallback = function (oEvent) {
|
|
1414
|
-
var oItem = oEvent.getParameter("item");
|
|
1415
|
-
// eslint-disable-next-line default-case
|
|
1416
|
-
switch (oItem.getText()) {
|
|
1417
|
-
case this.getCloudFilePickerButtonText() ? this.getCloudFilePickerButtonText() : this._oRb.getText("UPLOAD_SET_DEFAULT_CFP_BUTTON_TEXT"):
|
|
1418
|
-
this._oMenuButton
|
|
1419
|
-
.detachEvent("defaultAction", this.fileSelectionHandler.bind(this))
|
|
1420
|
-
.attachEvent("defaultAction", this._invokeCloudFilePicker.bind(this));
|
|
1421
|
-
|
|
1422
|
-
this._invokeCloudFilePicker();
|
|
1423
|
-
this._oMenuButton.setText(oItem.getText());
|
|
1424
|
-
break;
|
|
1425
|
-
case this._oRb.getText("UPLOAD_SET_DEFAULT_LFP_BUTTON_TEXT"):
|
|
1426
|
-
this._oMenuButton
|
|
1427
|
-
.detachEvent("defaultAction", this._invokeCloudFilePicker.bind(this))
|
|
1428
|
-
.attachEvent("defaultAction", this.fileSelectionHandler.bind(this));
|
|
1429
|
-
|
|
1430
|
-
this.fileSelectionHandler();
|
|
1431
|
-
this._oMenuButton.setText(oItem.getText());
|
|
1432
|
-
break;
|
|
1433
|
-
}
|
|
1434
|
-
};
|
|
1435
|
-
|
|
1436
|
-
UploadSetwithTable.prototype._getMenuButtonItems = function () {
|
|
1437
|
-
return new Menu({
|
|
1438
|
-
items: [
|
|
1439
|
-
new MenuItem({ text: this._oRb.getText("UPLOAD_SET_DEFAULT_LFP_BUTTON_TEXT") }),
|
|
1440
|
-
new MenuItem({ text: this.getCloudFilePickerButtonText() ? this.getCloudFilePickerButtonText() : this._oRb.getText("UPLOAD_SET_DEFAULT_CFP_BUTTON_TEXT") })
|
|
1441
|
-
],
|
|
1442
|
-
itemSelected: this._itemSelectedCallback.bind(this)
|
|
1443
|
-
});
|
|
1444
|
-
};
|
|
1445
|
-
|
|
1446
|
-
/**
|
|
1447
|
-
* Creates and invokes CloudFilePicker control instance
|
|
1448
|
-
* @private
|
|
1449
|
-
* @returns {Object} cloudFile picker instance
|
|
1450
|
-
*/
|
|
1451
|
-
UploadSetwithTable.prototype._invokeCloudFilePicker = function () {
|
|
1452
|
-
var oCloudFilePickerInstance = null;
|
|
1453
|
-
if (this._cloudFilePickerControl) {
|
|
1454
|
-
oCloudFilePickerInstance = this._getCloudFilePickerInstance();
|
|
1455
|
-
oCloudFilePickerInstance.open();
|
|
1456
|
-
} else {
|
|
1457
|
-
// Dynamically load and cache CloudFilePicker control for first time
|
|
1458
|
-
this._loadCloudFilePickerDependency()
|
|
1459
|
-
.then( (cloudFilePicker) => {
|
|
1460
|
-
this._cloudFilePickerControl = cloudFilePicker;
|
|
1461
|
-
oCloudFilePickerInstance = this._getCloudFilePickerInstance();
|
|
1462
|
-
oCloudFilePickerInstance.open();
|
|
1463
|
-
})
|
|
1464
|
-
.catch((error) => {
|
|
1465
|
-
Log.error(error);
|
|
1466
|
-
});
|
|
1467
|
-
}
|
|
1468
|
-
return oCloudFilePickerInstance;
|
|
1469
|
-
};
|
|
1470
|
-
|
|
1471
|
-
/**
|
|
1472
|
-
* Event handler for CloudFile picker selector
|
|
1473
|
-
* @param {Object} oEvent CloudFile picker file selection DOM change event
|
|
1474
|
-
* @private
|
|
1475
|
-
*/
|
|
1476
|
-
UploadSetwithTable.prototype._onCloudPickerFileChange = function (oEvent) {
|
|
1477
|
-
|
|
1478
|
-
var mParameters = oEvent.getParameters();
|
|
1479
|
-
var aFiles = [];
|
|
1480
|
-
if (mParameters && mParameters.selectedFiles) {
|
|
1481
|
-
mParameters.selectedFiles.forEach( (file) => {
|
|
1482
|
-
aFiles.push(this._createFileFromCloudPickerFile(file));
|
|
1483
|
-
});
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
// invoking this method to handle file uploads
|
|
1487
|
-
this._processNewCloudPickerFileObjects(aFiles);
|
|
1488
|
-
};
|
|
1489
|
-
|
|
1490
|
-
/**
|
|
1491
|
-
* Creates file object that is to be uploaded from the CloudFilePicker file object
|
|
1492
|
-
* @param {sap.suite.ui.commons.CloudFileInfo} oCloudFile CloudFilepicker file object
|
|
1493
|
-
* @returns {Object} file metadata with file object and fileshare properties
|
|
1494
|
-
* @private
|
|
1495
|
-
*/
|
|
1496
|
-
UploadSetwithTable.prototype._createFileFromCloudPickerFile = function (oCloudFile) {
|
|
1497
|
-
var parts = [new Blob([])];
|
|
1498
|
-
var oFileMetaData = {
|
|
1499
|
-
type: oCloudFile.getFileShareItemContentType(),
|
|
1500
|
-
size: oCloudFile.getFileShareItemContentSize(),
|
|
1501
|
-
webkitRelativePath: '',
|
|
1502
|
-
name: oCloudFile.getFileShareItemName()
|
|
1503
|
-
};
|
|
1504
|
-
var oFile = new File(parts, oCloudFile.getFileShareItemName(), oFileMetaData);
|
|
1505
|
-
return {
|
|
1506
|
-
file: oFile,
|
|
1507
|
-
fileShareProperties: oCloudFile.mProperties
|
|
1508
|
-
};
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
/**
|
|
1512
|
-
* Processing and uploading of file objects selected from the CloudFilePicker
|
|
1513
|
-
* @param {Array} oFiles File metadata list containing file to be uploaded and fileshare properties used for mapping
|
|
1514
|
-
* @private
|
|
1515
|
-
*/
|
|
1516
|
-
UploadSetwithTable.prototype._processNewCloudPickerFileObjects = function (oFiles) {
|
|
1517
|
-
|
|
1518
|
-
oFiles.forEach( (oFileMetaData) => {
|
|
1519
|
-
var oFile = oFileMetaData.file;
|
|
1520
|
-
// set the fileshareProperties for the new file created.
|
|
1521
|
-
const oFileShareProperties = oFileMetaData.fileShareProperties;
|
|
1522
|
-
|
|
1523
|
-
var oItem = new UploadSetwithTableItem({
|
|
1524
|
-
uploadState: UploadState.Ready
|
|
1525
|
-
});
|
|
1526
|
-
oItem._setFileObject(oFile);
|
|
1527
|
-
oItem.setFileName(oFile.name);
|
|
1528
|
-
|
|
1529
|
-
// Set the file share properties if its cloud picker selected file. So that the info is avilable on the item getCloudFileInfo API.
|
|
1530
|
-
if (oFile && oFileShareProperties) {
|
|
1531
|
-
oItem._setCloudFileInfo(oFileShareProperties);
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
if (this.getItemValidationHandler() && typeof this.getItemValidationHandler() === "function" ) {
|
|
1536
|
-
|
|
1537
|
-
const oItemInfo = {
|
|
1538
|
-
oItem: oItem,
|
|
1539
|
-
iTotalItemsForUpload: oFiles.length,
|
|
1540
|
-
oSource: this
|
|
1541
|
-
};
|
|
1542
|
-
|
|
1543
|
-
var oPromise = this.getItemValidationHandler()(oItemInfo);
|
|
1544
|
-
if (oPromise && oPromise instanceof Promise) {
|
|
1545
|
-
oPromise
|
|
1546
|
-
.then((item) => {
|
|
1547
|
-
if (item instanceof UploadSetwithTableItem) {
|
|
1548
|
-
this._initateItemUpload(item);
|
|
1549
|
-
}
|
|
1550
|
-
})
|
|
1551
|
-
.catch((item) => {
|
|
1552
|
-
// Reset variable to avoid update if upload rejected.
|
|
1553
|
-
if (item && this._oItemToUpdate && item instanceof UploadSetwithTableItem && item.getId() === this._oItemToUpdate.getId()) {
|
|
1554
|
-
this._oItemToUpdate = null;
|
|
1555
|
-
}
|
|
1556
|
-
});
|
|
1557
|
-
} else {
|
|
1558
|
-
oItem.destroy();
|
|
1559
|
-
// if promise is not returned to the ItemValidation hook log error and destroy the item
|
|
1560
|
-
Log.error("Invalid usage, missing Promise: ItemValidationHandler callback expects Promise to be returned.");
|
|
1561
|
-
}
|
|
1562
|
-
} else {
|
|
1563
|
-
/* if no validation handler is provided control continues with normal upload else waits for the application to manually
|
|
1564
|
-
trigger the upload by resolving the promise */
|
|
1565
|
-
this._initateItemUpload(oItem);
|
|
1566
|
-
}
|
|
1567
|
-
});
|
|
1568
|
-
};
|
|
1569
|
-
|
|
1570
|
-
/**
|
|
1571
|
-
* Dynamically require CloudFilePicker Control
|
|
1572
|
-
* @returns {Promise} Promise that resolves on sucessful load of CloudFilePicker control
|
|
1573
|
-
* @private
|
|
1574
|
-
*/
|
|
1575
|
-
UploadSetwithTable.prototype._loadCloudFilePickerDependency = function () {
|
|
1576
|
-
return new Promise( (resolve, reject) => {
|
|
1577
|
-
Core.loadLibrary("sap.suite.ui.commons", { async: true })
|
|
1578
|
-
.then(function (data) {
|
|
1579
|
-
sap.ui.require(["sap/suite/ui/commons/CloudFilePicker"], function (cloudFilePicker) {
|
|
1580
|
-
resolve(cloudFilePicker);
|
|
1581
|
-
}, function (error) {
|
|
1582
|
-
reject(error);
|
|
1583
|
-
});
|
|
1584
|
-
})
|
|
1585
|
-
.catch(function () {
|
|
1586
|
-
reject("CloudFilePicker Control not available.");
|
|
1587
|
-
});
|
|
1588
|
-
});
|
|
1589
|
-
};
|
|
1590
|
-
|
|
1591
|
-
/**
|
|
1592
|
-
* Creates CloudFilePicker Instance
|
|
1593
|
-
* @returns {sap.suite.ui.commons.CloudFilePicker} CloudFilePicker instance
|
|
1594
|
-
* @private
|
|
1595
|
-
*/
|
|
1596
|
-
UploadSetwithTable.prototype._getCloudFilePickerInstance = function () {
|
|
1597
|
-
return new this._cloudFilePickerControl({
|
|
1598
|
-
serviceUrl: this.getCloudFilePickerServiceUrl(),
|
|
1599
|
-
confirmButtonText: this._oRb.getText("SELECT_PICKER_TITLE_TEXT"),
|
|
1600
|
-
title: this._oRb.getText("SELECT_PICKER_TITLE_TEXT"),
|
|
1601
|
-
fileNameMandatory: true,
|
|
1602
|
-
select: this._onCloudPickerFileChange.bind(this)
|
|
1603
|
-
});
|
|
1604
|
-
};
|
|
1605
|
-
|
|
1606
|
-
return UploadSetwithTable;
|
|
1607
|
-
});
|