@syncfusion/ej2-filemanager 19.4.56 → 20.1.52-10459
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/.eslintrc.json +20 -3
- package/README.md +54 -43
- package/dist/ej2-filemanager.min.js +1 -0
- package/dist/ej2-filemanager.umd.min.js +1 -10
- package/dist/ej2-filemanager.umd.min.js.map +1 -1
- package/dist/es6/ej2-filemanager.es2015.js +2371 -664
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +2440 -714
- package/dist/es6/ej2-filemanager.es5.js.map +1 -1
- package/dist/global/ej2-filemanager.min.js +1 -10
- package/dist/global/ej2-filemanager.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/helpers/e2e/filemanagerHelper.js +183 -166
- package/package.json +71 -71
- package/src/file-manager/actions/breadcrumb-bar.js +1 -5
- package/src/file-manager/actions/index.d.ts +1 -0
- package/src/file-manager/actions/index.js +1 -0
- package/src/file-manager/actions/toolbar.d.ts +1 -0
- package/src/file-manager/actions/toolbar.js +135 -20
- package/src/file-manager/actions/virtualization.d.ts +93 -0
- package/src/file-manager/actions/virtualization.js +279 -0
- package/src/file-manager/base/file-manager-model.d.ts +161 -28
- package/src/file-manager/base/file-manager.d.ts +182 -28
- package/src/file-manager/base/file-manager.js +254 -29
- package/src/file-manager/base/interface.d.ts +329 -3
- package/src/file-manager/base/interface.js +0 -1
- package/src/file-manager/common/operations.d.ts +7 -0
- package/src/file-manager/common/operations.js +830 -185
- package/src/file-manager/common/utility.d.ts +46 -3
- package/src/file-manager/common/utility.js +249 -73
- package/src/file-manager/index.d.ts +1 -0
- package/src/file-manager/index.js +1 -0
- package/src/file-manager/layout/details-view.d.ts +10 -0
- package/src/file-manager/layout/details-view.js +204 -94
- package/src/file-manager/layout/large-icons-view.d.ts +4 -2
- package/src/file-manager/layout/large-icons-view.js +122 -73
- package/src/file-manager/layout/navigation-pane.d.ts +2 -0
- package/src/file-manager/layout/navigation-pane.js +97 -73
- package/src/file-manager/models/column-model.d.ts +23 -5
- package/src/file-manager/models/column.d.ts +21 -2
- package/src/file-manager/models/column.js +6 -0
- package/src/file-manager/models/default-locale.js +0 -1
- package/src/file-manager/models/details-view-settings-model.d.ts +1 -1
- package/src/file-manager/models/details-view-settings.js +8 -3
- package/src/file-manager/models/navigation-pane-settings.d.ts +8 -8
- package/src/file-manager/models/search-settings.d.ts +5 -0
- package/src/file-manager/models/toolbar-settings-model.d.ts +177 -2
- package/src/file-manager/models/toolbar-settings.d.ts +157 -2
- package/src/file-manager/models/toolbar-settings.js +64 -2
- package/src/file-manager/models/upload-settings-model.d.ts +13 -0
- package/src/file-manager/models/upload-settings.d.ts +12 -0
- package/src/file-manager/models/upload-settings.js +3 -0
- package/src/file-manager/pop-up/context-menu.d.ts +2 -1
- package/src/file-manager/pop-up/context-menu.js +111 -36
- package/src/file-manager/pop-up/dialog.d.ts +1 -2
- package/src/file-manager/pop-up/dialog.js +19 -40
- package/src/global.js +1 -1
- package/styles/bootstrap-dark-lite.css +1058 -0
- package/styles/bootstrap-dark-lite.scss +16 -0
- package/styles/bootstrap-dark.css +371 -665
- package/styles/bootstrap-dark.scss +17 -1
- package/styles/bootstrap-lite.css +1040 -0
- package/styles/bootstrap-lite.scss +16 -0
- package/styles/bootstrap.css +353 -644
- package/styles/bootstrap.scss +17 -1
- package/styles/bootstrap4-lite.css +1068 -0
- package/styles/bootstrap4-lite.scss +16 -0
- package/styles/bootstrap4.css +381 -680
- package/styles/bootstrap4.scss +17 -1
- package/styles/bootstrap5-dark-lite.css +1078 -0
- package/styles/bootstrap5-dark-lite.scss +16 -0
- package/styles/bootstrap5-dark.css +377 -695
- package/styles/bootstrap5-dark.scss +17 -1
- package/styles/bootstrap5-lite.css +1078 -0
- package/styles/bootstrap5-lite.scss +16 -0
- package/styles/bootstrap5.3-lite.css +1035 -0
- package/styles/bootstrap5.3-lite.scss +16 -0
- package/styles/bootstrap5.3.css +1603 -0
- package/styles/bootstrap5.3.scss +17 -0
- package/styles/bootstrap5.css +377 -695
- package/styles/bootstrap5.scss +17 -1
- package/styles/fabric-dark-lite.css +1039 -0
- package/styles/fabric-dark-lite.scss +16 -0
- package/styles/fabric-dark.css +358 -642
- package/styles/fabric-dark.scss +17 -1
- package/styles/fabric-lite.css +1039 -0
- package/styles/fabric-lite.scss +16 -0
- package/styles/fabric.css +357 -641
- package/styles/fabric.scss +17 -1
- package/styles/file-manager/_all.scss +1 -1
- package/styles/file-manager/_bds-definition.scss +236 -0
- package/styles/file-manager/_bigger.scss +758 -0
- package/styles/file-manager/_bootstrap-dark-definition.scss +6 -2
- package/styles/file-manager/_bootstrap-definition.scss +6 -2
- package/styles/file-manager/_bootstrap4-definition.scss +6 -2
- package/styles/file-manager/_bootstrap5-definition.scss +21 -16
- package/styles/file-manager/_bootstrap5.3-definition.scss +242 -0
- package/styles/file-manager/_fabric-dark-definition.scss +6 -2
- package/styles/file-manager/_fabric-definition.scss +6 -2
- package/styles/file-manager/_fluent-dark-definition.scss +1 -0
- package/styles/file-manager/_fluent-definition.scss +26 -22
- package/styles/file-manager/_fluent2-definition.scss +255 -0
- package/styles/file-manager/_fusionnew-definition.scss +241 -0
- package/styles/file-manager/_highcontrast-definition.scss +6 -2
- package/styles/file-manager/_highcontrast-light-definition.scss +6 -2
- package/styles/file-manager/_layout.scss +373 -912
- package/styles/file-manager/_material-dark-definition.scss +7 -2
- package/styles/file-manager/_material-definition.scss +7 -2
- package/styles/file-manager/_material3-dark-definition.scss +1 -0
- package/styles/file-manager/_material3-definition.scss +235 -0
- package/styles/file-manager/_tailwind-definition.scss +20 -16
- package/styles/file-manager/_theme.scss +130 -99
- package/styles/file-manager/bootstrap-dark.css +371 -665
- package/styles/file-manager/bootstrap-dark.scss +2 -1
- package/styles/file-manager/bootstrap.css +353 -644
- package/styles/file-manager/bootstrap.scss +2 -1
- package/styles/file-manager/bootstrap4.css +381 -680
- package/styles/file-manager/bootstrap4.scss +2 -1
- package/styles/file-manager/bootstrap5-dark.css +377 -695
- package/styles/file-manager/bootstrap5-dark.scss +2 -1
- package/styles/file-manager/bootstrap5.3.css +1603 -0
- package/styles/file-manager/bootstrap5.3.scss +17 -0
- package/styles/file-manager/bootstrap5.css +377 -695
- package/styles/file-manager/bootstrap5.scss +2 -1
- package/styles/file-manager/fabric-dark.css +358 -642
- package/styles/file-manager/fabric-dark.scss +2 -1
- package/styles/file-manager/fabric.css +357 -641
- package/styles/file-manager/fabric.scss +2 -1
- package/styles/file-manager/fluent-dark.css +1616 -0
- package/styles/file-manager/fluent-dark.scss +17 -0
- package/styles/file-manager/fluent.css +1615 -0
- package/styles/file-manager/fluent.scss +17 -0
- package/styles/file-manager/fluent2.css +1886 -0
- package/styles/file-manager/fluent2.scss +17 -0
- package/styles/file-manager/highcontrast-light.css +354 -644
- package/styles/file-manager/highcontrast-light.scss +2 -1
- package/styles/file-manager/highcontrast.css +377 -647
- package/styles/file-manager/highcontrast.scss +2 -1
- package/styles/file-manager/icons/_bds.scss +235 -0
- package/styles/file-manager/icons/_bootstrap.scss +0 -1
- package/styles/file-manager/icons/_bootstrap4.scss +0 -1
- package/styles/file-manager/icons/_bootstrap5.3.scss +235 -0
- package/styles/file-manager/icons/_fabric-dark.scss +0 -1
- package/styles/file-manager/icons/_fabric.scss +0 -1
- package/styles/file-manager/icons/_fluent-dark.scss +1 -0
- package/styles/file-manager/icons/_fluent.scss +19 -19
- package/styles/file-manager/icons/_fluent2.scss +235 -0
- package/styles/file-manager/icons/_fusionnew.scss +235 -0
- package/styles/file-manager/icons/_material3-dark.scss +1 -0
- package/styles/file-manager/icons/_material3.scss +235 -0
- package/styles/file-manager/icons/_tailwind.scss +49 -49
- package/styles/file-manager/material-dark.css +392 -671
- package/styles/file-manager/material-dark.scss +2 -1
- package/styles/file-manager/material.css +391 -654
- package/styles/file-manager/material.scss +2 -1
- package/styles/file-manager/material3-dark.css +1633 -0
- package/styles/file-manager/material3-dark.scss +18 -0
- package/styles/file-manager/material3.css +1635 -0
- package/styles/file-manager/material3.scss +18 -0
- package/styles/file-manager/tailwind-dark.css +369 -686
- package/styles/file-manager/tailwind-dark.scss +2 -1
- package/styles/file-manager/tailwind.css +369 -686
- package/styles/file-manager/tailwind.scss +2 -1
- package/styles/fluent-dark-lite.css +1037 -0
- package/styles/fluent-dark-lite.scss +16 -0
- package/styles/fluent-dark.css +1616 -0
- package/styles/fluent-dark.scss +17 -0
- package/styles/fluent-lite.css +1036 -0
- package/styles/fluent-lite.scss +16 -0
- package/styles/fluent.css +1615 -0
- package/styles/fluent.scss +17 -0
- package/styles/fluent2-lite.css +1272 -0
- package/styles/fluent2-lite.scss +16 -0
- package/styles/fluent2.css +1886 -0
- package/styles/fluent2.scss +17 -0
- package/styles/highcontrast-light-lite.css +1039 -0
- package/styles/highcontrast-light-lite.scss +16 -0
- package/styles/highcontrast-light.css +354 -644
- package/styles/highcontrast-light.scss +17 -1
- package/styles/highcontrast-lite.css +1059 -0
- package/styles/highcontrast-lite.scss +16 -0
- package/styles/highcontrast.css +377 -647
- package/styles/highcontrast.scss +17 -1
- package/styles/material-dark-lite.css +1092 -0
- package/styles/material-dark-lite.scss +16 -0
- package/styles/material-dark.css +392 -671
- package/styles/material-dark.scss +17 -1
- package/styles/material-lite.css +1097 -0
- package/styles/material-lite.scss +16 -0
- package/styles/material.css +391 -654
- package/styles/material.scss +17 -1
- package/styles/material3-dark-lite.css +1090 -0
- package/styles/material3-dark-lite.scss +16 -0
- package/styles/material3-dark.css +1633 -0
- package/styles/material3-dark.scss +19 -0
- package/styles/material3-lite.css +1092 -0
- package/styles/material3-lite.scss +16 -0
- package/styles/material3.css +1635 -0
- package/styles/material3.scss +19 -0
- package/styles/tailwind-dark-lite.css +1060 -0
- package/styles/tailwind-dark-lite.scss +16 -0
- package/styles/tailwind-dark.css +369 -686
- package/styles/tailwind-dark.scss +17 -1
- package/styles/tailwind-lite.css +1060 -0
- package/styles/tailwind-lite.scss +16 -0
- package/styles/tailwind.css +369 -686
- package/styles/tailwind.scss +17 -1
- package/CHANGELOG.md +0 -466
@@ -17,7 +17,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
17
17
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
18
18
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
19
19
|
};
|
20
|
-
import { Component, isNullOrUndefined, L10n, closest } from '@syncfusion/ej2-base';
|
20
|
+
import { Component, isNullOrUndefined, L10n, closest, Collection, detach, selectAll, setStyleAttribute } from '@syncfusion/ej2-base';
|
21
21
|
import { Property, NotifyPropertyChanges, Complex, select } from '@syncfusion/ej2-base';
|
22
22
|
import { createElement, addClass, removeClass, setStyleAttribute as setAttr, getUniqueID } from '@syncfusion/ej2-base';
|
23
23
|
import { isNullOrUndefined as isNOU, formatUnit, Browser, KeyboardEvents } from '@syncfusion/ej2-base';
|
@@ -26,6 +26,7 @@ import { Splitter } from '@syncfusion/ej2-layouts';
|
|
26
26
|
import { Dialog, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
27
27
|
import { createDialog, createExtDialog } from '../pop-up/dialog';
|
28
28
|
import { ToolbarSettings, AjaxSettings, NavigationPaneSettings, DetailsViewSettings } from '../models/index';
|
29
|
+
import { ToolbarItem } from '../models/index';
|
29
30
|
import { SearchSettings } from '../models/index';
|
30
31
|
import { LargeIconsView } from '../layout/large-icons-view';
|
31
32
|
import { Uploader } from '@syncfusion/ej2-inputs';
|
@@ -34,7 +35,7 @@ import * as events from './constant';
|
|
34
35
|
import * as CLS from './classes';
|
35
36
|
import { read, filter, createFolder } from '../common/operations';
|
36
37
|
import { refresh, getPathObject, getLocaleText, setNextPath, createDeniedDialog, getCssClass } from '../common/utility';
|
37
|
-
import { hasContentAccess, hasUploadAccess, updateLayout, createNewFolder, uploadItem } from '../common/utility';
|
38
|
+
import { hasContentAccess, hasUploadAccess, updateLayout, createNewFolder, uploadItem, closePopup } from '../common/utility';
|
38
39
|
import { ContextMenuSettings } from '../models/contextMenu-settings';
|
39
40
|
import { BreadCrumbBar } from '../actions/breadcrumb-bar';
|
40
41
|
import { ContextMenu } from '../pop-up/context-menu';
|
@@ -55,21 +56,19 @@ var FileManager = /** @class */ (function (_super) {
|
|
55
56
|
__extends(FileManager, _super);
|
56
57
|
function FileManager(options, element) {
|
57
58
|
var _this = _super.call(this, options, element) || this;
|
58
|
-
// eslint-disable-next-line
|
59
59
|
_this.filterData = null;
|
60
60
|
_this.selectedNodes = [];
|
61
61
|
_this.duplicateItems = [];
|
62
|
-
// eslint-disable-next-line
|
63
62
|
_this.duplicateRecords = [];
|
64
63
|
_this.previousPath = [];
|
65
64
|
_this.nextPath = [];
|
65
|
+
_this.existingFileCount = 0;
|
66
66
|
_this.isLayoutChange = false;
|
67
67
|
_this.layoutSelectedItems = [];
|
68
68
|
_this.renamedId = null;
|
69
69
|
_this.uploadItem = [];
|
70
70
|
_this.deleteRecords = [];
|
71
71
|
_this.isFile = false;
|
72
|
-
_this.sortBy = 'name';
|
73
72
|
_this.isCut = false;
|
74
73
|
_this.isSearchCut = false;
|
75
74
|
_this.isSearchDrag = false;
|
@@ -85,11 +84,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
85
84
|
_this.isOpened = false;
|
86
85
|
_this.isRetryOpened = false;
|
87
86
|
_this.isPathDrag = false;
|
88
|
-
// eslint-disable-next-line
|
89
87
|
_this.searchedItems = [];
|
90
88
|
_this.retryFiles = [];
|
91
89
|
_this.isApplySame = false;
|
92
|
-
// eslint-disable-next-line
|
93
90
|
_this.dragData = [];
|
94
91
|
_this.dragNodes = [];
|
95
92
|
_this.dragPath = '';
|
@@ -99,10 +96,12 @@ var FileManager = /** @class */ (function (_super) {
|
|
99
96
|
_this.dragCursorPosition = { left: 44, top: 18 };
|
100
97
|
_this.isDropEnd = false;
|
101
98
|
_this.dragCount = 0;
|
102
|
-
// eslint-disable-next-line
|
103
99
|
_this.droppedObjects = [];
|
104
100
|
_this.uploadingCount = 0;
|
105
101
|
_this.uploadedCount = 0;
|
102
|
+
//Specifies whether the operating system is MAC or not
|
103
|
+
_this.isMac = false;
|
104
|
+
_this.dragSelectedItems = [];
|
106
105
|
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
|
107
106
|
return _this;
|
108
107
|
}
|
@@ -177,25 +176,36 @@ var FileManager = /** @class */ (function (_super) {
|
|
177
176
|
if (this.toolbarSettings.visible) {
|
178
177
|
modules.push({
|
179
178
|
member: 'toolbar',
|
180
|
-
args: [this]
|
179
|
+
args: [this],
|
180
|
+
name: 'Toolbar'
|
181
181
|
});
|
182
182
|
}
|
183
183
|
if (this.navigationPaneSettings.visible) {
|
184
184
|
modules.push({
|
185
185
|
member: 'navigationpane',
|
186
|
-
args: [this]
|
186
|
+
args: [this],
|
187
|
+
name: 'NavigationPane'
|
187
188
|
});
|
188
189
|
}
|
189
190
|
if (this.view) {
|
190
191
|
modules.push({
|
191
192
|
member: 'detailsview',
|
192
|
-
args: [this]
|
193
|
+
args: [this],
|
194
|
+
name: 'DetailsView'
|
193
195
|
});
|
194
196
|
}
|
195
197
|
if (this.contextMenuSettings.visible && !this.isDevice) {
|
196
198
|
modules.push({
|
197
199
|
member: 'contextmenu',
|
198
|
-
args: [this]
|
200
|
+
args: [this],
|
201
|
+
name: 'ContextMenu'
|
202
|
+
});
|
203
|
+
}
|
204
|
+
if (this.enableVirtualization) {
|
205
|
+
modules.push({
|
206
|
+
member: 'virtualization',
|
207
|
+
args: [this],
|
208
|
+
name: 'Virtualization'
|
199
209
|
});
|
200
210
|
}
|
201
211
|
return modules;
|
@@ -212,9 +222,13 @@ var FileManager = /** @class */ (function (_super) {
|
|
212
222
|
this.allowMultiSelection ? this.selectedItems : this.selectedItems.slice(this.selectedItems.length - 1);
|
213
223
|
this.setProperties({ selectedItems: slItems }, true);
|
214
224
|
this.fileView = this.view;
|
225
|
+
this.isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
215
226
|
this.setRtl(this.enableRtl);
|
216
227
|
this.addEventListeners();
|
217
228
|
read(this, (this.path !== this.originalPath) ? events.initialEnd : events.finalizeEnd, this.path);
|
229
|
+
if (this.fileView === 'Details') {
|
230
|
+
this.largeiconsviewModule.element.classList.add(CLS.DISPLAY_NONE);
|
231
|
+
}
|
218
232
|
this.adjustHeight();
|
219
233
|
if (isNOU(this.navigationpaneModule)) {
|
220
234
|
this.splitterObj.collapse(this.enableRtl ? 1 : 0);
|
@@ -418,6 +432,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
418
432
|
minFileSize: this.uploadSettings.minFileSize,
|
419
433
|
maxFileSize: this.uploadSettings.maxFileSize,
|
420
434
|
allowedExtensions: this.uploadSettings.allowedExtensions,
|
435
|
+
directoryUpload: this.uploadSettings.directoryUpload,
|
421
436
|
fileListRendering: this.onFileListRender.bind(this)
|
422
437
|
});
|
423
438
|
this.uploadObj.appendTo('#' + this.element.id + CLS.UPLOAD_ID);
|
@@ -430,6 +445,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
430
445
|
this.uploadObj.minFileSize = this.uploadSettings.minFileSize;
|
431
446
|
this.uploadObj.maxFileSize = this.uploadSettings.maxFileSize;
|
432
447
|
this.uploadObj.allowedExtensions = this.uploadSettings.allowedExtensions;
|
448
|
+
this.uploadObj.directoryUpload = this.uploadSettings.directoryUpload;
|
433
449
|
this.uploadObj.dataBind();
|
434
450
|
};
|
435
451
|
FileManager.prototype.onBeforeOpen = function (args) {
|
@@ -479,9 +495,8 @@ var FileManager = /** @class */ (function (_super) {
|
|
479
495
|
}
|
480
496
|
}
|
481
497
|
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
482
|
-
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }];
|
498
|
+
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
483
499
|
var uploadUrl = this.ajaxSettings.uploadUrl ? this.ajaxSettings.uploadUrl : this.ajaxSettings.url;
|
484
|
-
// eslint-disable-next-line
|
485
500
|
var ajaxSettings = {
|
486
501
|
url: uploadUrl,
|
487
502
|
type: 'POST',
|
@@ -497,7 +512,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
497
512
|
this.trigger('beforeSend', this.uploadEventArgs, function (uploadEventArgs) {
|
498
513
|
args.customFormData = JSON.parse(getValue('data', uploadEventArgs.ajaxSettings));
|
499
514
|
args.cancel = uploadEventArgs.cancel;
|
500
|
-
// eslint-disable-next-line
|
501
515
|
var eventArgs = {
|
502
516
|
cancel: false,
|
503
517
|
httpRequest: args.currentRequest
|
@@ -534,7 +548,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
534
548
|
}
|
535
549
|
this.uploadingCount = args.filesData.length;
|
536
550
|
this.uploadedCount = 0;
|
537
|
-
// eslint-disable-next-line
|
538
551
|
var details = getPathObject(this);
|
539
552
|
if (!hasUploadAccess(details)) {
|
540
553
|
args.cancel = true;
|
@@ -543,7 +556,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
543
556
|
}
|
544
557
|
this.uploadDialogObj.show();
|
545
558
|
};
|
546
|
-
// eslint-disable-next-line
|
547
559
|
FileManager.prototype.onFileUploadSuccess = function (args) {
|
548
560
|
this.uploadedCount = this.uploadedCount + args.count;
|
549
561
|
if (this.uploadSettings.autoClose && (this.uploadingCount === this.uploadedCount)) {
|
@@ -551,7 +563,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
551
563
|
}
|
552
564
|
};
|
553
565
|
/* istanbul ignore next */
|
554
|
-
// eslint-disable-next-line
|
555
566
|
FileManager.prototype.onUploadSuccess = function (files) {
|
556
567
|
var args = { action: 'Upload', result: files };
|
557
568
|
this.trigger('success', args);
|
@@ -563,9 +574,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
563
574
|
}
|
564
575
|
};
|
565
576
|
/* istanbul ignore next */
|
566
|
-
// eslint-disable-next-line
|
567
577
|
FileManager.prototype.onUploadFailure = function (files) {
|
568
|
-
// eslint-disable-next-line
|
569
578
|
var response = getValue('response', files);
|
570
579
|
var statusText = getValue('statusText', response);
|
571
580
|
if (statusText !== '') {
|
@@ -649,12 +658,40 @@ var FileManager = /** @class */ (function (_super) {
|
|
649
658
|
break;
|
650
659
|
case 'ctrlU':
|
651
660
|
e.preventDefault();
|
652
|
-
|
653
|
-
|
661
|
+
if (this.toolbarSettings.items.indexOf('Upload') !== -1) {
|
662
|
+
uploadEle = select('#' + this.element.id + CLS.UPLOAD_ID, this.element);
|
663
|
+
uploadEle.click();
|
664
|
+
}
|
654
665
|
break;
|
655
666
|
}
|
656
667
|
};
|
668
|
+
FileManager.prototype.wireSelectOnDragEvent = function (isBind) {
|
669
|
+
if (isNOU(this.view)) {
|
670
|
+
return;
|
671
|
+
}
|
672
|
+
if (isBind) {
|
673
|
+
this.viewElem = this.view === 'LargeIcons' ? this.largeiconsviewModule.element : this.element.querySelector('.e-gridcontent');
|
674
|
+
}
|
675
|
+
if (!this.viewElem) {
|
676
|
+
return;
|
677
|
+
}
|
678
|
+
if (isBind) {
|
679
|
+
if (this.allowMultiSelection) {
|
680
|
+
EventHandler.add(this.viewElem, 'mousedown', this.onDragStart, this);
|
681
|
+
this.on(events.layoutChange, this.onLayoutChange, this);
|
682
|
+
this.on(events.selectionChanged, this.onLayoutChange, this);
|
683
|
+
}
|
684
|
+
}
|
685
|
+
else {
|
686
|
+
EventHandler.remove(this.viewElem, 'mousedown', this.onDragStart);
|
687
|
+
this.off(events.layoutChange, this.onLayoutChange);
|
688
|
+
this.off(events.selectionChanged, this.onLayoutChange);
|
689
|
+
}
|
690
|
+
};
|
657
691
|
FileManager.prototype.wireEvents = function () {
|
692
|
+
if (this.enableRangeSelection) {
|
693
|
+
this.wireSelectOnDragEvent(true);
|
694
|
+
}
|
658
695
|
EventHandler.add(window, 'resize', this.resizeHandler, this);
|
659
696
|
this.keyboardModule = new KeyboardEvents(this.element, {
|
660
697
|
keyAction: this.keyActionHandler.bind(this),
|
@@ -663,9 +700,94 @@ var FileManager = /** @class */ (function (_super) {
|
|
663
700
|
});
|
664
701
|
};
|
665
702
|
FileManager.prototype.unWireEvents = function () {
|
703
|
+
this.wireSelectOnDragEvent(false);
|
666
704
|
EventHandler.remove(window, 'resize', this.resizeHandler);
|
667
705
|
this.keyboardModule.destroy();
|
668
706
|
};
|
707
|
+
FileManager.prototype.onDragStart = function (event) {
|
708
|
+
if (this.viewElem) {
|
709
|
+
if (this.allowDragAndDrop) {
|
710
|
+
var targetElement = closest(event.target, this.viewElem.classList.contains('e-large-icons') ? '.e-list-item' : '.e-fe-text');
|
711
|
+
if (targetElement) {
|
712
|
+
return;
|
713
|
+
}
|
714
|
+
}
|
715
|
+
event.preventDefault();
|
716
|
+
this.dragX = event.pageX;
|
717
|
+
this.dragY = event.pageY;
|
718
|
+
if (!this.dragSelectElement) {
|
719
|
+
this.dragSelectElement = createElement('div', {
|
720
|
+
id: this.element.id + '_drag',
|
721
|
+
className: 'e-filemanager e-drag-select',
|
722
|
+
styles: 'left: ' + this.dragX + 'px;top: ' + this.dragY + 'px;'
|
723
|
+
});
|
724
|
+
document.body.append(this.dragSelectElement);
|
725
|
+
}
|
726
|
+
EventHandler.add(document, 'mouseup', this.onDragStop, this);
|
727
|
+
EventHandler.add(this.viewElem, 'mousemove', this.onDrag, this);
|
728
|
+
EventHandler.add(this.dragSelectElement, 'mousemove', this.onDrag, this);
|
729
|
+
}
|
730
|
+
};
|
731
|
+
FileManager.prototype.onDrag = function (event) {
|
732
|
+
event.stopPropagation();
|
733
|
+
if (this.dragSelectElement) {
|
734
|
+
var diffX = event.pageX - this.dragX;
|
735
|
+
var diffY = event.pageY - this.dragY;
|
736
|
+
setStyleAttribute(this.dragSelectElement, {
|
737
|
+
'left': diffX < 0 ? this.dragX + diffX + 'px' : this.dragX + 'px', 'top': diffY < 0 ? this.dragY + diffY + 'px' : this.dragY + 'px',
|
738
|
+
'height': Math.abs(diffY) + 'px', 'width': Math.abs(diffX) + 'px'
|
739
|
+
});
|
740
|
+
this.selectItems();
|
741
|
+
}
|
742
|
+
else {
|
743
|
+
EventHandler.remove(this.viewElem, 'mousemove', this.onDrag);
|
744
|
+
}
|
745
|
+
};
|
746
|
+
FileManager.prototype.onDragStop = function () {
|
747
|
+
if (this.viewElem) {
|
748
|
+
EventHandler.remove(document, 'mouseup', this.onDragStop);
|
749
|
+
EventHandler.remove(this.viewElem, 'mousemove', this.onDrag);
|
750
|
+
}
|
751
|
+
if (this.dragSelectElement) {
|
752
|
+
EventHandler.remove(this.dragSelectElement, 'mousemove', this.onDrag);
|
753
|
+
if (this.dragSelectElement.clientHeight > 0 && this.dragSelectElement.clientWidth > 0) {
|
754
|
+
this.setProperties({ selectedItems: this.dragSelectedItems });
|
755
|
+
}
|
756
|
+
this.dragSelectedItems = [];
|
757
|
+
detach(this.dragSelectElement);
|
758
|
+
this.dragSelectElement = null;
|
759
|
+
}
|
760
|
+
};
|
761
|
+
FileManager.prototype.selectItems = function () {
|
762
|
+
this.dragSelectedItems = [];
|
763
|
+
var dragRect = this.dragSelectElement.getBoundingClientRect();
|
764
|
+
var allItems = selectAll(this.viewElem.classList.contains('e-large-icons') ? '.e-list-item' : '.e-row', this.viewElem);
|
765
|
+
removeClass(selectAll('.e-active', this.viewElem), ['e-active', 'e-focus']);
|
766
|
+
removeClass(selectAll('.e-check', this.viewElem), ['e-check']);
|
767
|
+
for (var _i = 0, allItems_1 = allItems; _i < allItems_1.length; _i++) {
|
768
|
+
var item = allItems_1[_i];
|
769
|
+
var itemRect = item.getBoundingClientRect();
|
770
|
+
if (!(dragRect.right < itemRect.left || dragRect.left > itemRect.right
|
771
|
+
|| dragRect.bottom < itemRect.top || dragRect.top > itemRect.bottom)
|
772
|
+
&& (this.dragSelectElement.clientHeight > 0 && this.dragSelectElement.clientWidth > 0)) {
|
773
|
+
if (this.viewElem.classList.contains('e-large-icons')) {
|
774
|
+
item.classList.add('e-active');
|
775
|
+
this.dragSelectedItems.push(item.getAttribute('title'));
|
776
|
+
}
|
777
|
+
else {
|
778
|
+
addClass(selectAll('.e-rowcell', item), ['e-active']);
|
779
|
+
this.dragSelectedItems.push(item.querySelector('.e-drag-text').textContent);
|
780
|
+
}
|
781
|
+
item.querySelector('.e-frame').classList.add('e-check');
|
782
|
+
}
|
783
|
+
}
|
784
|
+
};
|
785
|
+
FileManager.prototype.onLayoutChange = function () {
|
786
|
+
if (this.enableRangeSelection) {
|
787
|
+
this.unWireEvents();
|
788
|
+
this.wireEvents();
|
789
|
+
}
|
790
|
+
};
|
669
791
|
FileManager.prototype.setPath = function () {
|
670
792
|
this.setProperties({ selectedItems: [] }, true);
|
671
793
|
this.ensurePath();
|
@@ -681,7 +803,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
681
803
|
* @private
|
682
804
|
*/
|
683
805
|
/* istanbul ignore next */
|
684
|
-
// eslint:disable-next-line
|
685
806
|
FileManager.prototype.onPropertyChanged = function (newProp, oldProp) {
|
686
807
|
var height;
|
687
808
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
@@ -713,6 +834,12 @@ var FileManager = /** @class */ (function (_super) {
|
|
713
834
|
case 'detailsViewSettings':
|
714
835
|
this.notify(events.modelChanged, { module: 'detailsview', newProp: newProp, oldProp: oldProp });
|
715
836
|
break;
|
837
|
+
case 'enableRangeSelection':
|
838
|
+
this.wireSelectOnDragEvent(false);
|
839
|
+
if (newProp.enableRangeSelection) {
|
840
|
+
this.wireSelectOnDragEvent(true);
|
841
|
+
}
|
842
|
+
break;
|
716
843
|
case 'enableRtl':
|
717
844
|
this.enableRtl = newProp.enableRtl;
|
718
845
|
this.refresh();
|
@@ -770,6 +897,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
770
897
|
this.notify(events.modelChanged, { module: 'largeiconsview', newProp: newProp, oldProp: oldProp });
|
771
898
|
break;
|
772
899
|
case 'toolbarSettings':
|
900
|
+
case 'toolbarItems':
|
773
901
|
this.adjustHeight();
|
774
902
|
this.notify(events.modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
|
775
903
|
break;
|
@@ -792,6 +920,13 @@ var FileManager = /** @class */ (function (_super) {
|
|
792
920
|
refresh(this);
|
793
921
|
this.notify(events.sortByChange, {});
|
794
922
|
break;
|
923
|
+
case 'sortBy':
|
924
|
+
refresh(this);
|
925
|
+
this.notify(events.sortByChange, {});
|
926
|
+
if (this.view === 'Details') {
|
927
|
+
this.notify(events.sortColumn, {});
|
928
|
+
}
|
929
|
+
break;
|
795
930
|
case 'popupTarget':
|
796
931
|
if (this.uploadDialogObj) {
|
797
932
|
this.uploadDialogObj.target = newProp.popupTarget;
|
@@ -806,6 +941,10 @@ var FileManager = /** @class */ (function (_super) {
|
|
806
941
|
this.viewerObj.target = newProp.popupTarget;
|
807
942
|
}
|
808
943
|
break;
|
944
|
+
case 'fileSystemData':
|
945
|
+
this.fileSystemData = newProp.fileSystemData;
|
946
|
+
this.refresh();
|
947
|
+
break;
|
809
948
|
}
|
810
949
|
}
|
811
950
|
};
|
@@ -869,7 +1008,21 @@ var FileManager = /** @class */ (function (_super) {
|
|
869
1008
|
this.addCssClass(this.cssClass, null);
|
870
1009
|
removeClass([this.element], [CLS.RTL, CLS.MOBILE, CLS.CHECK_SELECT]);
|
871
1010
|
this.element.innerHTML = '';
|
1011
|
+
this.breadCrumbBarNavigation = null;
|
1012
|
+
this.activeElements = null;
|
1013
|
+
this.virtualDragElement = null;
|
1014
|
+
this.visitedItem = null;
|
872
1015
|
_super.prototype.destroy.call(this);
|
1016
|
+
this.virtualizationModule = null;
|
1017
|
+
this.navigationpaneModule = null;
|
1018
|
+
this.toolbarModule = null;
|
1019
|
+
this.contextmenuModule = null;
|
1020
|
+
this.largeiconsviewModule = null;
|
1021
|
+
this.detailsviewModule = null;
|
1022
|
+
this.breadcrumbbarModule = null;
|
1023
|
+
this.viewElem = null;
|
1024
|
+
this.dragSelectElement = null;
|
1025
|
+
this.dragSelectedItems = null;
|
873
1026
|
};
|
874
1027
|
/**
|
875
1028
|
* Creates a new folder in file manager.
|
@@ -880,7 +1033,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
880
1033
|
*/
|
881
1034
|
FileManager.prototype.createFolder = function (name) {
|
882
1035
|
this.notify(events.methodCall, { action: 'createFolder' });
|
883
|
-
// eslint-disable-next-line
|
884
1036
|
var details = [getPathObject(this)];
|
885
1037
|
this.itemData = details;
|
886
1038
|
if (name) {
|
@@ -928,7 +1080,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
928
1080
|
* @returns {void}
|
929
1081
|
*/
|
930
1082
|
FileManager.prototype.disableToolbarItems = function (items) {
|
931
|
-
if (!isNOU(items)) {
|
1083
|
+
if (!isNOU(items) && this.toolbarModule) {
|
932
1084
|
this.toolbarModule.enableItems(items, false);
|
933
1085
|
}
|
934
1086
|
};
|
@@ -952,7 +1104,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
952
1104
|
* @returns {void}
|
953
1105
|
*/
|
954
1106
|
FileManager.prototype.enableToolbarItems = function (items) {
|
955
|
-
if (!isNOU(items)) {
|
1107
|
+
if (!isNOU(items) && this.toolbarModule) {
|
956
1108
|
this.toolbarModule.enableItems(items, true);
|
957
1109
|
}
|
958
1110
|
};
|
@@ -1003,7 +1155,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
1003
1155
|
*
|
1004
1156
|
* @returns {void}
|
1005
1157
|
*/
|
1006
|
-
// eslint-disable-next-line
|
1007
1158
|
FileManager.prototype.filterFiles = function (filterData) {
|
1008
1159
|
this.filterData = filterData ? filterData : null;
|
1009
1160
|
this.setProperties({ selectedItems: [] }, true);
|
@@ -1019,7 +1170,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
1019
1170
|
*
|
1020
1171
|
* @returns {Object[]} - returns selected files.
|
1021
1172
|
*/
|
1022
|
-
// eslint-disable-next-line
|
1023
1173
|
FileManager.prototype.getSelectedFiles = function () {
|
1024
1174
|
this.notify(events.updateSelectionData, {});
|
1025
1175
|
return this.itemData;
|
@@ -1061,6 +1211,23 @@ var FileManager = /** @class */ (function (_super) {
|
|
1061
1211
|
FileManager.prototype.selectAll = function () {
|
1062
1212
|
this.notify(events.methodCall, { action: 'selectAll' });
|
1063
1213
|
};
|
1214
|
+
/**
|
1215
|
+
* Specifies the method that must be invoked to traverse the path backwards in the file manager.
|
1216
|
+
*
|
1217
|
+
* @returns {void}
|
1218
|
+
*/
|
1219
|
+
FileManager.prototype.traverseBackward = function () {
|
1220
|
+
if (this.pathNames.length > 1 && this.breadcrumbbarModule.searchObj.element.value === '' && !this.isFiltered) {
|
1221
|
+
this.pathId.pop();
|
1222
|
+
this.pathNames.pop();
|
1223
|
+
var newPath = this.pathNames.slice(1).join('/');
|
1224
|
+
newPath = newPath === '' ? '/' : '/' + newPath + '/';
|
1225
|
+
this.setProperties({ path: newPath }, true);
|
1226
|
+
read(this, events.pathChanged, this.path);
|
1227
|
+
var treeNodeId = this.pathId[this.pathId.length - 1];
|
1228
|
+
this.notify(events.updateTreeSelection, { module: 'treeview', selectedNode: treeNodeId });
|
1229
|
+
}
|
1230
|
+
};
|
1064
1231
|
/**
|
1065
1232
|
* Deselects the currently selected folders and files in current path.
|
1066
1233
|
*
|
@@ -1091,11 +1258,18 @@ var FileManager = /** @class */ (function (_super) {
|
|
1091
1258
|
* @returns {void}
|
1092
1259
|
*/
|
1093
1260
|
FileManager.prototype.uploadFiles = function () {
|
1094
|
-
// eslint-disable-next-line
|
1095
1261
|
var details = [getPathObject(this)];
|
1096
1262
|
this.itemData = details;
|
1097
1263
|
uploadItem(this);
|
1098
1264
|
};
|
1265
|
+
/**
|
1266
|
+
* Specifies the method which must be invoked to programmatically close the dialog popup in the file manager.
|
1267
|
+
*
|
1268
|
+
* @returns {void}
|
1269
|
+
*/
|
1270
|
+
FileManager.prototype.closeDialog = function () {
|
1271
|
+
closePopup(this);
|
1272
|
+
};
|
1099
1273
|
/**
|
1100
1274
|
* Specifies the direction of FileManager
|
1101
1275
|
*
|
@@ -1118,12 +1292,18 @@ var FileManager = /** @class */ (function (_super) {
|
|
1118
1292
|
__decorate([
|
1119
1293
|
Complex({}, AjaxSettings)
|
1120
1294
|
], FileManager.prototype, "ajaxSettings", void 0);
|
1295
|
+
__decorate([
|
1296
|
+
Property([])
|
1297
|
+
], FileManager.prototype, "fileSystemData", void 0);
|
1121
1298
|
__decorate([
|
1122
1299
|
Property(false)
|
1123
1300
|
], FileManager.prototype, "allowDragAndDrop", void 0);
|
1124
1301
|
__decorate([
|
1125
1302
|
Property(true)
|
1126
1303
|
], FileManager.prototype, "allowMultiSelection", void 0);
|
1304
|
+
__decorate([
|
1305
|
+
Property(true)
|
1306
|
+
], FileManager.prototype, "showItemCheckBoxes", void 0);
|
1127
1307
|
__decorate([
|
1128
1308
|
Complex({}, ContextMenuSettings)
|
1129
1309
|
], FileManager.prototype, "contextMenuSettings", void 0);
|
@@ -1139,6 +1319,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
1139
1319
|
__decorate([
|
1140
1320
|
Property(false)
|
1141
1321
|
], FileManager.prototype, "enablePersistence", void 0);
|
1322
|
+
__decorate([
|
1323
|
+
Property(false)
|
1324
|
+
], FileManager.prototype, "enableVirtualization", void 0);
|
1142
1325
|
__decorate([
|
1143
1326
|
Property('400px')
|
1144
1327
|
], FileManager.prototype, "height", void 0);
|
@@ -1175,9 +1358,21 @@ var FileManager = /** @class */ (function (_super) {
|
|
1175
1358
|
__decorate([
|
1176
1359
|
Property('Ascending')
|
1177
1360
|
], FileManager.prototype, "sortOrder", void 0);
|
1361
|
+
__decorate([
|
1362
|
+
Property('name')
|
1363
|
+
], FileManager.prototype, "sortBy", void 0);
|
1364
|
+
__decorate([
|
1365
|
+
Property(null)
|
1366
|
+
], FileManager.prototype, "sortComparer", void 0);
|
1367
|
+
__decorate([
|
1368
|
+
Property(false)
|
1369
|
+
], FileManager.prototype, "enableRangeSelection", void 0);
|
1178
1370
|
__decorate([
|
1179
1371
|
Complex({}, ToolbarSettings)
|
1180
1372
|
], FileManager.prototype, "toolbarSettings", void 0);
|
1373
|
+
__decorate([
|
1374
|
+
Collection([], ToolbarItem)
|
1375
|
+
], FileManager.prototype, "toolbarItems", void 0);
|
1181
1376
|
__decorate([
|
1182
1377
|
Complex({}, UploadSettings)
|
1183
1378
|
], FileManager.prototype, "uploadSettings", void 0);
|
@@ -1208,9 +1403,36 @@ var FileManager = /** @class */ (function (_super) {
|
|
1208
1403
|
__decorate([
|
1209
1404
|
Event()
|
1210
1405
|
], FileManager.prototype, "created", void 0);
|
1406
|
+
__decorate([
|
1407
|
+
Event()
|
1408
|
+
], FileManager.prototype, "beforeFolderCreate", void 0);
|
1409
|
+
__decorate([
|
1410
|
+
Event()
|
1411
|
+
], FileManager.prototype, "folderCreate", void 0);
|
1211
1412
|
__decorate([
|
1212
1413
|
Event()
|
1213
1414
|
], FileManager.prototype, "destroyed", void 0);
|
1415
|
+
__decorate([
|
1416
|
+
Event()
|
1417
|
+
], FileManager.prototype, "beforeDelete", void 0);
|
1418
|
+
__decorate([
|
1419
|
+
Event()
|
1420
|
+
], FileManager.prototype, "delete", void 0);
|
1421
|
+
__decorate([
|
1422
|
+
Event()
|
1423
|
+
], FileManager.prototype, "beforeRename", void 0);
|
1424
|
+
__decorate([
|
1425
|
+
Event()
|
1426
|
+
], FileManager.prototype, "rename", void 0);
|
1427
|
+
__decorate([
|
1428
|
+
Event()
|
1429
|
+
], FileManager.prototype, "beforeMove", void 0);
|
1430
|
+
__decorate([
|
1431
|
+
Event()
|
1432
|
+
], FileManager.prototype, "move", void 0);
|
1433
|
+
__decorate([
|
1434
|
+
Event()
|
1435
|
+
], FileManager.prototype, "search", void 0);
|
1214
1436
|
__decorate([
|
1215
1437
|
Event()
|
1216
1438
|
], FileManager.prototype, "fileDragStart", void 0);
|
@@ -1235,6 +1457,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
1235
1457
|
__decorate([
|
1236
1458
|
Event()
|
1237
1459
|
], FileManager.prototype, "menuOpen", void 0);
|
1460
|
+
__decorate([
|
1461
|
+
Event()
|
1462
|
+
], FileManager.prototype, "menuClose", void 0);
|
1238
1463
|
__decorate([
|
1239
1464
|
Event()
|
1240
1465
|
], FileManager.prototype, "failure", void 0);
|