@syncfusion/ej2-filemanager 25.1.35 → 25.1.38

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.
@@ -9751,9 +9751,6 @@ class DetailsView {
9751
9751
  this.isNameWidth = false;
9752
9752
  this.pasteOperation = false;
9753
9753
  this.uploadOperation = false;
9754
- /* istanbul ignore next */
9755
- // eslint:disable-next-line
9756
- this.actionDivert = false;
9757
9754
  Grid.Inject(Resize, ContextMenu$1, Sort, VirtualScroll);
9758
9755
  this.parent = parent;
9759
9756
  this.element = select('#' + this.parent.element.id + GRID_ID, this.parent.element);
@@ -9921,8 +9918,7 @@ class DetailsView {
9921
9918
  field: 'name', headerText: getLocaleText(this.parent, 'Name'), width: 'auto', minWidth: 120, headerTextAlign: 'Left',
9922
9919
  template: initializeCSPTemplate(function (data) {
9923
9920
  const name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
9924
- return `<div class="e-fe-text">${name}</div><div class="e-fe-date">${data._fm_modified}</div>' +
9925
- '<span class="e-fe-size">${data.size}</span>`;
9921
+ return `<div class="e-fe-text">${name}</div><div class="e-fe-date">${data._fm_modified}</div><span class="e-fe-size">${data.size}</span>`;
9926
9922
  })
9927
9923
  }
9928
9924
  ];
