import { Component, EmitType, ModuleDeclaration, L10n } from '@syncfusion/ej2-base';
import { INotifyPropertyChanged } from '@syncfusion/ej2-base';
import { Splitter } from '@syncfusion/ej2-layouts';
import { Dialog } from '@syncfusion/ej2-popups';
import { ToolbarSettingsModel } from '../models/index';
import { ToolbarItemModel } from '../models/index';
import { NavigationPaneSettingsModel, DetailsViewSettingsModel } from '../models/index';
import { AjaxSettingsModel, SearchSettingsModel } from '../models/index';
import { Toolbar } from '../actions/toolbar';
import { DetailsView } from '../layout/details-view';
import { LargeIconsView } from '../layout/large-icons-view';
import { Uploader, FileInfo } from '@syncfusion/ej2-inputs';
import { UploadSettingsModel } from '../models/upload-settings-model';
import { FileManagerModel } from './file-manager-model';
import { ITreeView, IContextMenu, ViewType, SortOrder, FileDragEventArgs, RetryArgs, FileSelectionEventArgs } from './interface';
import { BeforeSendEventArgs, SuccessEventArgs, FailureEventArgs, FileLoadEventArgs, FolderCreateEventArgs, DeleteEventArgs, RenameEventArgs, MoveEventArgs, SearchEventArgs } from './interface';
import { FileOpenEventArgs, FileSelectEventArgs, MenuClickEventArgs, MenuOpenEventArgs, MenuCloseEventArgs } from './interface';
import { ToolbarClickEventArgs, ToolbarCreateEventArgs, UploadListCreateArgs } from './interface';
import { PopupOpenCloseEventArgs, BeforePopupOpenCloseEventArgs, BeforeDownloadEventArgs, BeforeImageLoadEventArgs } from './interface';
import { TreeView as BaseTreeView } from '@syncfusion/ej2-navigations';
import { ContextMenuSettingsModel } from '../models/contextMenu-settings-model';
import { BreadCrumbBar } from '../actions/breadcrumb-bar';
import { PositionModel } from '@syncfusion/ej2-base/src/draggable-model';
import { Virtualization } from '../actions/virtualization';
import { SortComparer } from './interface';
/**
* The FileManager component allows users to access and manage the file system through the web browser. It can performs the
* functionalities like add, rename, search, sort, upload and delete files or folders. And also it
* provides an easy way of dynamic injectable modules like toolbar, navigationpane, detailsview, largeiconsview.
* ```html
*
* ```
* ```typescript,
* let feObj: FileManager = new FileManager();
* feObj.appendTo('#file');
* ```
*/
export declare class FileManager extends Component implements INotifyPropertyChanged {
/** @hidden */
toolbarModule: Toolbar;
/** @hidden */
detailsviewModule: DetailsView;
/** @hidden */
navigationpaneModule: ITreeView;
/** @hidden */
largeiconsviewModule: LargeIconsView;
/** @hidden */
contextmenuModule: IContextMenu;
/** @hidden */
breadcrumbbarModule: BreadCrumbBar;
/** @hidden */
virtualizationModule: Virtualization;
private keyboardModule;
private keyConfigs;
filterData: Object;
originalPath: string;
filterPath: string;
filterId: string;
hasId: boolean;
pathNames: string[];
pathId: string[];
expandedId: string;
itemData: Object[];
visitedData: Object;
visitedItem: Element;
toolbarSelection: boolean;
targetPath: string;
feParent: Object[];
feFiles: Object[];
activeElements: Element[];
activeModule: string;
targetModule: string;
treeObj: BaseTreeView;
dialogObj: Dialog;
viewerObj: Dialog;
extDialogObj: Dialog;
selectedNodes: string[];
duplicateItems: string[];
duplicateRecords: Object[];
previousPath: string[];
nextPath: string[];
fileAction: string;
pasteNodes: string[];
responseData: {
[key: string]: Object;
};
existingFileCount: number;
isLayoutChange: boolean;
replaceItems: string[];
createdItem: {
[key: string]: Object;
};
layoutSelectedItems: string[];
renamedItem: {
[key: string]: Object;
};
renamedId: string;
uploadItem: string[];
fileLength: number;
deleteRecords: string[];
fileView: string;
isDevice: boolean;
isMobile: boolean;
isBigger: boolean;
isFile: boolean;
actionRecords: Object[];
activeRecords: Object[];
isCut: boolean;
isSearchCut: boolean;
isSearchDrag: boolean;
isPasteError: boolean;
folderPath: string;
isSameAction: boolean;
currentItemText: string;
renameText: string;
isFiltered: boolean;
isSortByClicked: boolean;
enablePaste: boolean;
splitterObj: Splitter;
persistData: boolean;
breadCrumbBarNavigation: HTMLElement;
localeObj: L10n;
uploadObj: Uploader;
uploadDialogObj: Dialog;
retryArgs: RetryArgs[];
private isOpened;
isRetryOpened: boolean;
isPathDrag: boolean;
searchedItems: {
[key: string]: Object;
}[];
searchWord: string;
retryFiles: FileInfo[];
isApplySame: boolean;
uploadEventArgs: BeforeSendEventArgs;
dragData: {
[key: string]: Object;
}[];
dragNodes: string[];
dragPath: string;
dropPath: string;
isDragDrop: boolean;
virtualDragElement: HTMLElement;
dropData: Object;
treeExpandTimer: number;
dragCursorPosition: PositionModel;
isDropEnd: boolean;
dragCount: number;
droppedObjects: Object[];
destinationPath: string;
uploadingCount: number;
uploadedCount: number;
isMac: boolean;
oldView: string;
oldPath: string;
private viewElem;
private dragSelectElement;
private dragX;
private dragY;
private dragSelectedItems;
/**
* Specifies the AJAX settings of the file manager.
*
* @default {
* getImageUrl: null;
* url: null;
* uploadUrl: null;
* downloadUrl: null;
* }
*/
ajaxSettings: AjaxSettingsModel;
/**
* Specifies the array of data to populate folders/files in the File Manager.
* The mandatory fields to be included in the JSON data are defined in fileData interface.
* This interface can be extended to add additional fields as required.
*
* @default []
*/
fileSystemData: {
[key: string]: Object;
}[];
/**
* Enables or disables drag-and-drop of files.
*
* @default false
*/
allowDragAndDrop: boolean;
/**
* Specifies a template to render customized content for all the nodes. If the `navigationPaneTemplate` property
* is set, the template content overrides the displayed node text in the File Manager navigation pane.
* The property accepts a template string or HTML element ID holding the content.
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
navigationPaneTemplate: string | Function;
/**
* Specifies a template to render customized content for all the files or folders in the large icons view. If the `largeIconsTemplate` property
* is set, the template content overrides the displayed files or folders text in the File Manager large icons view. The property accepts template string
* or HTML element ID holding the content.
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
largeIconsTemplate: string | Function;
/**
* Enables or disables the multiple files selection of the file manager.
*
* @default true
*/
allowMultiSelection: boolean;
/**
* Gets or sets a boolean value that determines whether to display checkboxes in the file manager. If enabled, checkboxes are shown for files or folders on hover.
*
* @default true
*/
showItemCheckBoxes: boolean;
/**
* Specifies the context menu settings of the file manager.
*
* @default {
* file: ['Open','|', 'Cut', 'Copy', '|', 'Delete', 'Rename', '|', 'Details'],
* folder: ['Open','|', 'Cut', 'Copy', 'Paste', '|', 'Delete', 'Rename', '|', 'Details'],
* layout: ['SortBy', 'View', 'Refresh', '|', 'Paste', '|', 'NewFolder', 'Upload', '|', 'Details', '|', 'SelectAll'],
* visible: true,
* }
*/
contextMenuSettings: ContextMenuSettingsModel;
/**
* Specifies the root CSS class of the file manager that allows you to customize the appearance by overriding the styles.
*
* @default ''
*/
cssClass: string;
/**
* Specifies the details view settings of the file manager.
*
* @default {
* columns: [{
* field: 'name', headerText: 'Name', minWidth: 120, template: '${name}',
* customAttributes: { class: 'e-fe-grid-name'}}, { field: '_fm_modified', headerText: 'DateModified', type: 'dateTime',
* format: 'MMMM dd, yyyy HH:mm', minWidth: 120, width: '190' }, { field: 'size', headerText: 'Size', minWidth: 90, width: '110',
* template: '${size}' }
* ]
* }
*/
detailsViewSettings: DetailsViewSettingsModel;
/**
* Defines whether to allow the cross-scripting site or not.
*
* @default true
*/
enableHtmlSanitizer: boolean;
/**
* Enables or disables persisting component's state between page reloads. If enabled, the following APIs will persist:
* 1. `view`: Represents the previous view of the file manager.
* 2. `path`: Represents the previous path of the file manager.
* 3. `selectedItems`: Represents the previous selected items in the file manager.
*
* @default false
*/
enablePersistence: boolean;
/**
* Gets or sets a value that enables/disables the virtualization feature of the File Manager.
* When enabled, the File Manager will only load a subset of files and folders based on the size of the view port, with the rest being loaded dynamically as the user scrolls vertically through the list.
* This can improve performance when dealing with a large number of files and folders, as it reduces the initial load time and memory usage.
*
* @default false
*/
enableVirtualization: boolean;
/**
* Specifies the height of the file manager.
*
* @default '400px'
*/
height: string | number;
/**
* Specifies the initial view of the file manager.
* With the help of this property, initial view can be changed to details or largeicons view. The available views are:
* * `LargeIcons`
* * `Details`
*
* @default 'LargeIcons'
*/
view: ViewType;
/**
* Specifies the navigationpane settings of the file manager.
*
* @default {
* maxWidth: '650px',
* minWidth: '240px',
* visible: true,
* sortOrder: 'None'
* }
*/
navigationPaneSettings: NavigationPaneSettingsModel;
/**
* Specifies the current path of the file manager.
*
* @default '/'
*/
path: string;
/**
* Specifies the target element in which the File Manager’s dialog will be displayed.
* The default value is null, which refers to the File Manager element.
*
* @default null
*/
popupTarget: HTMLElement | string;
/**
* Specifies the search settings of the file manager.
*
* @default {
* allowSearchOnTyping: true,
* filterType: 'contains',
* ignoreCase: true
* }
*/
searchSettings: SearchSettingsModel;
/**
* Specifies the selected folders and files name of the file manager.
*
* @default []
*/
selectedItems: string[];
/**
* Shows or hides the file extension in file manager.
*
* @default true
*/
showFileExtension: boolean;
/**
* Specifies the root folder alias name in file manager
*
* @default null
*/
rootAliasName: string;
/**
* Determines whether to show or hide hidden files and folders.
* This is applicable only for storage systems that support attributes for controlling the visibility of data, including physical file directories and custom flat data handlers.
*
* @default false
*/
showHiddenItems: boolean;
/**
* Shows or hides the thumbnail images in largeicons view.
*
* @default true
*/
showThumbnail: boolean;
/**
* Specifies a value that indicates whether the folders and files are sorted in the ascending or descending order,
* or they are not sorted at all. The available types of sort orders are,
* `None` - Indicates that the folders and files are not sorted.
* `Ascending` - Indicates that the folders and files are sorted in the ascending order.
* `Descending` - Indicates that the folders and files are sorted in the descending order.
*
* @default 'Ascending'
*/
sortOrder: SortOrder;
/**
* Specifies the field name being used as the sorting criteria to sort the files of the file manager component.
*
* @default 'name'
*/
sortBy: string;
/**
* Defines the custom sorting function.
* The sort comparer function has the same functionality like
* [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) sort comparer.
* This can be used to customize the default sorting functionalities with required comparison values.
*
* @default null
* @aspType string
*/
sortComparer: SortComparer | string;
/**
* Gets or sets a value that indicates whether the File Manager allows multiple items selection with mouse dragging.
* Set this property to true to allow users to select multiple items with mouse drag as like file explorer. Hover over
* the files or folders and drag the mouse to select the required items.
*
* @default false
*/
enableRangeSelection: boolean;
/**
* Specifies the group of items aligned horizontally in the toolbar.
*
* @default {
* items: ['NewFolder', 'Upload', 'Cut', 'Copy', 'Paste', 'Delete',
* 'Download', 'Rename', 'SortBy', 'Refresh', 'Selection', 'View', 'Details'],
* visible: true
* }
*/
toolbarSettings: ToolbarSettingsModel;
/**
* An array of items that are used to configure File Manager toolbar items.
*
* @remarks
* Use this property if you want to include custom toolbar items along with existing toolbar items. If both `toolbarSettings` and `toolbarItems` are defined, then items will be rendered based on toolbarItems.
*
* @default []
*
*/
toolbarItems: ToolbarItemModel[];
/**
* Specifies the upload settings for the file manager.
*
* @default {
* autoUpload: true,
* minFileSize: 0,
* maxFileSize: 30000000,
* allowedExtensions: '',
* autoClose: false,
* directoryUpload: false,
* sequentialUpload: false
* }
*/
uploadSettings: UploadSettingsModel;
/**
* Specifies the width of the file manager.
*
* @default '100%'
*/
width: string | number;
/**
* Triggers before the file/folder is rendered.
*
* @event fileLoad
*/
fileLoad: EmitType;
/**
* Triggers before the file/folder is opened.
*
* @event fileOpen
*/
fileOpen: EmitType;
/**
* Triggers before sending the download request to the server.
*
* @event beforeDownload
*/
beforeDownload: EmitType;
/**
* Triggers before sending the getImage request to the server.
*
* @event beforeImageLoad
*/
beforeImageLoad: EmitType;
/**
* Triggers before the dialog is closed.
*
* @event beforePopupClose
*/
beforePopupClose: EmitType;
/**
* Triggers before the dialog is opened.
*
* @event beforePopupOpen
*/
beforePopupOpen: EmitType;
/**
* Triggers before sending the AJAX request to the server.
*
* @event beforeSend
*/
beforeSend: EmitType;
/**
* Triggers when the file manager component is created.
*
* @event created
*/
created: EmitType