Skip to content

Commit a004ca9

Browse files
authored
Merge branch 'master' into mevtimov/feat-7344-master
2 parents 57ad8ae + aeeeeeb commit a004ca9

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

projects/igniteui-angular/src/lib/core/utils.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,9 @@ export interface CancelableBrowserEventArgs extends CancelableEventArgs {
354354
event?: Event;
355355
}
356356

357-
export interface IBaseCancelableBrowserEventArgs extends CancelableBrowserEventArgs, IBaseEventArgs {}
357+
export interface IBaseCancelableBrowserEventArgs extends CancelableBrowserEventArgs, IBaseEventArgs { }
358358

359-
export interface IBaseCancelableEventArgs extends CancelableEventArgs, IBaseEventArgs {}
359+
export interface IBaseCancelableEventArgs extends CancelableEventArgs, IBaseEventArgs { }
360360

361361
export const HORIZONTAL_NAV_KEYS = new Set(['arrowleft', 'left', 'arrowright', 'right', 'home', 'end']);
362362

@@ -377,7 +377,8 @@ export const NAVIGATION_KEYS = new Set([
377377
]);
378378
export const ROW_EXPAND_KEYS = new Set('right down arrowright arrowdown'.split(' '));
379379
export const ROW_COLLAPSE_KEYS = new Set('left up arrowleft arrowup'.split(' '));
380-
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup', '+', 'add']);
380+
export const ROW_ADD_KEYS = new Set(['+', 'add', '≠', '±', '=']);
381+
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), ...Array.from(ROW_ADD_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup']);
381382
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc' , 'l',
382383
/** This symbol corresponds to the Alt + L combination under MAC. */
383384
'¬']);
@@ -492,7 +493,7 @@ export function yieldingLoop(count: number, chunkSize: number, callback: (index:
492493
let i = 0;
493494
const chunk = () => {
494495
const end = Math.min(i + chunkSize, count);
495-
for ( ; i < end; ++i) {
496+
for (; i < end; ++i) {
496497
callback(i);
497498
}
498499
if (i < count) {

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { first } from 'rxjs/operators';
33
import { IgxForOfDirective } from '../directives/for-of/for_of.directive';
44
import { GridType } from './common/grid.interface';
5-
import { NAVIGATION_KEYS, ROW_COLLAPSE_KEYS, ROW_EXPAND_KEYS, SUPPORTED_KEYS, HORIZONTAL_NAV_KEYS, HEADER_KEYS, isEdge } from '../core/utils';
5+
import { NAVIGATION_KEYS, ROW_COLLAPSE_KEYS, ROW_EXPAND_KEYS, SUPPORTED_KEYS, HORIZONTAL_NAV_KEYS, HEADER_KEYS, ROW_ADD_KEYS, isEdge } from '../core/utils';
66
import { IgxGridBaseDirective } from './grid-base.directive';
77
import { IMultiRowLayoutNode } from './selection/selection.service';
88
import { GridKeydownTargetType, GridSelectionMode, FilterMode } from './common/enums';
@@ -93,7 +93,7 @@ export class IgxGridNavigationService {
9393
this.grid.verticalScrollContainer.onChunkLoad
9494
.pipe(first()).subscribe(() => {
9595
if (editCell && this.grid.rowList.map(r => r.index).indexOf(editCell.rowIndex) < 0) {
96-
this.grid.tbody.nativeElement.focus({preventScroll: true});
96+
this.grid.tbody.nativeElement.focus({ preventScroll: true });
9797
}
9898
});
9999
break;
@@ -655,6 +655,6 @@ export class IgxGridNavigationService {
655655
}
656656

657657
private isAddKey(key: string): boolean {
658-
return key === '+' || key === 'add'; // add is for IE and Edge
658+
return ROW_ADD_KEYS.has(key);
659659
}
660660
}

src/app/grid-add-row/grid-add-row.sample.html

+2
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@
2929
<igx-grid-editing-actions [addRow]="true"></igx-grid-editing-actions>
3030
</igx-action-strip>
3131
</igx-grid>
32+
33+
<button igxButton="raised" (click)="data = data.length ? [] : dataFull">Switch Data/No Data</button>
3234
</div>

src/app/grid-add-row/grid-add-row.sample.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class GridAddRowSampleComponent implements OnInit {
1212
public result: string;
1313

1414
data: any[];
15+
dataFull: any[];
1516
columns: any[];
1617
onMouseOver(event, grid, actionStrip) {
1718
if (event.target.nodeName.toLowerCase() === 'igx-grid-cell') {
@@ -35,7 +36,7 @@ export class GridAddRowSampleComponent implements OnInit {
3536
{ field: 'ContactTitle', width: '300px', pinned: false }
3637
];
3738

38-
this.data = [
39+
this.dataFull = [
3940
// tslint:disable:max-line-length
4041
{ 'ID': 'ALFKI', 'CompanyName': 'Alfreds Futterkiste', 'ContactName': 'Maria Anders', 'ContactTitle': 'Sales Representative'},
4142
{ 'ID': 'ANATR', 'CompanyName': 'Ana Trujillo Emparedados y helados', 'ContactName': 'Ana Trujillo', 'ContactTitle': 'Owner'},

0 commit comments

Comments
 (0)