@syncfusion/ej2-filemanager 20.1.60 → 20.2.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.
@@ -1025,7 +1025,7 @@ function searchWordHandler(parent, value, isLayoutChange) {
1025
1025
  else {
1026
1026
  if (!parent.isFiltered) {
1027
1027
  if (parent.isSortByClicked) {
1028
- parent.notify(layoutChange, { files: parent.largeiconsviewModule.items });
1028
+ parent.notify(layoutChange, { files: (parent.oldView === 'Details') ? parent.detailsviewModule.gridObj.dataSource : parent.largeiconsviewModule.items });
1029
1029
  parent.isSortByClicked = false;
1030
1030
  }
1031
1031
  else {
@@ -1046,6 +1046,7 @@ function searchWordHandler(parent, value, isLayoutChange) {
1046
1046
  * @private
1047
1047
  */
1048
1048
  function updateLayout(parent, view) {
1049
+ parent.oldView = parent.view;
1049
1050
  parent.setProperties({ view: view }, true);
1050
1051
  if (parent.breadcrumbbarModule.searchObj.element.value !== '' || parent.isFiltered) {
1051
1052
  parent.layoutSelectedItems = parent.selectedItems;
@@ -1449,7 +1450,7 @@ function sortbyClickHandler(parent, args) {
1449
1450
  tick = false;
1450
1451
  }
1451
1452
  if (!tick) {
1452
- parent.sortBy = getSortField(args.item.id, parent);
1453
+ parent.sortBy = getSortField(args.item.id);
1453
1454
  }
1454
1455
  else {
1455
1456
  parent.sortOrder = getSortField(args.item.id);
@@ -1463,7 +1464,9 @@ function sortbyClickHandler(parent, args) {
1463
1464
  parent.notify(sortColumn, { module: 'detailsview' });
1464
1465
  }
1465
1466
  }
1466
- updateLayout(parent, parent.view);
1467
+ if (parent.view === 'LargeIcons') {
1468
+ updateLayout(parent, 'LargeIcons');
1469
+ }
1467
1470
  parent.notify(sortByChange, {});
1468
1471
  }
1469
1472
  /**
@@ -1473,24 +1476,12 @@ function sortbyClickHandler(parent, args) {
1473
1476
  * @returns {string} - returns the sorted fields
1474
1477
  * @private
1475
1478
  */
1476
- function getSortField(id, parent) {
1479
+ function getSortField(id) {
1477
1480
  var text = id.substring(id.lastIndexOf('_') + 1);
1478
1481
  var field = text;
1479
- var column;
1480
- if (parent) {
1481
- column = parent.detailsViewSettings.columns;
1482
- }
1483
1482
  switch (text) {
1484
1483
  case 'date':
1485
- for (var i = 0; i < column.length; i++) {
1486
- if (column[i].field === 'dateModified' || column[i].field === 'dateCreated') {
1487
- field = column[i].field;
1488
- break;
1489
- }
1490
- else {
1491
- field = '_fm_modified';
1492
- }
1493
- }
1484
+ field = '_fm_modified';
1494
1485
  break;
1495
1486
  case 'ascending':
1496
1487
  field = 'Ascending';
@@ -3538,11 +3529,18 @@ function getOptions(parent, text, e, details, replaceItems) {
3538
3529
  ];
3539
3530
  break;
3540
3531
  case 'MultipleFileDetails':
3532
+ var index_1;
3541
3533
  options.dialogName = 'File Details';
3542
- strArr = details.name.split(',').map(function (val) {
3543
- var index = val.indexOf('.') + 1;
3544
- return (index === 0) ? 'Folder' : val.substr(index).replace(' ', '');
3534
+ strArr = parent.itemData.map(function (val) {
3535
+ index_1 = val.name.indexOf('.') + 1;
3536
+ return (index_1 === 0 && (!val.isFile)) ? 'Folder' : ((index_1 !== 0) ? val.name.substr(index_1).replace(' ', '') : 'undetermined');
3545
3537
  });
3538
+ if (strArr[0] == undefined) {
3539
+ strArr = details.name.split(',').map(function (val) {
3540
+ index_1 = val.indexOf('.') + 1;
3541
+ return (index_1 === 0) ? 'Folder' : val.substr(index_1).replace(' ', '');
3542
+ });
3543
+ }
3546
3544
  fileType$$1 = strArr.every(function (val, i, arr) { return val === arr[0]; }) ?
3547
3545
  ((strArr[0] === 'Folder') ? 'Folder' : strArr[0].toLocaleUpperCase() + ' Type') : 'Multiple Types';
3548
3546
  location = details.location;
@@ -6604,7 +6602,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
6604
6602
  _this.droppedObjects = [];
6605
6603
  _this.uploadingCount = 0;
6606
6604
  _this.uploadedCount = 0;
6607
- //Specifies whether the operating system is MAC or not
6605
+ //Specifies whether the operating system is MAC or not
6608
6606
  _this.isMac = false;
6609
6607
  FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu$2);
6610
6608
  return _this;
@@ -8002,12 +8000,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
8002
8000
  items[itemCount].iconCss = this.parent.sortBy === 'size' ? TB_OPTION_DOT : '';
8003
8001
  }
8004
8002
  else if (items[itemCount].id === this.getPupupId('date')) {
8005
- if (this.parent.sortBy === 'dateModified' || this.parent.sortBy === 'dateCreated') {
8006
- items[itemCount].iconCss = this.parent.sortBy === this.parent.sortBy ? TB_OPTION_DOT : '';
8007
- }
8008
- else {
8009
- items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
8010
- }
8003
+ items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
8011
8004
  }
8012
8005
  else if (items[itemCount].id === this.getPupupId('ascending')) {
8013
8006
  items[itemCount].iconCss = this.parent.sortOrder === 'Ascending' ? TB_OPTION_TICK : '';
@@ -8571,7 +8564,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8571
8564
  var currFiles = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feFiles);
8572
8565
  if (this.expandNodeTarget === 'add') {
8573
8566
  var sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
8574
- var ul = select('.' + LIST_PARENT, sNode);
8567
+ var ul = (!isNullOrUndefined(sNode)) ? select('.' + LIST_PARENT, sNode) : null;
8575
8568
  if (isNullOrUndefined(ul)) {
8576
8569
  this.addChild(args.files, this.treeObj.selectedNodes[0], !this.expandTree);
8577
8570
  }