@syncfusion/ej2-filemanager 27.2.5 → 28.1.36
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/README.md +2 -2
- package/dist/ej2-filemanager.min.js +1 -10
- 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 +134 -28
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +142 -36
- 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/package.json +16 -17
- package/src/file-manager/base/file-manager-model.d.ts +2 -1
- package/src/file-manager/base/file-manager.d.ts +4 -1
- package/src/file-manager/base/file-manager.js +39 -4
- package/src/file-manager/common/operations.js +44 -15
- package/src/file-manager/common/utility.d.ts +9 -0
- package/src/file-manager/common/utility.js +19 -3
- package/src/file-manager/layout/details-view.js +10 -0
- package/src/file-manager/layout/large-icons-view.js +7 -5
- package/src/file-manager/layout/navigation-pane.js +9 -5
- package/src/file-manager/models/upload-settings-model.d.ts +9 -0
- package/src/file-manager/models/upload-settings.d.ts +8 -0
- package/src/file-manager/models/upload-settings.js +3 -0
- package/src/file-manager/pop-up/context-menu.d.ts +1 -0
- package/src/file-manager/pop-up/context-menu.js +4 -3
- package/src/file-manager/pop-up/dialog.js +8 -2
- package/styles/bds-lite.css +1284 -0
- package/styles/bds-lite.scss +16 -0
- package/styles/bds.css +1876 -0
- package/styles/bds.scss +17 -0
- package/styles/file-manager/_bigger.scss +69 -6
- package/styles/file-manager/_fluent2-definition.scss +1 -1
- package/styles/file-manager/_layout.scss +77 -14
- package/styles/file-manager/_material3-definition.scss +2 -2
- package/styles/file-manager/_tailwind3-definition.scss +243 -0
- package/styles/file-manager/_theme.scss +4 -1
- package/styles/file-manager/bds.css +1876 -0
- package/styles/file-manager/bds.scss +17 -0
- package/styles/file-manager/fluent2.css +2 -2
- package/styles/file-manager/icons/_tailwind3.scss +235 -0
- package/styles/file-manager/material3-dark.css +3 -2
- package/styles/file-manager/material3.css +3 -2
- package/styles/file-manager/tailwind3.css +1666 -0
- package/styles/file-manager/tailwind3.scss +17 -0
- package/styles/fluent2.css +2 -2
- package/styles/material3-dark.css +3 -2
- package/styles/material3.css +3 -2
- package/styles/tailwind3-lite.css +1069 -0
- package/styles/tailwind3-lite.scss +16 -0
- package/styles/tailwind3.css +1666 -0
- package/styles/tailwind3.scss +17 -0
package/dist/global/index.d.ts
CHANGED
@@ -1,12 +1,3 @@
|
|
1
|
-
/*!
|
2
|
-
* filename: index.d.ts
|
3
|
-
* version : 27.2.5
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
5
|
-
* Use of this code is subject to the terms of our license.
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
8
|
-
* applicable laws.
|
9
|
-
*/
|
10
1
|
import * as _filemanager from '@syncfusion/ej2-filemanager';
|
11
2
|
|
12
3
|
export declare namespace ej {
|
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"_from": "@syncfusion/ej2-filemanager@*",
|
3
|
-
"_id": "@syncfusion/ej2-filemanager@
|
3
|
+
"_id": "@syncfusion/ej2-filemanager@28.1.33",
|
4
4
|
"_inBundle": false,
|
5
|
-
"_integrity": "sha512-
|
5
|
+
"_integrity": "sha512-YC0/Yxh34dCNbHhc8GlueONPkYBzkK//zTCOIplztS/ThVIs8lbp+5G5jCTdDG6VdCHiexPwUTV5uneKFWDNDQ==",
|
6
6
|
"_location": "/@syncfusion/ej2-filemanager",
|
7
7
|
"_phantomChildren": {},
|
8
8
|
"_requested": {
|
@@ -18,16 +18,15 @@
|
|
18
18
|
},
|
19
19
|
"_requiredBy": [
|
20
20
|
"/",
|
21
|
-
"/@syncfusion/ej2",
|
22
21
|
"/@syncfusion/ej2-angular-filemanager",
|
23
22
|
"/@syncfusion/ej2-react-filemanager",
|
24
23
|
"/@syncfusion/ej2-richtexteditor",
|
25
24
|
"/@syncfusion/ej2-vue-filemanager"
|
26
25
|
],
|
27
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-filemanager/-/ej2-filemanager-
|
28
|
-
"_shasum": "
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-filemanager/-/ej2-filemanager-28.1.33.tgz",
|
27
|
+
"_shasum": "2067fc573960580b9fa858834b89558ff39edf13",
|
29
28
|
"_spec": "@syncfusion/ej2-filemanager@*",
|
30
|
-
"_where": "/jenkins/workspace/elease-
|
29
|
+
"_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
|
31
30
|
"author": {
|
32
31
|
"name": "Syncfusion Inc."
|
33
32
|
},
|
@@ -36,16 +35,16 @@
|
|
36
35
|
},
|
37
36
|
"bundleDependencies": false,
|
38
37
|
"dependencies": {
|
39
|
-
"@syncfusion/ej2-base": "~
|
40
|
-
"@syncfusion/ej2-buttons": "~
|
41
|
-
"@syncfusion/ej2-data": "~
|
42
|
-
"@syncfusion/ej2-grids": "~
|
43
|
-
"@syncfusion/ej2-inputs": "~
|
44
|
-
"@syncfusion/ej2-layouts": "~
|
45
|
-
"@syncfusion/ej2-lists": "~
|
46
|
-
"@syncfusion/ej2-navigations": "~
|
47
|
-
"@syncfusion/ej2-popups": "~
|
48
|
-
"@syncfusion/ej2-splitbuttons": "~
|
38
|
+
"@syncfusion/ej2-base": "~28.1.33",
|
39
|
+
"@syncfusion/ej2-buttons": "~28.1.36",
|
40
|
+
"@syncfusion/ej2-data": "~28.1.33",
|
41
|
+
"@syncfusion/ej2-grids": "~28.1.36",
|
42
|
+
"@syncfusion/ej2-inputs": "~28.1.33",
|
43
|
+
"@syncfusion/ej2-layouts": "~28.1.33",
|
44
|
+
"@syncfusion/ej2-lists": "~28.1.33",
|
45
|
+
"@syncfusion/ej2-navigations": "~28.1.36",
|
46
|
+
"@syncfusion/ej2-popups": "~28.1.33",
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~28.1.33"
|
49
48
|
},
|
50
49
|
"deprecated": false,
|
51
50
|
"description": "Essential JS 2 FileManager Component",
|
@@ -75,6 +74,6 @@
|
|
75
74
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
76
75
|
},
|
77
76
|
"typings": "index.d.ts",
|
78
|
-
"version": "
|
77
|
+
"version": "28.1.36",
|
79
78
|
"sideEffects": false
|
80
79
|
}
|
@@ -184,7 +184,8 @@ export interface FileManagerModel extends ComponentModel{
|
|
184
184
|
rootAliasName?: string;
|
185
185
|
|
186
186
|
/**
|
187
|
-
*
|
187
|
+
* Determines whether to show or hide hidden files and folders.
|
188
|
+
* 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.
|
188
189
|
*
|
189
190
|
* @default false
|
190
191
|
*/
|
@@ -318,7 +318,8 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
|
|
318
318
|
*/
|
319
319
|
rootAliasName: string;
|
320
320
|
/**
|
321
|
-
*
|
321
|
+
* Determines whether to show or hide hidden files and folders.
|
322
|
+
* 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.
|
322
323
|
*
|
323
324
|
* @default false
|
324
325
|
*/
|
@@ -660,12 +661,14 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
|
|
660
661
|
private onBeforeClose;
|
661
662
|
private onOpen;
|
662
663
|
private onClose;
|
664
|
+
private onChunkUploading;
|
663
665
|
private onUploading;
|
664
666
|
private onRemoving;
|
665
667
|
private onCancel;
|
666
668
|
private onClearing;
|
667
669
|
private onSelected;
|
668
670
|
private onFileUploadSuccess;
|
671
|
+
private onChunkUploadComplete;
|
669
672
|
private onUploadSuccess;
|
670
673
|
private onUploadFailure;
|
671
674
|
private onInitialEnd;
|
@@ -417,11 +417,14 @@ var FileManager = /** @class */ (function (_super) {
|
|
417
417
|
dropArea: select('#' + this.element.id + CLS.CONTENT_ID, this.element),
|
418
418
|
asyncSettings: {
|
419
419
|
saveUrl: uploadUrl,
|
420
|
-
removeUrl: uploadUrl
|
420
|
+
removeUrl: uploadUrl,
|
421
|
+
chunkSize: this.uploadSettings.chunkSize,
|
422
|
+
retryCount: 0
|
421
423
|
},
|
422
424
|
locale: this.locale,
|
423
425
|
enableRtl: this.enableRtl,
|
424
426
|
uploading: this.onUploading.bind(this),
|
427
|
+
chunkUploading: this.onChunkUploading.bind(this),
|
425
428
|
removing: this.onRemoving.bind(this),
|
426
429
|
canceling: this.onCancel.bind(this),
|
427
430
|
clearing: this.onClearing.bind(this),
|
@@ -483,19 +486,34 @@ var FileManager = /** @class */ (function (_super) {
|
|
483
486
|
this.trigger('popupClose', args);
|
484
487
|
};
|
485
488
|
/* istanbul ignore next */
|
489
|
+
FileManager.prototype.onChunkUploading = function (args) {
|
490
|
+
var action = 'save';
|
491
|
+
if ((this.retryArgs.length !== 0)) {
|
492
|
+
for (var i = 0; i < this.retryArgs.length; i++) {
|
493
|
+
if (args.fileData.name === this.retryArgs[i].file.name) {
|
494
|
+
action = this.retryArgs[i].action;
|
495
|
+
}
|
496
|
+
}
|
497
|
+
}
|
498
|
+
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
499
|
+
args.customFormData = [{ 'path': this.path }, { 'size': args.fileData.size }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
500
|
+
};
|
501
|
+
/* istanbul ignore next */
|
486
502
|
FileManager.prototype.onUploading = function (args) {
|
487
503
|
var action = 'save';
|
488
504
|
if ((this.retryArgs.length !== 0)) {
|
489
505
|
for (var i = 0; i < this.retryArgs.length; i++) {
|
490
506
|
if (args.fileData.name === this.retryArgs[i].file.name) {
|
491
507
|
action = this.retryArgs[i].action;
|
492
|
-
this.
|
493
|
-
|
508
|
+
if (this.uploadSettings.chunkSize === 0) {
|
509
|
+
this.retryArgs.splice(i, 1);
|
510
|
+
i = this.retryArgs.length;
|
511
|
+
}
|
494
512
|
}
|
495
513
|
}
|
496
514
|
}
|
497
515
|
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
498
|
-
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
516
|
+
args.customFormData = [{ 'path': this.path }, { 'size': args.fileData.size }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
499
517
|
var uploadUrl = this.ajaxSettings.uploadUrl ? this.ajaxSettings.uploadUrl : this.ajaxSettings.url;
|
500
518
|
var ajaxSettings = {
|
501
519
|
url: uploadUrl,
|
@@ -562,8 +580,22 @@ var FileManager = /** @class */ (function (_super) {
|
|
562
580
|
this.uploadDialogObj.hide();
|
563
581
|
}
|
564
582
|
};
|
583
|
+
FileManager.prototype.onChunkUploadComplete = function (files) {
|
584
|
+
if ((this.retryArgs.length !== 0)) {
|
585
|
+
for (var i = 0; i < this.retryArgs.length; i++) {
|
586
|
+
var uploadFile = !isNullOrUndefined(files) ? getValue('file', files).name : '';
|
587
|
+
if (uploadFile === this.retryArgs[i].file.name) {
|
588
|
+
this.retryArgs.splice(i, 1);
|
589
|
+
i = this.retryArgs.length;
|
590
|
+
}
|
591
|
+
}
|
592
|
+
}
|
593
|
+
};
|
565
594
|
/* istanbul ignore next */
|
566
595
|
FileManager.prototype.onUploadSuccess = function (files) {
|
596
|
+
if (this.uploadSettings.chunkSize > 0) {
|
597
|
+
this.onChunkUploadComplete(files);
|
598
|
+
}
|
567
599
|
var args = { action: 'Upload', result: files };
|
568
600
|
this.trigger('success', args);
|
569
601
|
this.itemData = [getValue(this.pathId[this.pathId.length - 1], this.feParent)];
|
@@ -575,6 +607,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
575
607
|
};
|
576
608
|
/* istanbul ignore next */
|
577
609
|
FileManager.prototype.onUploadFailure = function (files) {
|
610
|
+
if (this.uploadSettings.chunkSize > 0) {
|
611
|
+
this.onChunkUploadComplete(files);
|
612
|
+
}
|
578
613
|
var response = getValue('response', files);
|
579
614
|
var statusText = getValue('statusText', response);
|
580
615
|
if (statusText !== '') {
|
@@ -3,7 +3,7 @@ import { isNullOrUndefined as isNOU, setValue, getValue } from '@syncfusion/ej2-
|
|
3
3
|
import * as events from '../base/constant';
|
4
4
|
import { createDialog, createExtDialog } from '../pop-up/dialog';
|
5
5
|
import { fileType, setNodeId, getLocaleText, setDateObject, doPasteUpdate, getPathObject } from '../common/utility';
|
6
|
-
import { generatePath, getAccessDetails } from '../common/utility';
|
6
|
+
import { generatePath, getAccessDetails, getTargetPath } from '../common/utility';
|
7
7
|
import { getUid } from '@syncfusion/ej2-grids';
|
8
8
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9
9
|
/**
|
@@ -236,7 +236,7 @@ function createNewItem(data, target, itemName, isCopy) {
|
|
236
236
|
}
|
237
237
|
}
|
238
238
|
var currentDate = new Date();
|
239
|
-
var folderPath = target.id !== 0 ? target.filterPath + target.name : '\\';
|
239
|
+
var folderPath = String(target.id) !== String(0) && !isNOU(target.parentId) ? target.filterPath + target.name + '\\' : '\\';
|
240
240
|
Object.assign(newItem, {
|
241
241
|
dateCreated: currentDate,
|
242
242
|
dateModified: currentDate,
|
@@ -370,7 +370,9 @@ function triggerRenameOperation(parent, data, eventArgs) {
|
|
370
370
|
if (isFileSystemData(parent)) {
|
371
371
|
if (!isFileExists(parent.fileSystemData, args.newName)) {
|
372
372
|
var fileData = filterById(parent, args.itemData[0].id);
|
373
|
+
var oldName = fileData.name;
|
373
374
|
fileData.name = args.newName;
|
375
|
+
updateChildrenFilterPath(parent, fileData.id, oldName, args.newName);
|
374
376
|
}
|
375
377
|
else {
|
376
378
|
var message = 'Cannot rename' + args.itemData[0].name + 'to' + args.newName + ': destination already exists.';
|
@@ -379,6 +381,26 @@ function triggerRenameOperation(parent, data, eventArgs) {
|
|
379
381
|
}
|
380
382
|
});
|
381
383
|
}
|
384
|
+
/**
|
385
|
+
* Function to update child item filter path.
|
386
|
+
*
|
387
|
+
* @param {IFileManager} parent - specifies the parent element.
|
388
|
+
* @param {string | number} parentId - specifies the parent id.
|
389
|
+
* @param {string} oldName - specifies the previous name.
|
390
|
+
* @param {string} newName - specifies the new name.
|
391
|
+
* @returns {void}
|
392
|
+
* @private
|
393
|
+
*/
|
394
|
+
function updateChildrenFilterPath(parent, parentId, oldName, newName) {
|
395
|
+
parent.fileSystemData.forEach(function (item) {
|
396
|
+
if (String(item.parentId) === String(parentId)) {
|
397
|
+
var oldPath = item.filterPath;
|
398
|
+
var newPath = oldPath.replace(oldName + '\\', newName + '\\');
|
399
|
+
item.filterPath = newPath;
|
400
|
+
updateChildrenFilterPath(parent, item.id, oldName, newName);
|
401
|
+
}
|
402
|
+
});
|
403
|
+
}
|
382
404
|
/**
|
383
405
|
* Function to trigger move or copy operation.
|
384
406
|
*
|
@@ -434,18 +456,23 @@ function triggerMoveOrCopyOperation(parent, data, eventArgs) {
|
|
434
456
|
}
|
435
457
|
return;
|
436
458
|
}
|
437
|
-
var
|
438
|
-
var getTargetFiles = filterByParent(parent,
|
459
|
+
var target_1 = args.targetData;
|
460
|
+
var getTargetFiles = filterByParent(parent, target_1.id);
|
439
461
|
for (var i = 0; i < args.itemData.length; i++) {
|
440
462
|
var currItem = args.itemData[i];
|
441
463
|
if (!isFileExists(getTargetFiles, currItem.name) || getValue('renameFiles', data).length > 0) {
|
442
|
-
if (!
|
443
|
-
|
464
|
+
if (!target_1.hasChild) {
|
465
|
+
target_1.hasChild = !currItem.isFile;
|
466
|
+
var targetItem = parent.fileSystemData
|
467
|
+
.filter(function (item) { return String(item.id) === String(target_1.id); });
|
468
|
+
if (targetItem.length > 0) {
|
469
|
+
targetItem[0].hasChild = target_1.hasChild;
|
470
|
+
}
|
444
471
|
}
|
445
472
|
if (!currItem.isFile) {
|
446
473
|
//Check whether the source folder include other sub folders or not.
|
447
474
|
var subItems = currItem.parentId !== 0
|
448
|
-
? filterByParent(parent, currItem.
|
475
|
+
? filterByParent(parent, currItem.parentId) : [];
|
449
476
|
var itemData = filterById(parent, currItem.parentId);
|
450
477
|
itemData.hasChild = subItems.length > 1 ? true : false;
|
451
478
|
}
|
@@ -456,13 +483,13 @@ function triggerMoveOrCopyOperation(parent, data, eventArgs) {
|
|
456
483
|
fileData.name = currItem.name;
|
457
484
|
parent.responseData.error = null;
|
458
485
|
parent.existingFileCount++;
|
459
|
-
parent.dropData =
|
486
|
+
parent.dropData = target_1;
|
460
487
|
parent.dropPath = args.path;
|
461
488
|
var pathArray = args.targetPath.replace(/^\/|\/$/g, '').split('/');
|
462
|
-
|
489
|
+
target_1 = filterById(parent, pathArray[pathArray.length - 1]);
|
463
490
|
}
|
464
|
-
fileData.parentId =
|
465
|
-
fileData.filterPath =
|
491
|
+
fileData.parentId = target_1.id;
|
492
|
+
fileData.filterPath = target_1.id === 0 ? '\\' : target_1.filterPath + target_1.name + '\\';
|
466
493
|
}
|
467
494
|
else {
|
468
495
|
file_1.push(currItem.name);
|
@@ -568,7 +595,6 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
|
|
568
595
|
? getValue('path', data) : parent.path;
|
569
596
|
var pathArray = filePath.replace(/^\/|\/$/g, '').split('/');
|
570
597
|
var idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length !== 0 && isNOU(parent.renamedItem))
|
571
|
-
|| (event === 'paste-end' && (parent.targetModule === 'largeiconsview' || parent.targetModule === 'detailsview'))
|
572
598
|
? getValue('data', data)[0].id : pathArray[pathArray.length - 1];
|
573
599
|
var action = getValue('action', data);
|
574
600
|
var isFileOperation = (action === 'move' || action === 'rename' || action === 'copy' || action === 'delete' || action === 'search') && event !== 'rename-end';
|
@@ -613,9 +639,9 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
|
|
613
639
|
var isMultipleFiles = itemData.length > 1;
|
614
640
|
var itemNames = itemData.map(function (item) { return item.name; });
|
615
641
|
var totalSize = isMultipleFiles ? getSize(itemData.reduce(function (accumulator, currentObject) { return accumulator + (currentObject.size || 0); }, 0)) : getSize(details.size);
|
616
|
-
var path = (parent.pathNames.includes(details.name) ? parent.pathNames.join('/') : parent.pathNames.join('/') + '/' + details.name);
|
642
|
+
var path = (parent.pathNames.includes(details.name) || isMultipleFiles ? parent.pathNames.join('/') : parent.pathNames.join('/') + '/' + details.name);
|
617
643
|
parent.responseData.details = Object.assign({
|
618
|
-
location:
|
644
|
+
location: path,
|
619
645
|
multipleFiles: isMultipleFiles,
|
620
646
|
name: itemNames.join(', '),
|
621
647
|
size: totalSize
|
@@ -744,6 +770,8 @@ function performReadOperation(parent, result, fn, data, event, operation, target
|
|
744
770
|
if ((getValue('path', data) === '/') || (parent.hasId && getValue('path', data).match(/[/]/g).length === 1)) {
|
745
771
|
if (getValue('names', data).length === 0) {
|
746
772
|
setValue('name', rootName, result.details);
|
773
|
+
}
|
774
|
+
if (location_1.indexOf('\\') === -1) {
|
747
775
|
location_1 = rootName;
|
748
776
|
}
|
749
777
|
else {
|
@@ -962,7 +990,8 @@ function renameSuccess(parent, result) {
|
|
962
990
|
var pathLevel = parent.pathId[parent.pathId.length - 1].split('_').length - 2;
|
963
991
|
parent.pathId.pop();
|
964
992
|
parent.itemData = [getValue(parent.pathId[parent.pathId.length - 1], parent.feParent)];
|
965
|
-
|
993
|
+
var renamePath = getTargetPath(parent, parent.renamedItem);
|
994
|
+
read(parent, events.renameEndParent, renamePath);
|
966
995
|
if (!isNOU(pathObject) && parent.pathNames.length > 1 && pathLevel <= parent.pathNames.length - 1) {
|
967
996
|
parent.pathNames[pathLevel] = parent.renameText;
|
968
997
|
if (!parent.hasId) {
|
@@ -624,6 +624,15 @@ export declare function uploadItem(parent: IFileManager): void;
|
|
624
624
|
* @private
|
625
625
|
*/
|
626
626
|
export declare function closePopup(parent: IFileManager): void;
|
627
|
+
/**
|
628
|
+
* Get target path from item data.
|
629
|
+
*
|
630
|
+
* @param {IFileManager} parent - specifies the parent.
|
631
|
+
* @param {Object} itemData - specifies the item elements.
|
632
|
+
* @returns {string} returns the path.
|
633
|
+
* @private
|
634
|
+
*/
|
635
|
+
export declare function getTargetPath(parent: IFileManager, itemData: Object): string;
|
627
636
|
/**
|
628
637
|
* Access control handler
|
629
638
|
*
|
@@ -902,7 +902,7 @@ export function pasteHandler(parent) {
|
|
902
902
|
if (parent.selectedNodes.length !== 0 && parent.enablePaste) {
|
903
903
|
var path = (parent.folderPath === '') ? parent.path : parent.folderPath;
|
904
904
|
if (parent.activeModule === 'navigationpane' && !parent.selectedNodes[0].includes('/')) {
|
905
|
-
parent.targetPath =
|
905
|
+
parent.targetPath = getTargetPath(parent, parent.actionRecords[0]);
|
906
906
|
}
|
907
907
|
var subFolder = validateSubFolder(parent, parent.actionRecords, path, parent.path);
|
908
908
|
if (!subFolder) {
|
@@ -1032,9 +1032,9 @@ export function getDirectoryPath(parent, args) {
|
|
1032
1032
|
var fPath = getValue(parent.hasId && !isNullOrUndefined(parent.ajaxSettings.url) ? 'filterId' : 'filterPath', args.cwd);
|
1033
1033
|
if (!isNOU(fPath)) {
|
1034
1034
|
if (fPath === '') {
|
1035
|
-
return
|
1035
|
+
return '/';
|
1036
1036
|
}
|
1037
|
-
return fPath.replace(/\\/g, '/') + filePath;
|
1037
|
+
return fPath.replace(/\\/g, '/').replace(/^.*?(?=\/)/, '') + filePath;
|
1038
1038
|
}
|
1039
1039
|
else {
|
1040
1040
|
return isFileSystemData(parent) ? filePath : parent.path + filePath;
|
@@ -1643,6 +1643,22 @@ export function closePopup(parent) {
|
|
1643
1643
|
parent.dialogObj.hide();
|
1644
1644
|
}
|
1645
1645
|
}
|
1646
|
+
/**
|
1647
|
+
* Get target path from item data.
|
1648
|
+
*
|
1649
|
+
* @param {IFileManager} parent - specifies the parent.
|
1650
|
+
* @param {Object} itemData - specifies the item elements.
|
1651
|
+
* @returns {string} returns the path.
|
1652
|
+
* @private
|
1653
|
+
*/
|
1654
|
+
export function getTargetPath(parent, itemData) {
|
1655
|
+
if (parent.hasId && !isNOU(getValue('filterId', itemData))) {
|
1656
|
+
return getValue('filterId', itemData).replace(/\\/g, '/').replace(/^[^/]+\//, '/');
|
1657
|
+
}
|
1658
|
+
else {
|
1659
|
+
return getValue('filterPath', itemData).replace(/\\/g, '/');
|
1660
|
+
}
|
1661
|
+
}
|
1646
1662
|
/**
|
1647
1663
|
* Access control handler
|
1648
1664
|
*
|
@@ -88,6 +88,16 @@ var DetailsView = /** @class */ (function () {
|
|
88
88
|
/* istanbul ignore next */
|
89
89
|
DetailsView.prototype.render = function (args) {
|
90
90
|
var _this = this;
|
91
|
+
if (this.parent.enablePersistence) {
|
92
|
+
var gridPersistenceValue = window.localStorage.getItem('grid' + this.parent.element.id + '_grid');
|
93
|
+
if (!isNOU(gridPersistenceValue)) {
|
94
|
+
var model = JSON.parse(gridPersistenceValue);
|
95
|
+
if (!isNOU(model) && Object.keys(model).length > 0 && 'sortSettings' in model) {
|
96
|
+
delete model.sortSettings;
|
97
|
+
window.localStorage.setItem('grid' + this.parent.element.id + '_grid', JSON.stringify(model));
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
91
101
|
showSpinner(this.parent.element);
|
92
102
|
if (this.parent.view === 'Details') {
|
93
103
|
removeClass([this.parent.element], CLS.MULTI_SELECT);
|
@@ -766,31 +766,33 @@ var LargeIconsView = /** @class */ (function () {
|
|
766
766
|
* @hidden
|
767
767
|
*/
|
768
768
|
LargeIconsView.prototype.doSelection = function (target, e) {
|
769
|
+
var ctrlKey = this.parent.isMac ? e.metaKey : e.ctrlKey;
|
770
|
+
var isMacRightClick = this.parent.isMac && e.ctrlKey && e.shiftKey;
|
769
771
|
var item = closest(target, '.' + CLS.LIST_ITEM);
|
770
772
|
var cList = target.classList;
|
771
773
|
this.parent.isFile = false;
|
772
774
|
var action = 'select';
|
773
|
-
if (e.which === 3 && !isNOU(item) && item.classList.contains(CLS.ACTIVE)) {
|
775
|
+
if ((e.which === 3 || isMacRightClick) && !isNOU(item) && item.classList.contains(CLS.ACTIVE)) {
|
774
776
|
this.addActive(item);
|
775
777
|
this.updateType(item);
|
776
778
|
return;
|
777
779
|
}
|
778
780
|
else if (!isNOU(item)) {
|
779
781
|
if (this.parent.allowMultiSelection && item.classList.contains(CLS.ACTIVE)
|
780
|
-
&& (
|
782
|
+
&& (ctrlKey || target.classList.contains(CLS.CHECK))) {
|
781
783
|
action = 'unselect';
|
782
784
|
}
|
783
|
-
if (e.ctrlKey && e.shiftKey) {
|
785
|
+
if (e.ctrlKey && e.shiftKey && !isMacRightClick) {
|
784
786
|
this.isSelectAllCalled = true;
|
785
787
|
}
|
786
788
|
var fileSelectionArgs = this.triggerSelection(action, item);
|
787
789
|
if (fileSelectionArgs.cancel !== true) {
|
788
|
-
if ((!this.parent.allowMultiSelection || (!this.multiSelect && (e && !
|
790
|
+
if ((!this.parent.allowMultiSelection || (!this.multiSelect && (e && !ctrlKey)))
|
789
791
|
&& !cList.contains(CLS.FRAME)) {
|
790
792
|
this.updateType(item);
|
791
793
|
this.clearSelect();
|
792
794
|
}
|
793
|
-
if (this.parent.allowMultiSelection && e.shiftKey) {
|
795
|
+
if (this.parent.allowMultiSelection && e.shiftKey && !isMacRightClick) {
|
794
796
|
if (!(e && e.ctrlKey)) {
|
795
797
|
this.clearSelect();
|
796
798
|
}
|
@@ -521,6 +521,15 @@ var NavigationPane = /** @class */ (function () {
|
|
521
521
|
this.removeChildNodes(e.selectedNode);
|
522
522
|
};
|
523
523
|
NavigationPane.prototype.onDragEnd = function (args) {
|
524
|
+
if (isFileSystemData(this.parent)) {
|
525
|
+
this.moveNames = [];
|
526
|
+
var obj = this.parent.dragData;
|
527
|
+
for (var i = 0; i < obj.length; i++) {
|
528
|
+
if (getValue('isFile', obj[i]) === false) {
|
529
|
+
this.moveNames.push(getValue('_fm_id', obj[i]));
|
530
|
+
}
|
531
|
+
}
|
532
|
+
}
|
524
533
|
var moveNames = [];
|
525
534
|
if (this.parent.isPasteError || this.parent.isSearchDrag) {
|
526
535
|
moveNames = this.getMoveNames(args.files, this.parent.isSearchDrag, this.parent.dragPath);
|
@@ -626,11 +635,6 @@ var NavigationPane = /** @class */ (function () {
|
|
626
635
|
if (isFileSystemData(this.parent) && (this.parent.path === this.parent.dropPath || this.parent.targetModule === 'navigationpane')) {
|
627
636
|
return;
|
628
637
|
}
|
629
|
-
if (this.parent.hasId) {
|
630
|
-
this.parent.isDropEnd = !this.parent.isPasteError;
|
631
|
-
readDropPath(this.parent);
|
632
|
-
return;
|
633
|
-
}
|
634
638
|
if ((this.parent.dropPath.indexOf(getDirectoryPath(this.parent, args)) === -1)) {
|
635
639
|
this.parent.isDropEnd = false;
|
636
640
|
readDropPath(this.parent);
|
@@ -58,4 +58,13 @@ export interface UploadSettingsModel {
|
|
58
58
|
*/
|
59
59
|
maxFileSize?: number;
|
60
60
|
|
61
|
+
/**
|
62
|
+
* Specifies the chunk size to split the large file into chunks, and upload it to the server in a sequential order.
|
63
|
+
* If the chunk size property has value, the FileManager enables the chunk upload by default.
|
64
|
+
* It must be specified in bytes value.
|
65
|
+
*
|
66
|
+
* @default 0
|
67
|
+
*/
|
68
|
+
chunkSize?: number;
|
69
|
+
|
61
70
|
}
|
@@ -50,4 +50,12 @@ export declare class UploadSettings extends ChildProperty<UploadSettings> {
|
|
50
50
|
* @default 30000000
|
51
51
|
*/
|
52
52
|
maxFileSize: number;
|
53
|
+
/**
|
54
|
+
* Specifies the chunk size to split the large file into chunks, and upload it to the server in a sequential order.
|
55
|
+
* If the chunk size property has value, the FileManager enables the chunk upload by default.
|
56
|
+
* It must be specified in bytes value.
|
57
|
+
*
|
58
|
+
* @default 0
|
59
|
+
*/
|
60
|
+
chunkSize: number;
|
53
61
|
}
|
@@ -44,6 +44,9 @@ var UploadSettings = /** @class */ (function (_super) {
|
|
44
44
|
__decorate([
|
45
45
|
Property(30000000)
|
46
46
|
], UploadSettings.prototype, "maxFileSize", void 0);
|
47
|
+
__decorate([
|
48
|
+
Property(0)
|
49
|
+
], UploadSettings.prototype, "chunkSize", void 0);
|
47
50
|
return UploadSettings;
|
48
51
|
}(ChildProperty));
|
49
52
|
export { UploadSettings };
|
@@ -154,7 +154,7 @@ var ContextMenu = /** @class */ (function () {
|
|
154
154
|
else if (closest(target, '#' + this.parent.element.id + CLS.TREE_ID)) {
|
155
155
|
uid = closest(target, 'li').getAttribute('data-uid');
|
156
156
|
if (!isNOU(uid)) {
|
157
|
-
this.
|
157
|
+
this.navUid = uid;
|
158
158
|
}
|
159
159
|
treeFolder = true;
|
160
160
|
}
|
@@ -290,8 +290,9 @@ var ContextMenu = /** @class */ (function () {
|
|
290
290
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.folder.map(function (item) { return item.trim(); }));
|
291
291
|
this.contextMenu.dataBind();
|
292
292
|
if (isTree) {
|
293
|
-
var selectedTreeNode = select('[data-uid="' + this.
|
294
|
-
if (
|
293
|
+
var selectedTreeNode = select('[data-uid="' + this.navUid + '"]', this.parent.navigationpaneModule.treeObj.element);
|
294
|
+
if (!isNOU(selectedTreeNode) &&
|
295
|
+
this.parent.pathNames[this.parent.pathNames.length - 1] === selectedTreeNode.querySelector('.e-list-text').innerHTML && this.parent.activeModule === 'navigationpane') {
|
295
296
|
this.disabledItems.push('Open');
|
296
297
|
}
|
297
298
|
else {
|
@@ -5,7 +5,7 @@ import { createFolder } from '../common/operations';
|
|
5
5
|
import * as CLS from '../base/classes';
|
6
6
|
import * as events from '../base/constant';
|
7
7
|
import { paste, rename } from '../common/operations';
|
8
|
-
import { getLocaleText, getDuplicateData, objectToString, getCssClass } from '../common/utility';
|
8
|
+
import { getLocaleText, getDuplicateData, objectToString, getCssClass, getTargetPath } from '../common/utility';
|
9
9
|
import { Input } from '@syncfusion/ej2-inputs';
|
10
10
|
import { CheckBox } from '@syncfusion/ej2-buttons';
|
11
11
|
/**
|
@@ -812,7 +812,13 @@ function onReSubmit(parent) {
|
|
812
812
|
parent.dialogObj.hide();
|
813
813
|
return;
|
814
814
|
}
|
815
|
-
var newPath =
|
815
|
+
var newPath = '';
|
816
|
+
if (parent.activeModule === 'navigationpane') {
|
817
|
+
newPath = getTargetPath(parent, parent.itemData[0]);
|
818
|
+
}
|
819
|
+
else {
|
820
|
+
newPath = parent.path;
|
821
|
+
}
|
816
822
|
parent.renamedId = getValue('id', parent.itemData[0]);
|
817
823
|
if (parent.isFile) {
|
818
824
|
var oldExtension = (oIndex === -1) ? '' : parent.currentItemText.substr(oIndex);
|