@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.
@@ -1559,6 +1559,9 @@ function pasteHandler(parent) {
1559
1559
  parent.isDragDrop = false;
1560
1560
  if (parent.selectedNodes.length !== 0 && parent.enablePaste) {
1561
1561
  const path = (parent.folderPath === '') ? parent.path : parent.folderPath;
1562
+ if (parent.activeModule === 'navigationpane' && !parent.selectedNodes[0].includes('/')) {
1563
+ parent.targetPath = getValue('filterPath', parent.actionRecords[0]).replace(/\\/g, '/');
1564
+ }
1562
1565
  const subFolder = validateSubFolder(parent, parent.actionRecords, path, parent.path);
1563
1566
  if (!subFolder) {
1564
1567
  if ((parent.fileAction === 'move' && parent.targetPath !== path) || parent.fileAction === 'copy') {
@@ -3148,19 +3151,33 @@ function triggerAjaxFailure(parent, beforeSendArgs, fn, result, event, operation
3148
3151
  * @private
3149
3152
  */
3150
3153
  function readSuccess(parent, result, event) {
3151
- if (!isNullOrUndefined(result.files)) {
3152
- parent.notify(event, result);
3153
- parent.notify(selectionChanged, {});
3154
- const args = { action: 'read', result: result };
3155
- parent.trigger('success', args);
3156
- }
3157
- else {
3158
- if (result.error.code === '401') {
3159
- result.files = [];
3154
+ try {
3155
+ if (!isNullOrUndefined(result.files)) {
3160
3156
  parent.notify(event, result);
3161
3157
  parent.notify(selectionChanged, {});
3158
+ const args = { action: 'read', result: result };
3159
+ parent.trigger('success', args);
3160
+ }
3161
+ else {
3162
+ if (!isNullOrUndefined(result.error) && result.error.code === '401') {
3163
+ result.files = [];
3164
+ parent.notify(event, result);
3165
+ parent.notify(selectionChanged, {});
3166
+ }
3167
+ onFailure(parent, result, 'read');
3168
+ parent.setProperties({ path: parent.oldPath }, true);
3169
+ parent.pathNames.pop();
3162
3170
  }
3163
- onFailure(parent, result, 'read');
3171
+ }
3172
+ catch (error) {
3173
+ const errorResult = {
3174
+ files: null,
3175
+ error: {
3176
+ message: error.message,
3177
+ fileExists: null
3178
+ }
3179
+ };
3180
+ onFailure(parent, errorResult, 'read');
3164
3181
  parent.setProperties({ path: parent.oldPath }, true);
3165
3182
  parent.pathNames.pop();
3166
3183
  }
@@ -5117,7 +5134,7 @@ class LargeIconsView {
5117
5134
  onpasteEnd(args) {
5118
5135
  if (this.parent.view === 'LargeIcons') {
5119
5136
  this.isPasteOperation = true;
5120
- if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args)) {
5137
+ if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args) || this.parent.hasId) {
5121
5138
  this.onPathChanged(args);
5122
5139
  }
5123
5140
  }
@@ -6574,7 +6591,23 @@ class ContextMenu {
6574
6591
  iconSpan.setAttribute('class', ICON_GRID + ' ' + MENU_ICON);
6575
6592
  }
6576
6593
  }
6577
- onBeforeClose() {
6594
+ onBeforeClose(args) {
6595
+ const eventArgs = {
6596
+ cancel: false,
6597
+ element: args.element,
6598
+ event: args.event,
6599
+ isFocused: args.isFocused,
6600
+ fileDetails: [this.menuItemData],
6601
+ items: args.items,
6602
+ parentItem: args.parentItem,
6603
+ menuType: this.menuType
6604
+ };
6605
+ this.parent.trigger('menuClose', eventArgs, (menuCloseArgs) => {
6606
+ if (menuCloseArgs.cancel) {
6607
+ args.cancel = menuCloseArgs.cancel;
6608
+ return;
6609
+ }
6610
+ });
6578
6611
  this.menuTarget = null;
6579
6612
  if (!this.isMenuItemClicked && this.parent.pathId.length > 1 && this.parent.activeModule === 'navigationpane') {
6580
6613
  this.parent.pathId.pop();
@@ -6908,6 +6941,9 @@ class ContextMenu {
6908
6941
  break;
6909
6942
  case 'paste':
6910
6943
  if (this.menuType === 'folder') {
6944
+ if (this.parent.activeModule === 'navigationpane') {
6945
+ this.parent.navigationpaneModule.openFileOnContextMenuClick(closest(this.targetNodeElement, 'li'));
6946
+ }
6911
6947
  this.parent.folderPath = getFullPath(this.parent, this.menuItemData, this.parent.path);
6912
6948
  }
6913
6949
  else {
@@ -8544,6 +8580,9 @@ __decorate$8([
8544
8580
  __decorate$8([
8545
8581
  Event()
8546
8582
  ], FileManager.prototype, "menuOpen", void 0);
8583
+ __decorate$8([
8584
+ Event()
8585
+ ], FileManager.prototype, "menuClose", void 0);
8547
8586
  __decorate$8([
8548
8587
  Event()
8549
8588
  ], FileManager.prototype, "failure", void 0);
@@ -11354,7 +11393,7 @@ class DetailsView {
11354
11393
  onpasteEnd(args) {
11355
11394
  if (this.parent.view === 'Details') {
11356
11395
  this.isPasteOperation = true;
11357
- if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args)) {
11396
+ if (this.parent.path === this.parent.destinationPath || this.parent.path === getDirectoryPath(this.parent, args) || this.parent.hasId) {
11358
11397
  this.onPathChanged(args);
11359
11398
  }
11360
11399
  }