@syncfusion/ej2-filemanager 26.2.7 → 26.2.11

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.
@@ -1708,6 +1708,9 @@ function pasteHandler(parent) {
1708
1708
  parent.isDragDrop = false;
1709
1709
  if (parent.selectedNodes.length !== 0 && parent.enablePaste) {
1710
1710
  var path = (parent.folderPath === '') ? parent.path : parent.folderPath;
1711
+ if (parent.activeModule === 'navigationpane' && !parent.selectedNodes[0].includes('/')) {
1712
+ parent.targetPath = getValue('filterPath', parent.actionRecords[0]).replace(/\\/g, '/');
1713
+ }
1711
1714
  var subFolder = validateSubFolder(parent, parent.actionRecords, path, parent.path);
1712
1715
  if (!subFolder) {
1713
1716
  if ((parent.fileAction === 'move' && parent.targetPath !== path) || parent.fileAction === 'copy') {
@@ -3297,19 +3300,33 @@ function triggerAjaxFailure(parent, beforeSendArgs, fn, result, event, operation
3297
3300
  * @private
3298
3301
  */
3299
3302
  function readSuccess(parent, result, event) {
3300
- if (!isNullOrUndefined(result.files)) {
3301
- parent.notify(event, result);
3302
- parent.notify(selectionChanged, {});
3303
- var args = { action: 'read', result: result };
3304
- parent.trigger('success', args);
3305
- }
3306
- else {
3307
- if (result.error.code === '401') {
3308
- result.files = [];
3303
+ try {
3304
+ if (!isNullOrUndefined(result.files)) {
3309
3305
  parent.notify(event, result);
3310
3306
  parent.notify(selectionChanged, {});
3307
+ var args = { action: 'read', result: result };
3308
+ parent.trigger('success', args);
3309
+ }
3310
+ else {
3311
+ if (!isNullOrUndefined(result.error) && result.error.code === '401') {
3312
+ result.files = [];
3313
+ parent.notify(event, result);
3314
+ parent.notify(selectionChanged, {});
3315
+ }
3316
+ onFailure(parent, result, 'read');
3317
+ parent.setProperties({ path: parent.oldPath }, true);
3318
+ parent.pathNames.pop();
3311
3319
  }
3312
- onFailure(parent, result, 'read');
3320
+ }
3321
+ catch (error) {
3322
+ var errorResult = {
3323
+ files: null,
3324
+ error: {
3325
+ message: error.message,
3326
+ fileExists: null
3327
+ }
3328
+ };
3329
+ onFailure(parent, errorResult, 'read');
3313
3330
  parent.setProperties({ path: parent.oldPath }, true);
3314
3331
  parent.pathNames.pop();
3315
3332
  }
@@ -5270,7 +5287,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
5270
5287
  LargeIconsView.prototype.onpasteEnd = function (args) {
5271
5288
  if (this.parent.view === 'LargeIcons') {
5272
5289
  this.isPasteOperation = true;
5273
- if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args)) {
5290
+ if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args) || this.parent.hasId) {
5274
5291
  this.onPathChanged(args);
5275
5292
  }
5276
5293
  }
@@ -6735,7 +6752,23 @@ var ContextMenu = /** @__PURE__ @class */ (function () {
6735
6752
  iconSpan.setAttribute('class', ICON_GRID + ' ' + MENU_ICON);
6736
6753
  }
6737
6754
  };
6738
- ContextMenu.prototype.onBeforeClose = function () {
6755
+ ContextMenu.prototype.onBeforeClose = function (args) {
6756
+ var eventArgs = {
6757
+ cancel: false,
6758
+ element: args.element,
6759
+ event: args.event,
6760
+ isFocused: args.isFocused,
6761
+ fileDetails: [this.menuItemData],
6762
+ items: args.items,
6763
+ parentItem: args.parentItem,
6764
+ menuType: this.menuType
6765
+ };
6766
+ this.parent.trigger('menuClose', eventArgs, function (menuCloseArgs) {
6767
+ if (menuCloseArgs.cancel) {
6768
+ args.cancel = menuCloseArgs.cancel;
6769
+ return;
6770
+ }
6771
+ });
6739
6772
  this.menuTarget = null;
6740
6773
  if (!this.isMenuItemClicked && this.parent.pathId.length > 1 && this.parent.activeModule === 'navigationpane') {
6741
6774
  this.parent.pathId.pop();
@@ -7072,6 +7105,9 @@ var ContextMenu = /** @__PURE__ @class */ (function () {
7072
7105
  break;
7073
7106
  case 'paste':
7074
7107
  if (_this.menuType === 'folder') {
7108
+ if (_this.parent.activeModule === 'navigationpane') {
7109
+ _this.parent.navigationpaneModule.openFileOnContextMenuClick(closest(_this.targetNodeElement, 'li'));
7110
+ }
7075
7111
  _this.parent.folderPath = getFullPath(_this.parent, _this.menuItemData, _this.parent.path);
7076
7112
  }
7077
7113
  else {
@@ -8726,6 +8762,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
8726
8762
  __decorate$8([
8727
8763
  Event()
8728
8764
  ], FileManager.prototype, "menuOpen", void 0);
8765
+ __decorate$8([
8766
+ Event()
8767
+ ], FileManager.prototype, "menuClose", void 0);
8729
8768
  __decorate$8([
8730
8769
  Event()
8731
8770
  ], FileManager.prototype, "failure", void 0);
@@ -11561,7 +11600,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
11561
11600
  DetailsView.prototype.onpasteEnd = function (args) {
11562
11601
  if (this.parent.view === 'Details') {
11563
11602
  this.isPasteOperation = true;
11564
- if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args)) {
11603
+ if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args) || this.parent.hasId) {
11565
11604
  this.onPathChanged(args);
11566
11605
  }
11567
11606
  }