@syncfusion/ej2-filemanager 33.2.6 → 33.2.13
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.
- package/dist/ej2-filemanager.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js.map +1 -1
- package/dist/es6/ej2-filemanager.es2015.js +290 -8
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +291 -8
- package/dist/es6/ej2-filemanager.es5.js.map +1 -1
- package/dist/global/ej2-filemanager.min.js +2 -2
- package/dist/global/ej2-filemanager.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +6 -6
- package/src/file-manager/layout/details-view.d.ts +10 -0
- package/src/file-manager/layout/details-view.js +291 -8
- package/styles/bds-lite.css +3 -7
- package/styles/bds.css +6 -10
- package/styles/bootstrap-dark-lite.css +0 -4
- package/styles/bootstrap-dark.css +0 -4
- package/styles/bootstrap-lite.css +0 -4
- package/styles/bootstrap.css +0 -4
- package/styles/bootstrap4-lite.css +3 -7
- package/styles/bootstrap4.css +6 -10
- package/styles/bootstrap5-dark-lite.css +3 -7
- package/styles/bootstrap5-dark.css +5 -9
- package/styles/bootstrap5-lite.css +3 -7
- package/styles/bootstrap5.3-lite.css +3 -7
- package/styles/bootstrap5.3.css +5 -9
- package/styles/bootstrap5.css +5 -9
- package/styles/fabric-dark-lite.css +3 -7
- package/styles/fabric-dark.css +3 -7
- package/styles/fabric-lite.css +3 -7
- package/styles/fabric.css +3 -7
- package/styles/file-manager/_bds-definition.scss +6 -6
- package/styles/file-manager/_bootstrap4-definition.scss +6 -6
- package/styles/file-manager/_bootstrap5-dark-definition.scss +5 -5
- package/styles/file-manager/_bootstrap5-definition.scss +5 -5
- package/styles/file-manager/_bootstrap5.3-definition.scss +5 -5
- package/styles/file-manager/_fabric-dark-definition.scss +3 -3
- package/styles/file-manager/_fabric-definition.scss +3 -3
- package/styles/file-manager/_fluent-dark-definition.scss +5 -5
- package/styles/file-manager/_fluent-definition.scss +5 -5
- package/styles/file-manager/_layout.scss +0 -1
- package/styles/file-manager/_material-dark-definition.scss +6 -6
- package/styles/file-manager/_material-definition.scss +6 -6
- package/styles/file-manager/_tailwind-dark-definition.scss +6 -6
- package/styles/file-manager/_tailwind-definition.scss +6 -6
- package/styles/file-manager/bds.css +6 -10
- package/styles/file-manager/bootstrap-dark.css +0 -4
- package/styles/file-manager/bootstrap.css +0 -4
- package/styles/file-manager/bootstrap4.css +6 -10
- package/styles/file-manager/bootstrap5-dark.css +5 -9
- package/styles/file-manager/bootstrap5.3.css +5 -9
- package/styles/file-manager/bootstrap5.css +5 -9
- package/styles/file-manager/fabric-dark.css +3 -7
- package/styles/file-manager/fabric.css +3 -7
- package/styles/file-manager/fluent-dark.css +5 -9
- package/styles/file-manager/fluent.css +5 -9
- package/styles/file-manager/fluent2.css +0 -4
- package/styles/file-manager/highcontrast-light.css +0 -4
- package/styles/file-manager/highcontrast.css +0 -4
- package/styles/file-manager/material-dark.css +6 -10
- package/styles/file-manager/material.css +6 -10
- package/styles/file-manager/material3-dark.css +0 -4
- package/styles/file-manager/material3.css +0 -4
- package/styles/file-manager/tailwind-dark.css +6 -10
- package/styles/file-manager/tailwind.css +6 -10
- package/styles/file-manager/tailwind3.css +0 -4
- package/styles/fluent-dark-lite.css +2 -6
- package/styles/fluent-dark.css +5 -9
- package/styles/fluent-lite.css +2 -6
- package/styles/fluent.css +5 -9
- package/styles/fluent2-lite.css +0 -4
- package/styles/fluent2.css +0 -4
- package/styles/highcontrast-light-lite.css +0 -4
- package/styles/highcontrast-light.css +0 -4
- package/styles/highcontrast-lite.css +0 -4
- package/styles/highcontrast.css +0 -4
- package/styles/material-dark-lite.css +3 -7
- package/styles/material-dark.css +6 -10
- package/styles/material-lite.css +3 -7
- package/styles/material.css +6 -10
- package/styles/material3-dark-lite.css +0 -4
- package/styles/material3-dark.css +0 -4
- package/styles/material3-lite.css +0 -4
- package/styles/material3.css +0 -4
- package/styles/tailwind-dark-lite.css +3 -7
- package/styles/tailwind-dark.css +6 -10
- package/styles/tailwind-lite.css +3 -7
- package/styles/tailwind.css +6 -10
- package/styles/tailwind3-lite.css +0 -4
- package/styles/tailwind3.css +0 -4
|
@@ -11144,6 +11144,7 @@ class DetailsView {
|
|
|
11144
11144
|
this.dragObj = null;
|
|
11145
11145
|
this.startIndex = null;
|
|
11146
11146
|
this.firstItemIndex = null;
|
|
11147
|
+
this.currentColumnIndex = 0;
|
|
11147
11148
|
this.isSelectionUpdate = false;
|
|
11148
11149
|
this.currentSelectedItem = [];
|
|
11149
11150
|
this.count = 0;
|
|
@@ -11151,6 +11152,7 @@ class DetailsView {
|
|
|
11151
11152
|
this.isLoaded = false;
|
|
11152
11153
|
this.isNameWidth = false;
|
|
11153
11154
|
this.isMultiSelect = false;
|
|
11155
|
+
this.isTabKeypressed = false;
|
|
11154
11156
|
this.pasteOperation = false;
|
|
11155
11157
|
this.uploadOperation = false;
|
|
11156
11158
|
this.nextFocusIndex = null;
|
|
@@ -11162,6 +11164,7 @@ class DetailsView {
|
|
|
11162
11164
|
altEnter: 'alt+enter',
|
|
11163
11165
|
esc: 'escape',
|
|
11164
11166
|
tab: 'tab',
|
|
11167
|
+
shiftTab: 'shift+tab',
|
|
11165
11168
|
moveDown: 'downarrow',
|
|
11166
11169
|
ctrlEnd: 'ctrl+end',
|
|
11167
11170
|
ctrlHome: 'ctrl+home',
|
|
@@ -11184,6 +11187,8 @@ class DetailsView {
|
|
|
11184
11187
|
end: 'end',
|
|
11185
11188
|
home: 'home',
|
|
11186
11189
|
moveUp: 'uparrow',
|
|
11190
|
+
moveLeft: 'leftarrow',
|
|
11191
|
+
moveRight: 'rightarrow',
|
|
11187
11192
|
del: 'delete',
|
|
11188
11193
|
ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
|
|
11189
11194
|
ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
|
|
@@ -11653,7 +11658,10 @@ class DetailsView {
|
|
|
11653
11658
|
}
|
|
11654
11659
|
}
|
|
11655
11660
|
onSortColumn() {
|
|
11656
|
-
|
|
11661
|
+
const columns = this.gridObj.columns;
|
|
11662
|
+
const isValidSortField = !isNullOrUndefined(columns) &&
|
|
11663
|
+
columns.some((col) => col.field === this.parent.sortBy);
|
|
11664
|
+
if (this.parent.sortOrder !== 'None' && isValidSortField) {
|
|
11657
11665
|
this.gridObj.sortModule.sortColumn(this.parent.sortBy, this.parent.sortOrder);
|
|
11658
11666
|
}
|
|
11659
11667
|
else {
|
|
@@ -12506,8 +12514,21 @@ class DetailsView {
|
|
|
12506
12514
|
}
|
|
12507
12515
|
}
|
|
12508
12516
|
getFocusedItemIndex() {
|
|
12509
|
-
|
|
12510
|
-
|
|
12517
|
+
const focusedItem = this.getFocusedItem();
|
|
12518
|
+
if (isNullOrUndefined(focusedItem)) {
|
|
12519
|
+
return null;
|
|
12520
|
+
}
|
|
12521
|
+
if (focusedItem.classList.contains('e-rowcell')) {
|
|
12522
|
+
return this.getRowIndexFromParent(focusedItem);
|
|
12523
|
+
}
|
|
12524
|
+
return parseInt(focusedItem.getAttribute('aria-rowindex'), 10) - 1;
|
|
12525
|
+
}
|
|
12526
|
+
getRowIndexFromParent(focusedItem) {
|
|
12527
|
+
const parentRow = focusedItem.parentElement;
|
|
12528
|
+
if (parentRow && parentRow.classList.contains('e-row')) {
|
|
12529
|
+
return parseInt(parentRow.getAttribute('aria-rowindex'), 10) - 1;
|
|
12530
|
+
}
|
|
12531
|
+
return null;
|
|
12511
12532
|
}
|
|
12512
12533
|
/* istanbul ignore next */
|
|
12513
12534
|
keydownHandler(e) {
|
|
@@ -12536,6 +12557,8 @@ class DetailsView {
|
|
|
12536
12557
|
case 'ctrlLeft':
|
|
12537
12558
|
case 'shiftLeft':
|
|
12538
12559
|
case 'csLeft':
|
|
12560
|
+
case 'tab':
|
|
12561
|
+
case 'shiftTab':
|
|
12539
12562
|
case 'esc':
|
|
12540
12563
|
case 'del':
|
|
12541
12564
|
case 'shiftdel':
|
|
@@ -12545,6 +12568,8 @@ class DetailsView {
|
|
|
12545
12568
|
case 'f2':
|
|
12546
12569
|
case 'moveDown':
|
|
12547
12570
|
case 'moveUp':
|
|
12571
|
+
case 'moveLeft':
|
|
12572
|
+
case 'moveRight':
|
|
12548
12573
|
case 'ctrlD':
|
|
12549
12574
|
e.preventDefault();
|
|
12550
12575
|
break;
|
|
@@ -12625,12 +12650,18 @@ class DetailsView {
|
|
|
12625
12650
|
break;
|
|
12626
12651
|
case 'ctrlHome':
|
|
12627
12652
|
case 'tab':
|
|
12653
|
+
case 'shiftTab':
|
|
12628
12654
|
if (!isNullOrUndefined(gridItems[0])) {
|
|
12629
12655
|
if (!this.parent.allowMultiSelection && e.action === 'ctrlHome') {
|
|
12630
12656
|
this.gridObj.selectRow(0);
|
|
12631
12657
|
}
|
|
12632
|
-
else if (
|
|
12633
|
-
|
|
12658
|
+
else if (e.action === 'shiftTab') {
|
|
12659
|
+
this.handleReverseTabNavigation(e);
|
|
12660
|
+
}
|
|
12661
|
+
else if (e.action === 'tab') {
|
|
12662
|
+
this.isTabKeypressed = true;
|
|
12663
|
+
this.addHeaderFocus(e);
|
|
12664
|
+
this.isTabKeypressed = false;
|
|
12634
12665
|
}
|
|
12635
12666
|
else {
|
|
12636
12667
|
this.addHeaderFocus(e);
|
|
@@ -12700,6 +12731,10 @@ class DetailsView {
|
|
|
12700
12731
|
case 'moveDown':
|
|
12701
12732
|
this.moveFunction(gridItems, e, selIndex);
|
|
12702
12733
|
break;
|
|
12734
|
+
case 'moveLeft':
|
|
12735
|
+
case 'moveRight':
|
|
12736
|
+
this.moveColumn(e);
|
|
12737
|
+
break;
|
|
12703
12738
|
case 'end':
|
|
12704
12739
|
lastItem = [getValue(this.parent.hasId ? 'id' : 'name', gridItems[gridLength - 1])];
|
|
12705
12740
|
this.parent.setProperties({ selectedItems: lastItem }, true);
|
|
@@ -12830,6 +12865,72 @@ class DetailsView {
|
|
|
12830
12865
|
}
|
|
12831
12866
|
this.addFocus(nextItem);
|
|
12832
12867
|
}
|
|
12868
|
+
moveColumn(e) {
|
|
12869
|
+
const focusedItem = this.getFocusedItem();
|
|
12870
|
+
if (isNullOrUndefined(focusedItem)) {
|
|
12871
|
+
return;
|
|
12872
|
+
}
|
|
12873
|
+
const isHeaderFocused = focusedItem.classList.contains('e-headercell');
|
|
12874
|
+
const isRowFocused = focusedItem.classList.contains('e-row');
|
|
12875
|
+
const isCellFocused = focusedItem.classList.contains('e-rowcell');
|
|
12876
|
+
if (!isHeaderFocused && !isRowFocused && !isCellFocused) {
|
|
12877
|
+
return;
|
|
12878
|
+
}
|
|
12879
|
+
if (isHeaderFocused) {
|
|
12880
|
+
const headers = Array.from(this.element.querySelectorAll('th.e-headercell:not(.e-fe-checkbox)'));
|
|
12881
|
+
const currentIndex = headers.indexOf(focusedItem);
|
|
12882
|
+
if (currentIndex === -1) {
|
|
12883
|
+
return;
|
|
12884
|
+
}
|
|
12885
|
+
const nextIndex = this.getNextColumnIndex(currentIndex, headers.length, e.action === 'moveRight');
|
|
12886
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
12887
|
+
const headerElement = headers[nextIndex];
|
|
12888
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
12889
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
12890
|
+
headerElement.setAttribute('tabindex', '0');
|
|
12891
|
+
headerElement.focus();
|
|
12892
|
+
addClass([headerElement], [FOCUS, FOCUSED]);
|
|
12893
|
+
}
|
|
12894
|
+
else if (isRowFocused || isCellFocused) {
|
|
12895
|
+
const row = (isRowFocused ? focusedItem : focusedItem.parentElement);
|
|
12896
|
+
if (!isRowFocused && (!row || !row.classList.contains('e-row'))) {
|
|
12897
|
+
return;
|
|
12898
|
+
}
|
|
12899
|
+
const cells = Array.from(row.querySelectorAll('.e-rowcell'));
|
|
12900
|
+
if (cells.length === 0) {
|
|
12901
|
+
return;
|
|
12902
|
+
}
|
|
12903
|
+
const currentCellIndex = this.currentColumnIndex || 0;
|
|
12904
|
+
const nextColumnIndex = this.getNextColumnIndex(currentCellIndex, cells.length, e.action === 'moveRight');
|
|
12905
|
+
this.currentColumnIndex = nextColumnIndex;
|
|
12906
|
+
if (isRowFocused) {
|
|
12907
|
+
removeClass([row], [FOCUS, FOCUSED]);
|
|
12908
|
+
row.setAttribute('tabindex', '-1');
|
|
12909
|
+
}
|
|
12910
|
+
else {
|
|
12911
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
12912
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
12913
|
+
}
|
|
12914
|
+
this.clearCellFocus(cells);
|
|
12915
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
12916
|
+
const nextCell = cells[nextColumnIndex];
|
|
12917
|
+
nextCell.setAttribute('tabindex', '0');
|
|
12918
|
+
addClass([nextCell], [FOCUS, FOCUSED]);
|
|
12919
|
+
nextCell.focus();
|
|
12920
|
+
}
|
|
12921
|
+
}
|
|
12922
|
+
clearCellFocus(cells) {
|
|
12923
|
+
for (let i = 0; i < cells.length; i++) {
|
|
12924
|
+
cells[i].setAttribute('tabindex', '-1');
|
|
12925
|
+
removeClass([cells[i]], [FOCUS, FOCUSED]);
|
|
12926
|
+
}
|
|
12927
|
+
}
|
|
12928
|
+
getNextColumnIndex(currentIndex, maxLength, isRight) {
|
|
12929
|
+
if (isRight) {
|
|
12930
|
+
return Math.min(currentIndex + 1, maxLength - 1);
|
|
12931
|
+
}
|
|
12932
|
+
return Math.max(currentIndex - 1, 0);
|
|
12933
|
+
}
|
|
12833
12934
|
checkRowsKey(items, indexValue, focIndex, e) {
|
|
12834
12935
|
if (this.gridObj.checkAllRows === 'Uncheck' || this.gridObj.checkAllRows === 'Intermediate') {
|
|
12835
12936
|
if (e.action !== 'csHome' && e.action !== 'csEnd') {
|
|
@@ -12915,18 +13016,58 @@ class DetailsView {
|
|
|
12915
13016
|
if (fItem) {
|
|
12916
13017
|
fItem.removeAttribute('tabindex');
|
|
12917
13018
|
removeClass([fItem], [FOCUS, FOCUSED]);
|
|
13019
|
+
if (fItem.classList.contains('e-rowcell')) {
|
|
13020
|
+
const parentRow = fItem.parentElement;
|
|
13021
|
+
if (parentRow) {
|
|
13022
|
+
removeClass([parentRow], [FOCUS, FOCUSED]);
|
|
13023
|
+
parentRow.removeAttribute('tabindex');
|
|
13024
|
+
}
|
|
13025
|
+
}
|
|
13026
|
+
if (fItem.classList.contains('e-row')) {
|
|
13027
|
+
const focusedCells = fItem.querySelectorAll('.e-rowcell');
|
|
13028
|
+
for (let i = 0; i < focusedCells.length; i++) {
|
|
13029
|
+
if (focusedCells[i].classList.contains('e-focus') || focusedCells[i].classList.contains('e-focused')) {
|
|
13030
|
+
focusedCells[i].removeAttribute('tabindex');
|
|
13031
|
+
removeClass([focusedCells[i]], [FOCUS, FOCUSED]);
|
|
13032
|
+
}
|
|
13033
|
+
}
|
|
13034
|
+
}
|
|
12918
13035
|
}
|
|
12919
13036
|
if (!isNullOrUndefined(itemElement)) {
|
|
12920
13037
|
this.gridObj.element.setAttribute('tabindex', '-1');
|
|
12921
|
-
itemElement
|
|
12922
|
-
|
|
12923
|
-
|
|
13038
|
+
const targetRow = itemElement;
|
|
13039
|
+
targetRow.setAttribute('tabindex', '0');
|
|
13040
|
+
const cells = targetRow.querySelectorAll('.e-rowcell');
|
|
13041
|
+
this.clearCellFocus(Array.from(cells));
|
|
13042
|
+
targetRow.focus();
|
|
13043
|
+
addClass([targetRow], [FOCUS, FOCUSED]);
|
|
13044
|
+
this.currentColumnIndex = 0;
|
|
12924
13045
|
}
|
|
12925
13046
|
}
|
|
12926
13047
|
addHeaderFocus(e) {
|
|
12927
13048
|
const treeFocus = select('.e-row', this.element);
|
|
12928
13049
|
this.gridObj.element.setAttribute('tabindex', '-1');
|
|
13050
|
+
const isHeaderFocused = this.getFocusedItem();
|
|
12929
13051
|
let nameFocus;
|
|
13052
|
+
const focusedRow = select('.e-row.e-focus', this.element);
|
|
13053
|
+
let gridIconCell;
|
|
13054
|
+
if (!isNullOrUndefined(focusedRow) && this.isTabKeypressed) {
|
|
13055
|
+
gridIconCell = select('.e-rowcell.e-fe-grid-icon', focusedRow);
|
|
13056
|
+
}
|
|
13057
|
+
else {
|
|
13058
|
+
if (this.isTabKeypressed) {
|
|
13059
|
+
const activeCell = this.getFocusedItem();
|
|
13060
|
+
if (activeCell && activeCell.classList.contains('e-rowcell')) {
|
|
13061
|
+
gridIconCell = select('.e-rowcell.e-fe-grid-icon', activeCell.closest('.e-row'));
|
|
13062
|
+
}
|
|
13063
|
+
else {
|
|
13064
|
+
gridIconCell = select('.e-rowcell.e-fe-grid-icon', this.element);
|
|
13065
|
+
}
|
|
13066
|
+
}
|
|
13067
|
+
}
|
|
13068
|
+
if (this.tryNavigateToNextCellInRow(focusedRow, gridIconCell, isHeaderFocused)) {
|
|
13069
|
+
return;
|
|
13070
|
+
}
|
|
12930
13071
|
if (!isNullOrUndefined(e.target) && e.target.classList.contains('e-defaultcursor')) {
|
|
12931
13072
|
this.addFocus(0);
|
|
12932
13073
|
nameFocus = e.target.nextElementSibling;
|
|
@@ -12948,6 +13089,147 @@ class DetailsView {
|
|
|
12948
13089
|
}
|
|
12949
13090
|
}
|
|
12950
13091
|
}
|
|
13092
|
+
tryNavigateToNextCellInRow(focusedRow, gridIconCell, isHeaderFocused) {
|
|
13093
|
+
if ((!isNullOrUndefined(focusedRow) || !isNullOrUndefined(gridIconCell)) && (!isNullOrUndefined(isHeaderFocused) && !isHeaderFocused.classList.contains('e-headercell'))) {
|
|
13094
|
+
if (!isNullOrUndefined(gridIconCell)) {
|
|
13095
|
+
const activeCell = this.getFocusedItem();
|
|
13096
|
+
if (activeCell && activeCell.classList.contains('e-rowcell')) {
|
|
13097
|
+
const row = activeCell.parentElement;
|
|
13098
|
+
const cells = row ? Array.from(row.querySelectorAll('.e-rowcell')) : [];
|
|
13099
|
+
const currentIndex = cells.indexOf(activeCell);
|
|
13100
|
+
const nextIndex = currentIndex + 1;
|
|
13101
|
+
if (nextIndex < cells.length) {
|
|
13102
|
+
this.currentColumnIndex = nextIndex;
|
|
13103
|
+
activeCell.setAttribute('tabindex', '-1');
|
|
13104
|
+
removeClass([activeCell], [FOCUS, FOCUSED]);
|
|
13105
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
13106
|
+
const nextCell = cells[nextIndex];
|
|
13107
|
+
nextCell.setAttribute('tabindex', '0');
|
|
13108
|
+
addClass([nextCell], [FOCUS, FOCUSED]);
|
|
13109
|
+
nextCell.focus();
|
|
13110
|
+
return true;
|
|
13111
|
+
}
|
|
13112
|
+
else {
|
|
13113
|
+
const currentRow = activeCell.parentElement;
|
|
13114
|
+
const rows = this.gridObj.getRows();
|
|
13115
|
+
const currentRowIndex = rows.indexOf(currentRow);
|
|
13116
|
+
if (currentRowIndex !== -1) {
|
|
13117
|
+
const nextRow = this.gridObj.getRowByIndex(currentRowIndex + 1);
|
|
13118
|
+
if (!isNullOrUndefined(nextRow)) {
|
|
13119
|
+
activeCell.setAttribute('tabindex', '-1');
|
|
13120
|
+
removeClass([activeCell], [FOCUS, FOCUSED]);
|
|
13121
|
+
this.addFocus(currentRowIndex + 1);
|
|
13122
|
+
return true;
|
|
13123
|
+
}
|
|
13124
|
+
else {
|
|
13125
|
+
activeCell.setAttribute('tabindex', '-1');
|
|
13126
|
+
removeClass([activeCell], [FOCUS, FOCUSED]);
|
|
13127
|
+
activeCell.blur();
|
|
13128
|
+
return true;
|
|
13129
|
+
}
|
|
13130
|
+
}
|
|
13131
|
+
return false;
|
|
13132
|
+
}
|
|
13133
|
+
}
|
|
13134
|
+
const focusedRow = this.getFocusedItem();
|
|
13135
|
+
if (!isNullOrUndefined(focusedRow) && focusedRow.classList.contains('e-row')) {
|
|
13136
|
+
focusedRow.setAttribute('tabindex', '-1');
|
|
13137
|
+
removeClass([focusedRow], [FOCUS, FOCUSED]);
|
|
13138
|
+
}
|
|
13139
|
+
gridIconCell.setAttribute('tabindex', '0');
|
|
13140
|
+
addClass([gridIconCell], [FOCUS, FOCUSED]);
|
|
13141
|
+
gridIconCell.focus();
|
|
13142
|
+
return true;
|
|
13143
|
+
}
|
|
13144
|
+
}
|
|
13145
|
+
return false;
|
|
13146
|
+
}
|
|
13147
|
+
handleReverseTabNavigation(e) {
|
|
13148
|
+
e.preventDefault();
|
|
13149
|
+
const focusedItem = this.getFocusedItem();
|
|
13150
|
+
const headers = Array.from(this.element.querySelectorAll('th.e-headercell:not(.e-fe-checkbox)'));
|
|
13151
|
+
if (headers.length === 0) {
|
|
13152
|
+
return;
|
|
13153
|
+
}
|
|
13154
|
+
if (!isNullOrUndefined(focusedItem) && focusedItem.classList.contains('e-rowcell')) {
|
|
13155
|
+
const row = focusedItem.parentElement;
|
|
13156
|
+
const cells = row ? Array.from(row.querySelectorAll('.e-rowcell:not(.e-gridchkbox)')) : [];
|
|
13157
|
+
const currentTargetIndex = cells.indexOf(focusedItem);
|
|
13158
|
+
const prevIndex = currentTargetIndex - 1;
|
|
13159
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
13160
|
+
const targetElement = prevIndex >= 0 ? cells[prevIndex] : row;
|
|
13161
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13162
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13163
|
+
targetElement.setAttribute('tabindex', '0');
|
|
13164
|
+
addClass([targetElement], [FOCUS, FOCUSED]);
|
|
13165
|
+
targetElement.focus();
|
|
13166
|
+
return;
|
|
13167
|
+
}
|
|
13168
|
+
if (!isNullOrUndefined(focusedItem) && focusedItem.classList.contains('e-row')) {
|
|
13169
|
+
const rows = this.gridObj.getRows();
|
|
13170
|
+
const currentRowIndex = rows.indexOf(focusedItem);
|
|
13171
|
+
if (currentRowIndex > 0) {
|
|
13172
|
+
const previousRow = rows[currentRowIndex - 1];
|
|
13173
|
+
const previousRowCells = Array.from(previousRow.querySelectorAll('.e-rowcell:not(.e-gridchkbox)'));
|
|
13174
|
+
const lastCell = previousRowCells[previousRowCells.length - 1];
|
|
13175
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13176
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13177
|
+
lastCell.setAttribute('tabindex', '0');
|
|
13178
|
+
addClass([lastCell], [FOCUS, FOCUSED]);
|
|
13179
|
+
lastCell.focus();
|
|
13180
|
+
return;
|
|
13181
|
+
}
|
|
13182
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13183
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13184
|
+
this.moveFocusToHeader(headers[headers.length - 1]);
|
|
13185
|
+
return;
|
|
13186
|
+
}
|
|
13187
|
+
if (!isNullOrUndefined(focusedItem) && focusedItem.classList.contains('e-headercell')) {
|
|
13188
|
+
const currentIndex = headers.indexOf(focusedItem);
|
|
13189
|
+
if (currentIndex > 0) {
|
|
13190
|
+
this.moveFocusToHeader(headers[currentIndex - 1]);
|
|
13191
|
+
}
|
|
13192
|
+
else if (currentIndex === 0) {
|
|
13193
|
+
this.clearDetailsFocus();
|
|
13194
|
+
}
|
|
13195
|
+
return;
|
|
13196
|
+
}
|
|
13197
|
+
if (!isNullOrUndefined(focusedItem)) {
|
|
13198
|
+
this.moveFocusToHeader(headers[headers.length - 1]);
|
|
13199
|
+
}
|
|
13200
|
+
}
|
|
13201
|
+
moveFocusToHeader(header) {
|
|
13202
|
+
const focusedItem = this.getFocusedItem();
|
|
13203
|
+
if (!isNullOrUndefined(focusedItem)) {
|
|
13204
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13205
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13206
|
+
}
|
|
13207
|
+
header.setAttribute('tabindex', '0');
|
|
13208
|
+
header.focus();
|
|
13209
|
+
addClass([header], [FOCUS, FOCUSED]);
|
|
13210
|
+
}
|
|
13211
|
+
clearDetailsFocus() {
|
|
13212
|
+
const focusedItem = this.getFocusedItem();
|
|
13213
|
+
if (!isNullOrUndefined(focusedItem)) {
|
|
13214
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13215
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13216
|
+
}
|
|
13217
|
+
const breadcrumbBar = select('.' + BREADCRUMBS, this.parent.element);
|
|
13218
|
+
if (!isNullOrUndefined(breadcrumbBar)) {
|
|
13219
|
+
const searchInput = breadcrumbBar.querySelector('input[aria-label="Search"]');
|
|
13220
|
+
if (!isNullOrUndefined(searchInput)) {
|
|
13221
|
+
searchInput.setAttribute('tabindex', '0');
|
|
13222
|
+
searchInput.focus();
|
|
13223
|
+
}
|
|
13224
|
+
else {
|
|
13225
|
+
const lastBreadcrumb = breadcrumbBar.querySelector('.e-address-list-item:last-child');
|
|
13226
|
+
if (!isNullOrUndefined(lastBreadcrumb)) {
|
|
13227
|
+
lastBreadcrumb.setAttribute('tabindex', '0');
|
|
13228
|
+
lastBreadcrumb.focus();
|
|
13229
|
+
}
|
|
13230
|
+
}
|
|
13231
|
+
}
|
|
13232
|
+
}
|
|
12951
13233
|
getFocusedItem() {
|
|
12952
13234
|
return select('.' + FOCUSED, this.element);
|
|
12953
13235
|
}
|