@syncfusion/ej2-filemanager 20.1.56 → 20.1.59

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.
@@ -1305,7 +1305,7 @@ function sortbyClickHandler(parent, args) {
1305
1305
  tick = false;
1306
1306
  }
1307
1307
  if (!tick) {
1308
- parent.sortBy = getSortField(args.item.id);
1308
+ parent.sortBy = getSortField(args.item.id, parent);
1309
1309
  }
1310
1310
  else {
1311
1311
  parent.sortOrder = getSortField(args.item.id);
@@ -1331,12 +1331,24 @@ function sortbyClickHandler(parent, args) {
1331
1331
  * @returns {string} - returns the sorted fields
1332
1332
  * @private
1333
1333
  */
1334
- function getSortField(id) {
1334
+ function getSortField(id, parent) {
1335
1335
  const text = id.substring(id.lastIndexOf('_') + 1);
1336
1336
  let field = text;
1337
+ let column;
1338
+ if (parent) {
1339
+ column = parent.detailsViewSettings.columns;
1340
+ }
1337
1341
  switch (text) {
1338
1342
  case 'date':
1339
- field = '_fm_modified';
1343
+ for (var i = 0; i < column.length; i++) {
1344
+ if (column[i].field === 'dateModified' || column[i].field === 'dateCreated') {
1345
+ field = column[i].field;
1346
+ break;
1347
+ }
1348
+ else {
1349
+ field = '_fm_modified';
1350
+ }
1351
+ }
1340
1352
  break;
1341
1353
  case 'ascending':
1342
1354
  field = 'Ascending';
@@ -1414,6 +1426,15 @@ function pasteHandler(parent) {
1414
1426
  parent.enablePaste = false;
1415
1427
  parent.notify(hidePaste, {});
1416
1428
  removeBlur(parent);
1429
+ const result = {
1430
+ files: null,
1431
+ error: {
1432
+ code: '402',
1433
+ message: getLocaleText(parent, 'Same-Folder-Error'),
1434
+ fileExists: null
1435
+ }
1436
+ };
1437
+ createDialog(parent, 'Error', result);
1417
1438
  }
1418
1439
  }
1419
1440
  }
@@ -3772,9 +3793,9 @@ class LargeIconsView {
3772
3793
  altEnter: 'alt+enter',
3773
3794
  esc: 'escape',
3774
3795
  del: 'delete',
3775
- ctrlX: 'ctrl+x',
3776
- ctrlC: 'ctrl+c',
3777
- ctrlV: 'ctrl+v',
3796
+ ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
3797
+ ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
3798
+ ctrlV: this.parent.isMac ? 'cmd+v' : 'ctrl+v',
3778
3799
  f2: 'f2',
3779
3800
  shiftdel: 'shift+delete',
3780
3801
  back: 'backspace',
@@ -6414,6 +6435,8 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6414
6435
  this.droppedObjects = [];
6415
6436
  this.uploadingCount = 0;
6416
6437
  this.uploadedCount = 0;
6438
+ //Specifies whether the operating system is MAC or not
6439
+ this.isMac = false;
6417
6440
  FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu$2);
6418
6441
  }
6419
6442
  /**
@@ -6521,6 +6544,7 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6521
6544
  this.allowMultiSelection ? this.selectedItems : this.selectedItems.slice(this.selectedItems.length - 1);
6522
6545
  this.setProperties({ selectedItems: slItems }, true);
6523
6546
  this.fileView = this.view;
6547
+ this.isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
6524
6548
  this.setRtl(this.enableRtl);
6525
6549
  this.addEventListeners();
6526
6550
  read(this, (this.path !== this.originalPath) ? initialEnd : finalizeEnd, this.path);
@@ -7800,7 +7824,12 @@ class Toolbar$1 {
7800
7824
  items[itemCount].iconCss = this.parent.sortBy === 'size' ? TB_OPTION_DOT : '';
7801
7825
  }
7802
7826
  else if (items[itemCount].id === this.getPupupId('date')) {
7803
- items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
7827
+ if (this.parent.sortBy === 'dateModified' || this.parent.sortBy === 'dateCreated') {
7828
+ items[itemCount].iconCss = this.parent.sortBy === this.parent.sortBy ? TB_OPTION_DOT : '';
7829
+ }
7830
+ else {
7831
+ items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
7832
+ }
7804
7833
  }
7805
7834
  else if (items[itemCount].id === this.getPupupId('ascending')) {
7806
7835
  items[itemCount].iconCss = this.parent.sortOrder === 'Ascending' ? TB_OPTION_TICK : '';
@@ -8079,6 +8108,7 @@ class NavigationPane {
8079
8108
  * @param {IFileManager} parent - specifies the parent element.
8080
8109
  * @hidden
8081
8110
  */
8111
+ /* istanbul ignore next */
8082
8112
  constructor(parent) {
8083
8113
  this.removeNodes = [];
8084
8114
  this.moveNames = [];
@@ -8100,9 +8130,9 @@ class NavigationPane {
8100
8130
  altEnter: 'alt+enter',
8101
8131
  esc: 'escape',
8102
8132
  del: 'delete',
8103
- ctrlX: 'ctrl+x',
8104
- ctrlC: 'ctrl+c',
8105
- ctrlV: 'ctrl+v',
8133
+ ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
8134
+ ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
8135
+ ctrlV: this.parent.isMac ? 'cmd+v' : 'ctrl+v',
8106
8136
  ctrlShiftN: 'ctrl+shift+n',
8107
8137
  shiftF10: 'shift+F10',
8108
8138
  f2: 'f2'
@@ -8959,9 +8989,9 @@ class DetailsView {
8959
8989
  home: 'home',
8960
8990
  moveUp: 'uparrow',
8961
8991
  del: 'delete',
8962
- ctrlX: 'ctrl+x',
8963
- ctrlC: 'ctrl+c',
8964
- ctrlV: 'ctrl+v',
8992
+ ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
8993
+ ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
8994
+ ctrlV: this.parent.isMac ? 'cmd+v' : 'ctrl+v',
8965
8995
  ctrlShiftN: 'ctrl+shift+n',
8966
8996
  shiftdel: 'shift+delete',
8967
8997
  ctrlD: 'ctrl+d',