@syncfusion/ej2-filemanager 33.2.10 → 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 +286 -7
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +286 -7
- 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 +4 -4
- package/src/file-manager/layout/details-view.d.ts +10 -0
- package/src/file-manager/layout/details-view.js +286 -7
- package/styles/bds-lite.css +0 -4
- package/styles/bds.css +0 -4
- 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 +0 -4
- package/styles/bootstrap4.css +0 -4
- package/styles/bootstrap5-dark-lite.css +0 -4
- package/styles/bootstrap5-dark.css +0 -4
- package/styles/bootstrap5-lite.css +0 -4
- package/styles/bootstrap5.3-lite.css +0 -4
- package/styles/bootstrap5.3.css +0 -4
- package/styles/bootstrap5.css +0 -4
- package/styles/fabric-dark-lite.css +0 -4
- package/styles/fabric-dark.css +0 -4
- package/styles/fabric-lite.css +0 -4
- package/styles/fabric.css +0 -4
- package/styles/file-manager/_layout.scss +0 -1
- package/styles/file-manager/bds.css +0 -4
- package/styles/file-manager/bootstrap-dark.css +0 -4
- package/styles/file-manager/bootstrap.css +0 -4
- package/styles/file-manager/bootstrap4.css +0 -4
- package/styles/file-manager/bootstrap5-dark.css +0 -4
- package/styles/file-manager/bootstrap5.3.css +0 -4
- package/styles/file-manager/bootstrap5.css +0 -4
- package/styles/file-manager/fabric-dark.css +0 -4
- package/styles/file-manager/fabric.css +0 -4
- package/styles/file-manager/fluent-dark.css +0 -4
- package/styles/file-manager/fluent.css +0 -4
- 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 +0 -4
- package/styles/file-manager/material.css +0 -4
- package/styles/file-manager/material3-dark.css +0 -4
- package/styles/file-manager/material3.css +0 -4
- package/styles/file-manager/tailwind-dark.css +0 -4
- package/styles/file-manager/tailwind.css +0 -4
- package/styles/file-manager/tailwind3.css +0 -4
- package/styles/fluent-dark-lite.css +0 -4
- package/styles/fluent-dark.css +0 -4
- package/styles/fluent-lite.css +0 -4
- package/styles/fluent.css +0 -4
- 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 +0 -4
- package/styles/material-dark.css +0 -4
- package/styles/material-lite.css +0 -4
- package/styles/material.css +0 -4
- 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 +0 -4
- package/styles/tailwind-dark.css +0 -4
- package/styles/tailwind-lite.css +0 -4
- package/styles/tailwind.css +0 -4
- package/styles/tailwind3-lite.css +0 -4
- package/styles/tailwind3.css +0 -4
|
@@ -11364,6 +11364,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
11364
11364
|
this.dragObj = null;
|
|
11365
11365
|
this.startIndex = null;
|
|
11366
11366
|
this.firstItemIndex = null;
|
|
11367
|
+
this.currentColumnIndex = 0;
|
|
11367
11368
|
this.isSelectionUpdate = false;
|
|
11368
11369
|
this.currentSelectedItem = [];
|
|
11369
11370
|
this.count = 0;
|
|
@@ -11371,6 +11372,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
11371
11372
|
this.isLoaded = false;
|
|
11372
11373
|
this.isNameWidth = false;
|
|
11373
11374
|
this.isMultiSelect = false;
|
|
11375
|
+
this.isTabKeypressed = false;
|
|
11374
11376
|
this.pasteOperation = false;
|
|
11375
11377
|
this.uploadOperation = false;
|
|
11376
11378
|
this.nextFocusIndex = null;
|
|
@@ -11382,6 +11384,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
11382
11384
|
altEnter: 'alt+enter',
|
|
11383
11385
|
esc: 'escape',
|
|
11384
11386
|
tab: 'tab',
|
|
11387
|
+
shiftTab: 'shift+tab',
|
|
11385
11388
|
moveDown: 'downarrow',
|
|
11386
11389
|
ctrlEnd: 'ctrl+end',
|
|
11387
11390
|
ctrlHome: 'ctrl+home',
|
|
@@ -11404,6 +11407,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
11404
11407
|
end: 'end',
|
|
11405
11408
|
home: 'home',
|
|
11406
11409
|
moveUp: 'uparrow',
|
|
11410
|
+
moveLeft: 'leftarrow',
|
|
11411
|
+
moveRight: 'rightarrow',
|
|
11407
11412
|
del: 'delete',
|
|
11408
11413
|
ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
|
|
11409
11414
|
ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
|
|
@@ -12741,8 +12746,21 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
12741
12746
|
}
|
|
12742
12747
|
};
|
|
12743
12748
|
DetailsView.prototype.getFocusedItemIndex = function () {
|
|
12744
|
-
|
|
12745
|
-
|
|
12749
|
+
var focusedItem = this.getFocusedItem();
|
|
12750
|
+
if (isNullOrUndefined(focusedItem)) {
|
|
12751
|
+
return null;
|
|
12752
|
+
}
|
|
12753
|
+
if (focusedItem.classList.contains('e-rowcell')) {
|
|
12754
|
+
return this.getRowIndexFromParent(focusedItem);
|
|
12755
|
+
}
|
|
12756
|
+
return parseInt(focusedItem.getAttribute('aria-rowindex'), 10) - 1;
|
|
12757
|
+
};
|
|
12758
|
+
DetailsView.prototype.getRowIndexFromParent = function (focusedItem) {
|
|
12759
|
+
var parentRow = focusedItem.parentElement;
|
|
12760
|
+
if (parentRow && parentRow.classList.contains('e-row')) {
|
|
12761
|
+
return parseInt(parentRow.getAttribute('aria-rowindex'), 10) - 1;
|
|
12762
|
+
}
|
|
12763
|
+
return null;
|
|
12746
12764
|
};
|
|
12747
12765
|
/* istanbul ignore next */
|
|
12748
12766
|
DetailsView.prototype.keydownHandler = function (e) {
|
|
@@ -12771,6 +12789,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
12771
12789
|
case 'ctrlLeft':
|
|
12772
12790
|
case 'shiftLeft':
|
|
12773
12791
|
case 'csLeft':
|
|
12792
|
+
case 'tab':
|
|
12793
|
+
case 'shiftTab':
|
|
12774
12794
|
case 'esc':
|
|
12775
12795
|
case 'del':
|
|
12776
12796
|
case 'shiftdel':
|
|
@@ -12780,6 +12800,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
12780
12800
|
case 'f2':
|
|
12781
12801
|
case 'moveDown':
|
|
12782
12802
|
case 'moveUp':
|
|
12803
|
+
case 'moveLeft':
|
|
12804
|
+
case 'moveRight':
|
|
12783
12805
|
case 'ctrlD':
|
|
12784
12806
|
e.preventDefault();
|
|
12785
12807
|
break;
|
|
@@ -12860,12 +12882,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
12860
12882
|
break;
|
|
12861
12883
|
case 'ctrlHome':
|
|
12862
12884
|
case 'tab':
|
|
12885
|
+
case 'shiftTab':
|
|
12863
12886
|
if (!isNullOrUndefined(gridItems[0])) {
|
|
12864
12887
|
if (!this.parent.allowMultiSelection && e.action === 'ctrlHome') {
|
|
12865
12888
|
this.gridObj.selectRow(0);
|
|
12866
12889
|
}
|
|
12867
|
-
else if (
|
|
12868
|
-
|
|
12890
|
+
else if (e.action === 'shiftTab') {
|
|
12891
|
+
this.handleReverseTabNavigation(e);
|
|
12892
|
+
}
|
|
12893
|
+
else if (e.action === 'tab') {
|
|
12894
|
+
this.isTabKeypressed = true;
|
|
12895
|
+
this.addHeaderFocus(e);
|
|
12896
|
+
this.isTabKeypressed = false;
|
|
12869
12897
|
}
|
|
12870
12898
|
else {
|
|
12871
12899
|
this.addHeaderFocus(e);
|
|
@@ -12935,6 +12963,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
12935
12963
|
case 'moveDown':
|
|
12936
12964
|
this.moveFunction(gridItems, e, selIndex);
|
|
12937
12965
|
break;
|
|
12966
|
+
case 'moveLeft':
|
|
12967
|
+
case 'moveRight':
|
|
12968
|
+
this.moveColumn(e);
|
|
12969
|
+
break;
|
|
12938
12970
|
case 'end':
|
|
12939
12971
|
lastItem = [getValue(this.parent.hasId ? 'id' : 'name', gridItems[gridLength - 1])];
|
|
12940
12972
|
this.parent.setProperties({ selectedItems: lastItem }, true);
|
|
@@ -13065,6 +13097,72 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
13065
13097
|
}
|
|
13066
13098
|
this.addFocus(nextItem);
|
|
13067
13099
|
};
|
|
13100
|
+
DetailsView.prototype.moveColumn = function (e) {
|
|
13101
|
+
var focusedItem = this.getFocusedItem();
|
|
13102
|
+
if (isNullOrUndefined(focusedItem)) {
|
|
13103
|
+
return;
|
|
13104
|
+
}
|
|
13105
|
+
var isHeaderFocused = focusedItem.classList.contains('e-headercell');
|
|
13106
|
+
var isRowFocused = focusedItem.classList.contains('e-row');
|
|
13107
|
+
var isCellFocused = focusedItem.classList.contains('e-rowcell');
|
|
13108
|
+
if (!isHeaderFocused && !isRowFocused && !isCellFocused) {
|
|
13109
|
+
return;
|
|
13110
|
+
}
|
|
13111
|
+
if (isHeaderFocused) {
|
|
13112
|
+
var headers = Array.from(this.element.querySelectorAll('th.e-headercell:not(.e-fe-checkbox)'));
|
|
13113
|
+
var currentIndex = headers.indexOf(focusedItem);
|
|
13114
|
+
if (currentIndex === -1) {
|
|
13115
|
+
return;
|
|
13116
|
+
}
|
|
13117
|
+
var nextIndex = this.getNextColumnIndex(currentIndex, headers.length, e.action === 'moveRight');
|
|
13118
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
13119
|
+
var headerElement = headers[nextIndex];
|
|
13120
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13121
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13122
|
+
headerElement.setAttribute('tabindex', '0');
|
|
13123
|
+
headerElement.focus();
|
|
13124
|
+
addClass([headerElement], [FOCUS, FOCUSED]);
|
|
13125
|
+
}
|
|
13126
|
+
else if (isRowFocused || isCellFocused) {
|
|
13127
|
+
var row = (isRowFocused ? focusedItem : focusedItem.parentElement);
|
|
13128
|
+
if (!isRowFocused && (!row || !row.classList.contains('e-row'))) {
|
|
13129
|
+
return;
|
|
13130
|
+
}
|
|
13131
|
+
var cells = Array.from(row.querySelectorAll('.e-rowcell'));
|
|
13132
|
+
if (cells.length === 0) {
|
|
13133
|
+
return;
|
|
13134
|
+
}
|
|
13135
|
+
var currentCellIndex = this.currentColumnIndex || 0;
|
|
13136
|
+
var nextColumnIndex = this.getNextColumnIndex(currentCellIndex, cells.length, e.action === 'moveRight');
|
|
13137
|
+
this.currentColumnIndex = nextColumnIndex;
|
|
13138
|
+
if (isRowFocused) {
|
|
13139
|
+
removeClass([row], [FOCUS, FOCUSED]);
|
|
13140
|
+
row.setAttribute('tabindex', '-1');
|
|
13141
|
+
}
|
|
13142
|
+
else {
|
|
13143
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13144
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13145
|
+
}
|
|
13146
|
+
this.clearCellFocus(cells);
|
|
13147
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
13148
|
+
var nextCell = cells[nextColumnIndex];
|
|
13149
|
+
nextCell.setAttribute('tabindex', '0');
|
|
13150
|
+
addClass([nextCell], [FOCUS, FOCUSED]);
|
|
13151
|
+
nextCell.focus();
|
|
13152
|
+
}
|
|
13153
|
+
};
|
|
13154
|
+
DetailsView.prototype.clearCellFocus = function (cells) {
|
|
13155
|
+
for (var i = 0; i < cells.length; i++) {
|
|
13156
|
+
cells[i].setAttribute('tabindex', '-1');
|
|
13157
|
+
removeClass([cells[i]], [FOCUS, FOCUSED]);
|
|
13158
|
+
}
|
|
13159
|
+
};
|
|
13160
|
+
DetailsView.prototype.getNextColumnIndex = function (currentIndex, maxLength, isRight) {
|
|
13161
|
+
if (isRight) {
|
|
13162
|
+
return Math.min(currentIndex + 1, maxLength - 1);
|
|
13163
|
+
}
|
|
13164
|
+
return Math.max(currentIndex - 1, 0);
|
|
13165
|
+
};
|
|
13068
13166
|
DetailsView.prototype.checkRowsKey = function (items, indexValue, focIndex, e) {
|
|
13069
13167
|
if (this.gridObj.checkAllRows === 'Uncheck' || this.gridObj.checkAllRows === 'Intermediate') {
|
|
13070
13168
|
if (e.action !== 'csHome' && e.action !== 'csEnd') {
|
|
@@ -13150,18 +13248,58 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
13150
13248
|
if (fItem) {
|
|
13151
13249
|
fItem.removeAttribute('tabindex');
|
|
13152
13250
|
removeClass([fItem], [FOCUS, FOCUSED]);
|
|
13251
|
+
if (fItem.classList.contains('e-rowcell')) {
|
|
13252
|
+
var parentRow = fItem.parentElement;
|
|
13253
|
+
if (parentRow) {
|
|
13254
|
+
removeClass([parentRow], [FOCUS, FOCUSED]);
|
|
13255
|
+
parentRow.removeAttribute('tabindex');
|
|
13256
|
+
}
|
|
13257
|
+
}
|
|
13258
|
+
if (fItem.classList.contains('e-row')) {
|
|
13259
|
+
var focusedCells = fItem.querySelectorAll('.e-rowcell');
|
|
13260
|
+
for (var i = 0; i < focusedCells.length; i++) {
|
|
13261
|
+
if (focusedCells[i].classList.contains('e-focus') || focusedCells[i].classList.contains('e-focused')) {
|
|
13262
|
+
focusedCells[i].removeAttribute('tabindex');
|
|
13263
|
+
removeClass([focusedCells[i]], [FOCUS, FOCUSED]);
|
|
13264
|
+
}
|
|
13265
|
+
}
|
|
13266
|
+
}
|
|
13153
13267
|
}
|
|
13154
13268
|
if (!isNullOrUndefined(itemElement)) {
|
|
13155
13269
|
this.gridObj.element.setAttribute('tabindex', '-1');
|
|
13156
|
-
itemElement
|
|
13157
|
-
|
|
13158
|
-
|
|
13270
|
+
var targetRow = itemElement;
|
|
13271
|
+
targetRow.setAttribute('tabindex', '0');
|
|
13272
|
+
var cells = targetRow.querySelectorAll('.e-rowcell');
|
|
13273
|
+
this.clearCellFocus(Array.from(cells));
|
|
13274
|
+
targetRow.focus();
|
|
13275
|
+
addClass([targetRow], [FOCUS, FOCUSED]);
|
|
13276
|
+
this.currentColumnIndex = 0;
|
|
13159
13277
|
}
|
|
13160
13278
|
};
|
|
13161
13279
|
DetailsView.prototype.addHeaderFocus = function (e) {
|
|
13162
13280
|
var treeFocus = select('.e-row', this.element);
|
|
13163
13281
|
this.gridObj.element.setAttribute('tabindex', '-1');
|
|
13282
|
+
var isHeaderFocused = this.getFocusedItem();
|
|
13164
13283
|
var nameFocus;
|
|
13284
|
+
var focusedRow = select('.e-row.e-focus', this.element);
|
|
13285
|
+
var gridIconCell;
|
|
13286
|
+
if (!isNullOrUndefined(focusedRow) && this.isTabKeypressed) {
|
|
13287
|
+
gridIconCell = select('.e-rowcell.e-fe-grid-icon', focusedRow);
|
|
13288
|
+
}
|
|
13289
|
+
else {
|
|
13290
|
+
if (this.isTabKeypressed) {
|
|
13291
|
+
var activeCell = this.getFocusedItem();
|
|
13292
|
+
if (activeCell && activeCell.classList.contains('e-rowcell')) {
|
|
13293
|
+
gridIconCell = select('.e-rowcell.e-fe-grid-icon', activeCell.closest('.e-row'));
|
|
13294
|
+
}
|
|
13295
|
+
else {
|
|
13296
|
+
gridIconCell = select('.e-rowcell.e-fe-grid-icon', this.element);
|
|
13297
|
+
}
|
|
13298
|
+
}
|
|
13299
|
+
}
|
|
13300
|
+
if (this.tryNavigateToNextCellInRow(focusedRow, gridIconCell, isHeaderFocused)) {
|
|
13301
|
+
return;
|
|
13302
|
+
}
|
|
13165
13303
|
if (!isNullOrUndefined(e.target) && e.target.classList.contains('e-defaultcursor')) {
|
|
13166
13304
|
this.addFocus(0);
|
|
13167
13305
|
nameFocus = e.target.nextElementSibling;
|
|
@@ -13183,6 +13321,147 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
|
13183
13321
|
}
|
|
13184
13322
|
}
|
|
13185
13323
|
};
|
|
13324
|
+
DetailsView.prototype.tryNavigateToNextCellInRow = function (focusedRow, gridIconCell, isHeaderFocused) {
|
|
13325
|
+
if ((!isNullOrUndefined(focusedRow) || !isNullOrUndefined(gridIconCell)) && (!isNullOrUndefined(isHeaderFocused) && !isHeaderFocused.classList.contains('e-headercell'))) {
|
|
13326
|
+
if (!isNullOrUndefined(gridIconCell)) {
|
|
13327
|
+
var activeCell = this.getFocusedItem();
|
|
13328
|
+
if (activeCell && activeCell.classList.contains('e-rowcell')) {
|
|
13329
|
+
var row = activeCell.parentElement;
|
|
13330
|
+
var cells = row ? Array.from(row.querySelectorAll('.e-rowcell')) : [];
|
|
13331
|
+
var currentIndex = cells.indexOf(activeCell);
|
|
13332
|
+
var nextIndex = currentIndex + 1;
|
|
13333
|
+
if (nextIndex < cells.length) {
|
|
13334
|
+
this.currentColumnIndex = nextIndex;
|
|
13335
|
+
activeCell.setAttribute('tabindex', '-1');
|
|
13336
|
+
removeClass([activeCell], [FOCUS, FOCUSED]);
|
|
13337
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
13338
|
+
var nextCell = cells[nextIndex];
|
|
13339
|
+
nextCell.setAttribute('tabindex', '0');
|
|
13340
|
+
addClass([nextCell], [FOCUS, FOCUSED]);
|
|
13341
|
+
nextCell.focus();
|
|
13342
|
+
return true;
|
|
13343
|
+
}
|
|
13344
|
+
else {
|
|
13345
|
+
var currentRow = activeCell.parentElement;
|
|
13346
|
+
var rows = this.gridObj.getRows();
|
|
13347
|
+
var currentRowIndex = rows.indexOf(currentRow);
|
|
13348
|
+
if (currentRowIndex !== -1) {
|
|
13349
|
+
var nextRow = this.gridObj.getRowByIndex(currentRowIndex + 1);
|
|
13350
|
+
if (!isNullOrUndefined(nextRow)) {
|
|
13351
|
+
activeCell.setAttribute('tabindex', '-1');
|
|
13352
|
+
removeClass([activeCell], [FOCUS, FOCUSED]);
|
|
13353
|
+
this.addFocus(currentRowIndex + 1);
|
|
13354
|
+
return true;
|
|
13355
|
+
}
|
|
13356
|
+
else {
|
|
13357
|
+
activeCell.setAttribute('tabindex', '-1');
|
|
13358
|
+
removeClass([activeCell], [FOCUS, FOCUSED]);
|
|
13359
|
+
activeCell.blur();
|
|
13360
|
+
return true;
|
|
13361
|
+
}
|
|
13362
|
+
}
|
|
13363
|
+
return false;
|
|
13364
|
+
}
|
|
13365
|
+
}
|
|
13366
|
+
var focusedRow_1 = this.getFocusedItem();
|
|
13367
|
+
if (!isNullOrUndefined(focusedRow_1) && focusedRow_1.classList.contains('e-row')) {
|
|
13368
|
+
focusedRow_1.setAttribute('tabindex', '-1');
|
|
13369
|
+
removeClass([focusedRow_1], [FOCUS, FOCUSED]);
|
|
13370
|
+
}
|
|
13371
|
+
gridIconCell.setAttribute('tabindex', '0');
|
|
13372
|
+
addClass([gridIconCell], [FOCUS, FOCUSED]);
|
|
13373
|
+
gridIconCell.focus();
|
|
13374
|
+
return true;
|
|
13375
|
+
}
|
|
13376
|
+
}
|
|
13377
|
+
return false;
|
|
13378
|
+
};
|
|
13379
|
+
DetailsView.prototype.handleReverseTabNavigation = function (e) {
|
|
13380
|
+
e.preventDefault();
|
|
13381
|
+
var focusedItem = this.getFocusedItem();
|
|
13382
|
+
var headers = Array.from(this.element.querySelectorAll('th.e-headercell:not(.e-fe-checkbox)'));
|
|
13383
|
+
if (headers.length === 0) {
|
|
13384
|
+
return;
|
|
13385
|
+
}
|
|
13386
|
+
if (!isNullOrUndefined(focusedItem) && focusedItem.classList.contains('e-rowcell')) {
|
|
13387
|
+
var row = focusedItem.parentElement;
|
|
13388
|
+
var cells = row ? Array.from(row.querySelectorAll('.e-rowcell:not(.e-gridchkbox)')) : [];
|
|
13389
|
+
var currentTargetIndex = cells.indexOf(focusedItem);
|
|
13390
|
+
var prevIndex = currentTargetIndex - 1;
|
|
13391
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
13392
|
+
var targetElement = prevIndex >= 0 ? cells[prevIndex] : row;
|
|
13393
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13394
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13395
|
+
targetElement.setAttribute('tabindex', '0');
|
|
13396
|
+
addClass([targetElement], [FOCUS, FOCUSED]);
|
|
13397
|
+
targetElement.focus();
|
|
13398
|
+
return;
|
|
13399
|
+
}
|
|
13400
|
+
if (!isNullOrUndefined(focusedItem) && focusedItem.classList.contains('e-row')) {
|
|
13401
|
+
var rows = this.gridObj.getRows();
|
|
13402
|
+
var currentRowIndex = rows.indexOf(focusedItem);
|
|
13403
|
+
if (currentRowIndex > 0) {
|
|
13404
|
+
var previousRow = rows[currentRowIndex - 1];
|
|
13405
|
+
var previousRowCells = Array.from(previousRow.querySelectorAll('.e-rowcell:not(.e-gridchkbox)'));
|
|
13406
|
+
var lastCell = previousRowCells[previousRowCells.length - 1];
|
|
13407
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13408
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13409
|
+
lastCell.setAttribute('tabindex', '0');
|
|
13410
|
+
addClass([lastCell], [FOCUS, FOCUSED]);
|
|
13411
|
+
lastCell.focus();
|
|
13412
|
+
return;
|
|
13413
|
+
}
|
|
13414
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13415
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13416
|
+
this.moveFocusToHeader(headers[headers.length - 1]);
|
|
13417
|
+
return;
|
|
13418
|
+
}
|
|
13419
|
+
if (!isNullOrUndefined(focusedItem) && focusedItem.classList.contains('e-headercell')) {
|
|
13420
|
+
var currentIndex = headers.indexOf(focusedItem);
|
|
13421
|
+
if (currentIndex > 0) {
|
|
13422
|
+
this.moveFocusToHeader(headers[currentIndex - 1]);
|
|
13423
|
+
}
|
|
13424
|
+
else if (currentIndex === 0) {
|
|
13425
|
+
this.clearDetailsFocus();
|
|
13426
|
+
}
|
|
13427
|
+
return;
|
|
13428
|
+
}
|
|
13429
|
+
if (!isNullOrUndefined(focusedItem)) {
|
|
13430
|
+
this.moveFocusToHeader(headers[headers.length - 1]);
|
|
13431
|
+
}
|
|
13432
|
+
};
|
|
13433
|
+
DetailsView.prototype.moveFocusToHeader = function (header) {
|
|
13434
|
+
var focusedItem = this.getFocusedItem();
|
|
13435
|
+
if (!isNullOrUndefined(focusedItem)) {
|
|
13436
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13437
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13438
|
+
}
|
|
13439
|
+
header.setAttribute('tabindex', '0');
|
|
13440
|
+
header.focus();
|
|
13441
|
+
addClass([header], [FOCUS, FOCUSED]);
|
|
13442
|
+
};
|
|
13443
|
+
DetailsView.prototype.clearDetailsFocus = function () {
|
|
13444
|
+
var focusedItem = this.getFocusedItem();
|
|
13445
|
+
if (!isNullOrUndefined(focusedItem)) {
|
|
13446
|
+
focusedItem.setAttribute('tabindex', '-1');
|
|
13447
|
+
removeClass([focusedItem], [FOCUS, FOCUSED]);
|
|
13448
|
+
}
|
|
13449
|
+
var breadcrumbBar = select('.' + BREADCRUMBS, this.parent.element);
|
|
13450
|
+
if (!isNullOrUndefined(breadcrumbBar)) {
|
|
13451
|
+
var searchInput = breadcrumbBar.querySelector('input[aria-label="Search"]');
|
|
13452
|
+
if (!isNullOrUndefined(searchInput)) {
|
|
13453
|
+
searchInput.setAttribute('tabindex', '0');
|
|
13454
|
+
searchInput.focus();
|
|
13455
|
+
}
|
|
13456
|
+
else {
|
|
13457
|
+
var lastBreadcrumb = breadcrumbBar.querySelector('.e-address-list-item:last-child');
|
|
13458
|
+
if (!isNullOrUndefined(lastBreadcrumb)) {
|
|
13459
|
+
lastBreadcrumb.setAttribute('tabindex', '0');
|
|
13460
|
+
lastBreadcrumb.focus();
|
|
13461
|
+
}
|
|
13462
|
+
}
|
|
13463
|
+
}
|
|
13464
|
+
};
|
|
13186
13465
|
DetailsView.prototype.getFocusedItem = function () {
|
|
13187
13466
|
return select('.' + FOCUSED, this.element);
|
|
13188
13467
|
};
|