@@ -9932,7 +9928,7 @@ class DetailsView {
9932
9928
  this.adjustWidth(columns, 'name');
9933
9929
  for (let i = 0, len = columns.length; i < len; i++) {
9934
9930
  columns[i].headerText = getLocaleText(this.parent, columns[i].headerText);
9935
- if (columns[i].field === 'name' && !isNullOrUndefined(columns[i].template)) {
9931
+ if (columns[i].field === 'name' && !isNullOrUndefined(columns[i].template) && !(typeof columns[i].template === 'function')) {
9936
9932
  const template = columns[i].template;
9937
9933
  columns[i].template = initializeCSPTemplate(function (data) {
9938
9934
  const name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
@@ -10975,12 +10971,14 @@ class DetailsView {
10975
10971
  eventName: 'keydown'
10976
10972
  });
10977
10973
  EventHandler.add(this.gridObj.element, 'blur', this.removeFocus, this);
10974
+ EventHandler.add(this.parent.element, 'focusout', this.onBlur, this);
10978
10975
  }
10979
10976
  unWireEvents() {
10980
10977
  this.wireClickEvent(false);
10981
10978
  this.keyboardModule.destroy();
10982
10979
  this.keyboardDownModule.destroy();
10983
10980
  EventHandler.remove(this.gridObj.element, 'blur', this.removeFocus);
10981
+ EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
10984
10982
  }
10985
10983
  wireClickEvent(toBind) {
10986
10984
  if (toBind) {
@@ -11030,6 +11028,19 @@ class DetailsView {
11030
11028
  removeFocus() {
11031
11029
  this.addFocus(null);
11032
11030
  }
11031
+ onBlur(e) {
11032
+ if ((e.relatedTarget !== null && closest(e.relatedTarget, '.e-grid') !== e.relatedTarget)) {
11033
+ return;
11034
+ }
11035
+ if (!isNullOrUndefined(this.gridObj.element)) {
11036
+ const thElements = this.gridObj.element.querySelectorAll('th');
11037
+ for (let i = 0; i < thElements.length; i++) {
11038
+ if (thElements[i].classList.contains('e-focus')) {
11039
+ this.addFocus(null);
11040
+ }
11041
+ }
11042
+ }
11043
+ }
11033
11044
  getFocusedItemIndex() {
11034
11045
  return (!isNullOrUndefined(this.getFocusedItem())) ?
11035
11046
  parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
@@ -11078,6 +11089,8 @@ class DetailsView {
11078
11089
  break;
11079
11090
  }
11080
11091
  }
11092
+ /* istanbul ignore next */
11093
+ // eslint:disable-next-line
11081
11094
  keyupHandler(e) {
11082
11095
  if (!this.isRendered) {
11083
11096
  return;
@@ -11108,7 +11121,15 @@ class DetailsView {
11108
11121
  this.performDelete();
11109
11122
  break;
11110
11123
  case 'enter':
11111
- if (this.gridObj.selectedRowIndex === -1) {
11124
+ if (this.gridObj.selectedRowIndex === -1 && this.gridObj.allowSorting === true) {
11125
+ if (!e.target.classList.contains('e-fe-grid-icon')) {
11126
+ const direction = !e.target.getElementsByClassName('e-ascending').length ? 'Ascending' : 'Descending';
11127
+ const currentField = this.gridObj.getColumnByUid(e.target.querySelector('.e-headercelldiv').getAttribute('e-mappinguid')).field;
11128
+ this.gridObj.sortColumn(currentField, direction);
11129
+ if (!isNullOrUndefined(this.getFocusedItem().nextSibling)) {
11130
+ this.getFocusedItem().nextSibling.setAttribute('tabindex', '0');
11131
+ }
11132
+ }
11112
11133
  break;
11113
11134
  }
11114
11135
  rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
@@ -11155,13 +11176,8 @@ class DetailsView {
11155
11176
  else if (this.gridObj.selectedRowIndex !== -1 && e.action === 'tab') {
11156
11177
  return;
11157
11178
  }
11158
- else if (!this.actionDivert) {
11159
- this.addHeaderFocus();
11160
- this.actionDivert = true;
11161
- }
11162
11179
  else {
11163
- this.addFocus(0);
11164
- this.actionDivert = false;
11180
+ this.addHeaderFocus(e);
11165
11181
  }
11166
11182
  }
11167
11183
  break;
@@ -11448,16 +11464,29 @@ class DetailsView {
11448
11464
  addClass([itemElement], [FOCUS, FOCUSED]);
11449
11465
  }
11450
11466
  }
11451
- addHeaderFocus() {
11467
+ addHeaderFocus(e) {
11452
11468
  const treeFocus = select('.e-row', this.element);
11453
11469
  this.gridObj.element.setAttribute('tabindex', '-1');
11454
- const nameFocus = select('th.e-fe-grid-name', this.element);
11455
- nameFocus.setAttribute('tabindex', '0');
11456
- nameFocus.focus();
11457
- addClass([nameFocus], [FOCUS, FOCUSED]);
11458
- treeFocus.setAttribute('tabindex', '0');
11459
- if (treeFocus.tabIndex === 0 && nameFocus.tabIndex === 0) {
11460
- removeClass([treeFocus], [FOCUS, FOCUSED]);
11470
+ let nameFocus;
11471
+ if (!isNullOrUndefined(e.target) && e.target.classList.contains('e-defaultcursor')) {
11472
+ this.addFocus(0);
11473
+ nameFocus = e.target.nextElementSibling;
11474
+ }
11475
+ else if (!isNullOrUndefined(this.gridObj.element.querySelector('.e-focus')) && (this.gridObj.element.querySelector('.e-focus').tagName === 'TH')) {
11476
+ nameFocus = this.gridObj.element.querySelector('.e-focus').nextElementSibling;
11477
+ this.addFocus(0);
11478
+ }
11479
+ else {
11480
+ nameFocus = select('th.e-fe-grid-icon', this.element);
11481
+ }
11482
+ if (!isNullOrUndefined(nameFocus)) {
11483
+ nameFocus.setAttribute('tabindex', '0');
11484
+ nameFocus.focus();
11485
+ addClass([nameFocus], [FOCUS, FOCUSED]);
11486
+ treeFocus.setAttribute('tabindex', '0');
11487
+ if (treeFocus.tabIndex === 0 && nameFocus.tabIndex === 0) {
11488
+ removeClass([treeFocus], [FOCUS, FOCUSED]);
11489
+ }
11461
11490
  }
11462
11491
  }
11463
11492
  getFocusedItem() {