@syncfusion/ej2-filemanager 20.1.47 → 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 +2353 -659
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +2422 -709
- 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 +129 -17
- 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 +154 -28
- package/src/file-manager/base/file-manager.d.ts +176 -27
- package/src/file-manager/base/file-manager.js +244 -28
- 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 +203 -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/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 +376 -694
- 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 +376 -694
- 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 +20 -15
- 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-definition.scss +20 -16
- 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 +367 -921
- 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 +126 -102
- 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 +376 -694
- 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 +376 -694
- 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 +359 -641
- package/styles/file-manager/fluent-dark.scss +2 -1
- package/styles/file-manager/fluent.css +358 -641
- package/styles/file-manager/fluent.scss +2 -1
- 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/_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/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 +347 -664
- package/styles/file-manager/tailwind-dark.scss +2 -1
- package/styles/file-manager/tailwind.css +347 -664
- 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 +359 -641
- package/styles/fluent-dark.scss +17 -1
- package/styles/fluent-lite.css +1036 -0
- package/styles/fluent-lite.scss +16 -0
- package/styles/fluent.css +358 -641
- package/styles/fluent.scss +17 -1
- 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 +347 -664
- 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 +347 -664
- package/styles/tailwind.scss +17 -1
- package/CHANGELOG.md +0 -404
|
@@ -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,14 +56,13 @@ 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;
|
|
@@ -84,11 +84,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
84
84
|
_this.isOpened = false;
|
|
85
85
|
_this.isRetryOpened = false;
|
|
86
86
|
_this.isPathDrag = false;
|
|
87
|
-
// eslint-disable-next-line
|
|
88
87
|
_this.searchedItems = [];
|
|
89
88
|
_this.retryFiles = [];
|
|
90
89
|
_this.isApplySame = false;
|
|
91
|
-
// eslint-disable-next-line
|
|
92
90
|
_this.dragData = [];
|
|
93
91
|
_this.dragNodes = [];
|
|
94
92
|
_this.dragPath = '';
|
|
@@ -98,10 +96,12 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
98
96
|
_this.dragCursorPosition = { left: 44, top: 18 };
|
|
99
97
|
_this.isDropEnd = false;
|
|
100
98
|
_this.dragCount = 0;
|
|
101
|
-
// eslint-disable-next-line
|
|
102
99
|
_this.droppedObjects = [];
|
|
103
100
|
_this.uploadingCount = 0;
|
|
104
101
|
_this.uploadedCount = 0;
|
|
102
|
+
//Specifies whether the operating system is MAC or not
|
|
103
|
+
_this.isMac = false;
|
|
104
|
+
_this.dragSelectedItems = [];
|
|
105
105
|
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
|
|
106
106
|
return _this;
|
|
107
107
|
}
|
|
@@ -176,25 +176,36 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
176
176
|
if (this.toolbarSettings.visible) {
|
|
177
177
|
modules.push({
|
|
178
178
|
member: 'toolbar',
|
|
179
|
-
args: [this]
|
|
179
|
+
args: [this],
|
|
180
|
+
name: 'Toolbar'
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
if (this.navigationPaneSettings.visible) {
|
|
183
184
|
modules.push({
|
|
184
185
|
member: 'navigationpane',
|
|
185
|
-
args: [this]
|
|
186
|
+
args: [this],
|
|
187
|
+
name: 'NavigationPane'
|
|
186
188
|
});
|
|
187
189
|
}
|
|
188
190
|
if (this.view) {
|
|
189
191
|
modules.push({
|
|
190
192
|
member: 'detailsview',
|
|
191
|
-
args: [this]
|
|
193
|
+
args: [this],
|
|
194
|
+
name: 'DetailsView'
|
|
192
195
|
});
|
|
193
196
|
}
|
|
194
197
|
if (this.contextMenuSettings.visible && !this.isDevice) {
|
|
195
198
|
modules.push({
|
|
196
199
|
member: 'contextmenu',
|
|
197
|
-
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'
|
|
198
209
|
});
|
|
199
210
|
}
|
|
200
211
|
return modules;
|
|
@@ -211,9 +222,13 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
211
222
|
this.allowMultiSelection ? this.selectedItems : this.selectedItems.slice(this.selectedItems.length - 1);
|
|
212
223
|
this.setProperties({ selectedItems: slItems }, true);
|
|
213
224
|
this.fileView = this.view;
|
|
225
|
+
this.isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
|
214
226
|
this.setRtl(this.enableRtl);
|
|
215
227
|
this.addEventListeners();
|
|
216
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
|
+
}
|
|
217
232
|
this.adjustHeight();
|
|
218
233
|
if (isNOU(this.navigationpaneModule)) {
|
|
219
234
|
this.splitterObj.collapse(this.enableRtl ? 1 : 0);
|
|
@@ -417,6 +432,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
417
432
|
minFileSize: this.uploadSettings.minFileSize,
|
|
418
433
|
maxFileSize: this.uploadSettings.maxFileSize,
|
|
419
434
|
allowedExtensions: this.uploadSettings.allowedExtensions,
|
|
435
|
+
directoryUpload: this.uploadSettings.directoryUpload,
|
|
420
436
|
fileListRendering: this.onFileListRender.bind(this)
|
|
421
437
|
});
|
|
422
438
|
this.uploadObj.appendTo('#' + this.element.id + CLS.UPLOAD_ID);
|
|
@@ -429,6 +445,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
429
445
|
this.uploadObj.minFileSize = this.uploadSettings.minFileSize;
|
|
430
446
|
this.uploadObj.maxFileSize = this.uploadSettings.maxFileSize;
|
|
431
447
|
this.uploadObj.allowedExtensions = this.uploadSettings.allowedExtensions;
|
|
448
|
+
this.uploadObj.directoryUpload = this.uploadSettings.directoryUpload;
|
|
432
449
|
this.uploadObj.dataBind();
|
|
433
450
|
};
|
|
434
451
|
FileManager.prototype.onBeforeOpen = function (args) {
|
|
@@ -478,9 +495,8 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
478
495
|
}
|
|
479
496
|
}
|
|
480
497
|
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
|
481
|
-
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }];
|
|
498
|
+
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
|
482
499
|
var uploadUrl = this.ajaxSettings.uploadUrl ? this.ajaxSettings.uploadUrl : this.ajaxSettings.url;
|
|
483
|
-
// eslint-disable-next-line
|
|
484
500
|
var ajaxSettings = {
|
|
485
501
|
url: uploadUrl,
|
|
486
502
|
type: 'POST',
|
|
@@ -496,7 +512,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
496
512
|
this.trigger('beforeSend', this.uploadEventArgs, function (uploadEventArgs) {
|
|
497
513
|
args.customFormData = JSON.parse(getValue('data', uploadEventArgs.ajaxSettings));
|
|
498
514
|
args.cancel = uploadEventArgs.cancel;
|
|
499
|
-
// eslint-disable-next-line
|
|
500
515
|
var eventArgs = {
|
|
501
516
|
cancel: false,
|
|
502
517
|
httpRequest: args.currentRequest
|
|
@@ -533,7 +548,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
533
548
|
}
|
|
534
549
|
this.uploadingCount = args.filesData.length;
|
|
535
550
|
this.uploadedCount = 0;
|
|
536
|
-
// eslint-disable-next-line
|
|
537
551
|
var details = getPathObject(this);
|
|
538
552
|
if (!hasUploadAccess(details)) {
|
|
539
553
|
args.cancel = true;
|
|
@@ -542,7 +556,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
542
556
|
}
|
|
543
557
|
this.uploadDialogObj.show();
|
|
544
558
|
};
|
|
545
|
-
// eslint-disable-next-line
|
|
546
559
|
FileManager.prototype.onFileUploadSuccess = function (args) {
|
|
547
560
|
this.uploadedCount = this.uploadedCount + args.count;
|
|
548
561
|
if (this.uploadSettings.autoClose && (this.uploadingCount === this.uploadedCount)) {
|
|
@@ -550,7 +563,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
550
563
|
}
|
|
551
564
|
};
|
|
552
565
|
/* istanbul ignore next */
|
|
553
|
-
// eslint-disable-next-line
|
|
554
566
|
FileManager.prototype.onUploadSuccess = function (files) {
|
|
555
567
|
var args = { action: 'Upload', result: files };
|
|
556
568
|
this.trigger('success', args);
|
|
@@ -562,9 +574,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
562
574
|
}
|
|
563
575
|
};
|
|
564
576
|
/* istanbul ignore next */
|
|
565
|
-
// eslint-disable-next-line
|
|
566
577
|
FileManager.prototype.onUploadFailure = function (files) {
|
|
567
|
-
// eslint-disable-next-line
|
|
568
578
|
var response = getValue('response', files);
|
|
569
579
|
var statusText = getValue('statusText', response);
|
|
570
580
|
if (statusText !== '') {
|
|
@@ -648,12 +658,40 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
648
658
|
break;
|
|
649
659
|
case 'ctrlU':
|
|
650
660
|
e.preventDefault();
|
|
651
|
-
|
|
652
|
-
|
|
661
|
+
if (this.toolbarSettings.items.indexOf('Upload') !== -1) {
|
|
662
|
+
uploadEle = select('#' + this.element.id + CLS.UPLOAD_ID, this.element);
|
|
663
|
+
uploadEle.click();
|
|
664
|
+
}
|
|
653
665
|
break;
|
|
654
666
|
}
|
|
655
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
|
+
};
|
|
656
691
|
FileManager.prototype.wireEvents = function () {
|
|
692
|
+
if (this.enableRangeSelection) {
|
|
693
|
+
this.wireSelectOnDragEvent(true);
|
|
694
|
+
}
|
|
657
695
|
EventHandler.add(window, 'resize', this.resizeHandler, this);
|
|
658
696
|
this.keyboardModule = new KeyboardEvents(this.element, {
|
|
659
697
|
keyAction: this.keyActionHandler.bind(this),
|
|
@@ -662,9 +700,94 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
662
700
|
});
|
|
663
701
|
};
|
|
664
702
|
FileManager.prototype.unWireEvents = function () {
|
|
703
|
+
this.wireSelectOnDragEvent(false);
|
|
665
704
|
EventHandler.remove(window, 'resize', this.resizeHandler);
|
|
666
705
|
this.keyboardModule.destroy();
|
|
667
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
|
+
};
|
|
668
791
|
FileManager.prototype.setPath = function () {
|
|
669
792
|
this.setProperties({ selectedItems: [] }, true);
|
|
670
793
|
this.ensurePath();
|
|
@@ -680,7 +803,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
680
803
|
* @private
|
|
681
804
|
*/
|
|
682
805
|
/* istanbul ignore next */
|
|
683
|
-
// eslint:disable-next-line
|
|
684
806
|
FileManager.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
685
807
|
var height;
|
|
686
808
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
@@ -712,6 +834,12 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
712
834
|
case 'detailsViewSettings':
|
|
713
835
|
this.notify(events.modelChanged, { module: 'detailsview', newProp: newProp, oldProp: oldProp });
|
|
714
836
|
break;
|
|
837
|
+
case 'enableRangeSelection':
|
|
838
|
+
this.wireSelectOnDragEvent(false);
|
|
839
|
+
if (newProp.enableRangeSelection) {
|
|
840
|
+
this.wireSelectOnDragEvent(true);
|
|
841
|
+
}
|
|
842
|
+
break;
|
|
715
843
|
case 'enableRtl':
|
|
716
844
|
this.enableRtl = newProp.enableRtl;
|
|
717
845
|
this.refresh();
|
|
@@ -769,6 +897,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
769
897
|
this.notify(events.modelChanged, { module: 'largeiconsview', newProp: newProp, oldProp: oldProp });
|
|
770
898
|
break;
|
|
771
899
|
case 'toolbarSettings':
|
|
900
|
+
case 'toolbarItems':
|
|
772
901
|
this.adjustHeight();
|
|
773
902
|
this.notify(events.modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
|
|
774
903
|
break;
|
|
@@ -812,6 +941,10 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
812
941
|
this.viewerObj.target = newProp.popupTarget;
|
|
813
942
|
}
|
|
814
943
|
break;
|
|
944
|
+
case 'fileSystemData':
|
|
945
|
+
this.fileSystemData = newProp.fileSystemData;
|
|
946
|
+
this.refresh();
|
|
947
|
+
break;
|
|
815
948
|
}
|
|
816
949
|
}
|
|
817
950
|
};
|
|
@@ -875,7 +1008,21 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
875
1008
|
this.addCssClass(this.cssClass, null);
|
|
876
1009
|
removeClass([this.element], [CLS.RTL, CLS.MOBILE, CLS.CHECK_SELECT]);
|
|
877
1010
|
this.element.innerHTML = '';
|
|
1011
|
+
this.breadCrumbBarNavigation = null;
|
|
1012
|
+
this.activeElements = null;
|
|
1013
|
+
this.virtualDragElement = null;
|
|
1014
|
+
this.visitedItem = null;
|
|
878
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;
|
|
879
1026
|
};
|
|
880
1027
|
/**
|
|
881
1028
|
* Creates a new folder in file manager.
|
|
@@ -886,7 +1033,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
886
1033
|
*/
|
|
887
1034
|
FileManager.prototype.createFolder = function (name) {
|
|
888
1035
|
this.notify(events.methodCall, { action: 'createFolder' });
|
|
889
|
-
// eslint-disable-next-line
|
|
890
1036
|
var details = [getPathObject(this)];
|
|
891
1037
|
this.itemData = details;
|
|
892
1038
|
if (name) {
|
|
@@ -934,7 +1080,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
934
1080
|
* @returns {void}
|
|
935
1081
|
*/
|
|
936
1082
|
FileManager.prototype.disableToolbarItems = function (items) {
|
|
937
|
-
if (!isNOU(items)) {
|
|
1083
|
+
if (!isNOU(items) && this.toolbarModule) {
|
|
938
1084
|
this.toolbarModule.enableItems(items, false);
|
|
939
1085
|
}
|
|
940
1086
|
};
|
|
@@ -958,7 +1104,7 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
958
1104
|
* @returns {void}
|
|
959
1105
|
*/
|
|
960
1106
|
FileManager.prototype.enableToolbarItems = function (items) {
|
|
961
|
-
if (!isNOU(items)) {
|
|
1107
|
+
if (!isNOU(items) && this.toolbarModule) {
|
|
962
1108
|
this.toolbarModule.enableItems(items, true);
|
|
963
1109
|
}
|
|
964
1110
|
};
|
|
@@ -1009,7 +1155,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1009
1155
|
*
|
|
1010
1156
|
* @returns {void}
|
|
1011
1157
|
*/
|
|
1012
|
-
// eslint-disable-next-line
|
|
1013
1158
|
FileManager.prototype.filterFiles = function (filterData) {
|
|
1014
1159
|
this.filterData = filterData ? filterData : null;
|
|
1015
1160
|
this.setProperties({ selectedItems: [] }, true);
|
|
@@ -1025,7 +1170,6 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1025
1170
|
*
|
|
1026
1171
|
* @returns {Object[]} - returns selected files.
|
|
1027
1172
|
*/
|
|
1028
|
-
// eslint-disable-next-line
|
|
1029
1173
|
FileManager.prototype.getSelectedFiles = function () {
|
|
1030
1174
|
this.notify(events.updateSelectionData, {});
|
|
1031
1175
|
return this.itemData;
|
|
@@ -1067,6 +1211,23 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1067
1211
|
FileManager.prototype.selectAll = function () {
|
|
1068
1212
|
this.notify(events.methodCall, { action: 'selectAll' });
|
|
1069
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
|
+
};
|
|
1070
1231
|
/**
|
|
1071
1232
|
* Deselects the currently selected folders and files in current path.
|
|
1072
1233
|
*
|
|
@@ -1097,11 +1258,18 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1097
1258
|
* @returns {void}
|
|
1098
1259
|
*/
|
|
1099
1260
|
FileManager.prototype.uploadFiles = function () {
|
|
1100
|
-
// eslint-disable-next-line
|
|
1101
1261
|
var details = [getPathObject(this)];
|
|
1102
1262
|
this.itemData = details;
|
|
1103
1263
|
uploadItem(this);
|
|
1104
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
|
+
};
|
|
1105
1273
|
/**
|
|
1106
1274
|
* Specifies the direction of FileManager
|
|
1107
1275
|
*
|
|
@@ -1124,12 +1292,18 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1124
1292
|
__decorate([
|
|
1125
1293
|
Complex({}, AjaxSettings)
|
|
1126
1294
|
], FileManager.prototype, "ajaxSettings", void 0);
|
|
1295
|
+
__decorate([
|
|
1296
|
+
Property([])
|
|
1297
|
+
], FileManager.prototype, "fileSystemData", void 0);
|
|
1127
1298
|
__decorate([
|
|
1128
1299
|
Property(false)
|
|
1129
1300
|
], FileManager.prototype, "allowDragAndDrop", void 0);
|
|
1130
1301
|
__decorate([
|
|
1131
1302
|
Property(true)
|
|
1132
1303
|
], FileManager.prototype, "allowMultiSelection", void 0);
|
|
1304
|
+
__decorate([
|
|
1305
|
+
Property(true)
|
|
1306
|
+
], FileManager.prototype, "showItemCheckBoxes", void 0);
|
|
1133
1307
|
__decorate([
|
|
1134
1308
|
Complex({}, ContextMenuSettings)
|
|
1135
1309
|
], FileManager.prototype, "contextMenuSettings", void 0);
|
|
@@ -1145,6 +1319,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1145
1319
|
__decorate([
|
|
1146
1320
|
Property(false)
|
|
1147
1321
|
], FileManager.prototype, "enablePersistence", void 0);
|
|
1322
|
+
__decorate([
|
|
1323
|
+
Property(false)
|
|
1324
|
+
], FileManager.prototype, "enableVirtualization", void 0);
|
|
1148
1325
|
__decorate([
|
|
1149
1326
|
Property('400px')
|
|
1150
1327
|
], FileManager.prototype, "height", void 0);
|
|
@@ -1184,9 +1361,18 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1184
1361
|
__decorate([
|
|
1185
1362
|
Property('name')
|
|
1186
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);
|
|
1187
1370
|
__decorate([
|
|
1188
1371
|
Complex({}, ToolbarSettings)
|
|
1189
1372
|
], FileManager.prototype, "toolbarSettings", void 0);
|
|
1373
|
+
__decorate([
|
|
1374
|
+
Collection([], ToolbarItem)
|
|
1375
|
+
], FileManager.prototype, "toolbarItems", void 0);
|
|
1190
1376
|
__decorate([
|
|
1191
1377
|
Complex({}, UploadSettings)
|
|
1192
1378
|
], FileManager.prototype, "uploadSettings", void 0);
|
|
@@ -1217,9 +1403,36 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1217
1403
|
__decorate([
|
|
1218
1404
|
Event()
|
|
1219
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);
|
|
1220
1412
|
__decorate([
|
|
1221
1413
|
Event()
|
|
1222
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);
|
|
1223
1436
|
__decorate([
|
|
1224
1437
|
Event()
|
|
1225
1438
|
], FileManager.prototype, "fileDragStart", void 0);
|
|
@@ -1244,6 +1457,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
|
1244
1457
|
__decorate([
|
|
1245
1458
|
Event()
|
|
1246
1459
|
], FileManager.prototype, "menuOpen", void 0);
|
|
1460
|
+
__decorate([
|
|
1461
|
+
Event()
|
|
1462
|
+
], FileManager.prototype, "menuClose", void 0);
|
|
1247
1463
|
__decorate([
|
|
1248
1464
|
Event()
|
|
1249
1465
|
], FileManager.prototype, "failure", void 0);
|