@syncfusion/ej2-filemanager 28.1.33 → 28.1.39

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 28.1.33
3
+ * version : 28.1.39
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-filemanager@*",
3
- "_id": "@syncfusion/ej2-filemanager@18.28.1",
3
+ "_id": "@syncfusion/ej2-filemanager@28.1.33",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-zzol2ppCnpFvRpdwhzxa8R7RfF84vklbeFH9hYlEzOhSxLzCBxL3eNFfOoQB6Q9DbB3gtUBkw1arYRoJOQ4oBA==",
5
+ "_integrity": "sha512-Cc9VMJHKuyACNrPOUjKhwcbBKYyBeqd1/4StmBIGI0QTsxk3n8DvguI2LUIV80FNQrrBfDlMhz+YDRT1mUyLQA==",
6
6
  "_location": "/@syncfusion/ej2-filemanager",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -24,8 +24,8 @@
24
24
  "/@syncfusion/ej2-richtexteditor",
25
25
  "/@syncfusion/ej2-vue-filemanager"
26
26
  ],
27
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-filemanager/-/ej2-filemanager-18.28.1.tgz",
28
- "_shasum": "26aebb2c4d38529bf6bc755a869b1a1b4ea5fbba",
27
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-filemanager/-/ej2-filemanager-28.1.33.tgz",
28
+ "_shasum": "ea905122d6fe360ca88de8ca0d28faf8d9860324",
29
29
  "_spec": "@syncfusion/ej2-filemanager@*",
30
30
  "_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
31
31
  "author": {
@@ -37,15 +37,15 @@
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
39
  "@syncfusion/ej2-base": "~28.1.33",
40
- "@syncfusion/ej2-buttons": "~28.1.33",
40
+ "@syncfusion/ej2-buttons": "~28.1.39",
41
41
  "@syncfusion/ej2-data": "~28.1.33",
42
- "@syncfusion/ej2-grids": "~28.1.33",
43
- "@syncfusion/ej2-inputs": "~28.1.33",
42
+ "@syncfusion/ej2-grids": "~28.1.38",
43
+ "@syncfusion/ej2-inputs": "~28.1.37",
44
44
  "@syncfusion/ej2-layouts": "~28.1.33",
45
- "@syncfusion/ej2-lists": "~28.1.33",
46
- "@syncfusion/ej2-navigations": "~28.1.33",
47
- "@syncfusion/ej2-popups": "~28.1.33",
48
- "@syncfusion/ej2-splitbuttons": "~28.1.33"
45
+ "@syncfusion/ej2-lists": "~28.1.37",
46
+ "@syncfusion/ej2-navigations": "~28.1.39",
47
+ "@syncfusion/ej2-popups": "~28.1.39",
48
+ "@syncfusion/ej2-splitbuttons": "~28.1.37"
49
49
  },
50
50
  "deprecated": false,
51
51
  "description": "Essential JS 2 FileManager Component",
@@ -75,6 +75,6 @@
75
75
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
76
76
  },
77
77
  "typings": "index.d.ts",
78
- "version": "28.1.33",
78
+ "version": "28.1.39",
79
79
  "sideEffects": false
80
80
  }
@@ -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 target = args.targetData;
438
- var getTargetFiles = filterByParent(parent, target.id);
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 (!target.hasChild) {
443
- target.hasChild = !currItem.isFile;
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.parentID) : [];
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 = target;
486
+ parent.dropData = target_1;
460
487
  parent.dropPath = args.path;
461
488
  var pathArray = args.targetPath.replace(/^\/|\/$/g, '').split('/');
462
- target = filterById(parent, pathArray[pathArray.length - 1]);
489
+ target_1 = filterById(parent, pathArray[pathArray.length - 1]);
463
490
  }
464
- fileData.parentId = target.id;
465
- fileData.filterPath = target.id === 0 ? '\\' : target.filterPath + target.name + '\\';
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';
@@ -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 parent.hasId && !isNullOrUndefined(parent.ajaxSettings.url) ? filePath : '/';
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;
@@ -195,7 +195,7 @@ var NavigationPane = /** @class */ (function () {
195
195
  if (!this.renameParent) {
196
196
  this.parent.activeModule = 'navigationpane';
197
197
  var nodeData = this.getTreeData(getValue('id', args.nodeData));
198
- if (args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1] && !this.isRightClick && !this.isNodeClickCalled || this.isSameNodeClicked) {
198
+ if (args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1] && !this.isRightClick && !this.isNodeClickCalled || this.isSameNodeClicked || this.isPathDragged) {
199
199
  this.isNodeClickCalled = false;
200
200
  if (!this.isSameNodeClicked) {
201
201
  this.isSameNodeClicked = true;
@@ -211,6 +211,7 @@ var NavigationPane = /** @class */ (function () {
211
211
  this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] !== args.node.getAttribute('data-uid') : false;
212
212
  this.isNodeClickCalled = true;
213
213
  this.isSameNodeClicked = false;
214
+ this.isPathDragged = false;
214
215
  this.previousSelected = this.treeObj.selectedNodes;
215
216
  this.treeObj.setProperties({ selectedNodes: [args.node.getAttribute('data-uid')] });
216
217
  }
@@ -521,6 +522,15 @@ var NavigationPane = /** @class */ (function () {
521
522
  this.removeChildNodes(e.selectedNode);
522
523
  };
523
524
  NavigationPane.prototype.onDragEnd = function (args) {
525
+ if (isFileSystemData(this.parent)) {
526
+ this.moveNames = [];
527
+ var obj = this.parent.dragData;
528
+ for (var i = 0; i < obj.length; i++) {
529
+ if (getValue('isFile', obj[i]) === false) {
530
+ this.moveNames.push(getValue('_fm_id', obj[i]));
531
+ }
532
+ }
533
+ }
524
534
  var moveNames = [];
525
535
  if (this.parent.isPasteError || this.parent.isSearchDrag) {
526
536
  moveNames = this.getMoveNames(args.files, this.parent.isSearchDrag, this.parent.dragPath);
@@ -626,11 +636,6 @@ var NavigationPane = /** @class */ (function () {
626
636
  if (isFileSystemData(this.parent) && (this.parent.path === this.parent.dropPath || this.parent.targetModule === 'navigationpane')) {
627
637
  return;
628
638
  }
629
- if (this.parent.hasId) {
630
- this.parent.isDropEnd = !this.parent.isPasteError;
631
- readDropPath(this.parent);
632
- return;
633
- }
634
639
  if ((this.parent.dropPath.indexOf(getDirectoryPath(this.parent, args)) === -1)) {
635
640
  this.parent.isDropEnd = false;
636
641
  readDropPath(this.parent);