Skip to content

Commit c14cf0b

Browse files
authored
Merge branch 'master' into update-10
2 parents e788a6a + da4cf04 commit c14cf0b

18 files changed

+372
-98
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ All notable changes for each version of this project will be documented in this
1717
### New Features
1818
- `IgxGrid`
1919
- `showGroupArea` input is added, which can be used to enable/disable the group area row.
20+
- The event arguments of `onCellEdit`, `onCellEditEnter` and `onCellEditCancel` events will contain a reference to the row data, as well as a reference to the column.
21+
- The event arguments of `onRowEdit`, `onRowEditEnter` and `onRowEditCancel` events will contain a reference to the row data.
2022

2123
- `IgxSelect` support for `igxHint` directive added.
2224
- Allows the user to add `igxHint` to be displayed bellow the input element.
2325

26+
## 9.1.4
27+
28+
### New Features
29+
- `IgxList`
30+
- Added localization support.
31+
2432
## 9.1.1
2533

2634
### General
@@ -188,7 +196,6 @@ All notable changes for each version of this project will be documented in this
188196
- Added support for tabIndex attribute applied to the main chip element.
189197
- Added `tabIndex` input so it can support change detection as well.
190198

191-
192199
- `IgxHighlightDirective`
193200
- New `metadata` property was introduced, which allows adding additional, custom logic to the activation condition of a highlighted element.
194201

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export interface IListResourceStrings {
2+
igx_list_no_items?: string;
3+
igx_list_loading?: string;
4+
}
5+
6+
export const ListResourceStringsEN: IListResourceStrings = {
7+
igx_list_no_items: 'There are no items in the list.',
8+
igx_list_loading: 'Loading data from the server...'
9+
};

projects/igniteui-angular/src/lib/core/i18n/resources.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ITimePickerResourceStrings, TimePickerResourceStringsEN } from './time-
44
import { PaginatorResourceStringsEN } from './paginator-resources';
55
import { cloneValue } from '../utils';
66
import { ICarouselResourceStrings, CarouselResourceStringsEN } from './carousel-resources';
7+
import { ListResourceStringsEN } from './list-resources';
78

89
export interface IResourceStrings extends IGridResourceStrings, ITimePickerResourceStrings, ICarouselResourceStrings {}
910

@@ -16,6 +17,7 @@ export const CurrentResourceStrings = {
1617
TimePickerResStrings: cloneValue(TimePickerResourceStringsEN),
1718
DateRangePickerResStrings: cloneValue(DateRangePickerResourceStringsEN),
1819
CarouselResStrings: cloneValue(CarouselResourceStringsEN),
20+
ListResStrings: cloneValue(ListResourceStringsEN),
1921
};
2022

2123
function updateResourceStrings(currentStrings: IResourceStrings, newStrings: IResourceStrings ) {

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,6 @@
889889
display: block;
890890
border: none;
891891
height: rem(32px, map-get($base-scale-size, 'comfortable'));
892-
line-height: 0 !important; /* resets typography styles */
893892
width: 100%;
894893
min-width: 0;
895894
overflow: visible;
@@ -900,13 +899,18 @@
900899
border-top: rem(3px) solid transparent;
901900
padding-bottom: rem(3px);
902901

902+
&:not([type='date']) {
903+
line-height: 0 !important; /* resets typography styles */
904+
}
905+
903906
&::-webkit-input-placeholder {
904907
line-height: normal;
905908
}
906909

907910
&::placeholder {
908911
color: --var($theme, 'placeholder-color');
909912
opacity: 1;
913+
line-height: normal; /* Fix placeholder position in Safari */
910914
}
911915
}
912916

projects/igniteui-angular/src/lib/directives/focus/focus.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class IgxFocusDirective {
6363
*/
6464
trigger() {
6565
if (this.focusState) {
66-
requestAnimationFrame(() => this.nativeElement.focus());
66+
requestAnimationFrame(() => this.nativeElement.focus({ preventScroll: true}));
6767
}
6868
}
6969
}

projects/igniteui-angular/src/lib/grids/api.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
144144

145145
const args = cell.createEditEventArgs();
146146

147+
// TODO: emit onCellEdit after value is updated - issue #7304
147148
this.grid.onCellEdit.emit(args);
148149
if (args.cancel) {
149150
return args;
@@ -231,6 +232,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
231232
return args;
232233
}
233234

235+
// TODO: emit onRowEdit after value is updated - issue #7304
234236
grid.onRowEdit.emit(args);
235237

236238
if (args.cancel) {

projects/igniteui-angular/src/lib/grids/common/events.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { IgxGridCellComponent } from '../cell.component';
77
import { IgxColumnComponent } from '../columns/column.component';
88
import { IgxGridBaseDirective } from '../grid-base.directive';
99
import { IgxRowDirective } from '../row.directive';
10+
import { ColumnType } from './column.interface';
1011
export { GridSelectionRange } from '../selection/selection.service';
1112

1213
export interface IGridClipboardEvent {
@@ -26,9 +27,12 @@ export interface IGridEditEventArgs extends CancelableEventArgs, IBaseEventArgs
2627
columnID: any,
2728
rowIndex: number
2829
};
30+
rowData: any;
2931
oldValue: any;
3032
newValue?: any;
3133
event?: Event;
34+
column?: ColumnType;
35+
owner?: IgxGridBaseDirective & GridType;
3236
}
3337

3438
export interface IPinColumnEventArgs extends IBaseEventArgs {

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4034,7 +4034,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
40344034
rowIndex: index
40354035
};
40364036

4037-
const cell = new IgxCell(id, index, col, rowData[col.field], rowData[col.field], rowData);
4037+
const cell = new IgxCell(id, index, col, rowData[col.field], rowData[col.field], rowData, this);
40384038
const args = this.gridAPI.update_cell(cell, value);
40394039

40404040
if (this.crudService.cell && this.crudService.sameCell(cell)) {
@@ -4069,7 +4069,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
40694069
if (editableCell && editableCell.id.rowID === rowSelector) {
40704070
this.gridAPI.escape_editMode();
40714071
}
4072-
const row = new IgxRow(rowSelector, -1, this.gridAPI.getRowData(rowSelector));
4072+
const row = new IgxRow(rowSelector, -1, this.gridAPI.getRowData(rowSelector), this);
40734073
this.gridAPI.update_row(row, value);
40744074

40754075
// TODO: fix for #5934 and probably break for #5763

projects/igniteui-angular/src/lib/grids/grid/grid-cell-editing.spec.ts

Lines changed: 105 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,21 @@ describe('IgxGrid - Cell Editing #grid', () => {
557557
it(`Should properly emit 'onCellEditEnter' event`, () => {
558558
spyOn(grid.onCellEditEnter, 'emit').and.callThrough();
559559
let cell = grid.getCellByColumn(0, 'fullName');
560+
let initialRowData = {...cell.rowData};
560561
expect(cell.editMode).toBeFalsy();
561562

562563
UIInteractions.simulateDoubleClickAndSelectEvent(cell);
563564
fixture.detectChanges();
564565

565-
let cellArgs: IGridEditEventArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 'John Brown', cancel: false };
566+
let cellArgs: IGridEditEventArgs = {
567+
rowID: cell.row.rowID,
568+
cellID: cell.cellID,
569+
rowData: initialRowData,
570+
oldValue: 'John Brown',
571+
cancel: false,
572+
column: cell.column,
573+
owner: grid
574+
};
566575
expect(grid.onCellEditEnter.emit).toHaveBeenCalledTimes(1);
567576
expect(grid.onCellEditEnter.emit).toHaveBeenCalledWith(cellArgs);
568577
expect(cell.editMode).toBeTruthy();
@@ -573,7 +582,16 @@ describe('IgxGrid - Cell Editing #grid', () => {
573582

574583
expect(cell.editMode).toBeFalsy();
575584
cell = grid.getCellByColumn(0, 'age');
576-
cellArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 20, cancel: false };
585+
initialRowData = {...cell.rowData};
586+
cellArgs = {
587+
cellID: cell.cellID,
588+
rowID: cell.row.rowID,
589+
rowData: initialRowData,
590+
oldValue: 20,
591+
cancel: false,
592+
column: cell.column,
593+
owner: grid
594+
};
577595
expect(grid.onCellEditEnter.emit).toHaveBeenCalledTimes(2);
578596
expect(grid.onCellEditEnter.emit).toHaveBeenCalledWith(cellArgs);
579597
expect(cell.editMode).toBeTruthy();
@@ -585,25 +603,43 @@ describe('IgxGrid - Cell Editing #grid', () => {
585603
e.cancel = true;
586604
});
587605
let cell = grid.getCellByColumn(0, 'fullName');
606+
let initialRowData = {...cell.rowData};
588607
expect(cell.editMode).toBeFalsy();
589608

590609
UIInteractions.simulateDoubleClickAndSelectEvent(cell);
591610
fixture.detectChanges();
592611

593-
let cellArgs: IGridEditEventArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 'John Brown', cancel: true };
612+
let cellArgs: IGridEditEventArgs = {
613+
cellID: cell.cellID,
614+
rowID: cell.row.rowID,
615+
rowData: initialRowData,
616+
oldValue: 'John Brown',
617+
cancel: true,
618+
column: cell.column,
619+
owner: grid
620+
};
594621
expect(grid.onCellEditEnter.emit).toHaveBeenCalledTimes(1);
595622
expect(grid.onCellEditEnter.emit).toHaveBeenCalledWith(cellArgs);
596623
expect(cell.editMode).toBeFalsy();
597624

598625
// press enter on a cell
599626
cell = grid.getCellByColumn(0, 'age');
627+
initialRowData = {...cell.rowData};
600628
UIInteractions.simulateClickAndSelectEvent(cell);
601629
fixture.detectChanges();
602630

603631
UIInteractions.triggerEventHandlerKeyDown('enter', gridContent);
604632
fixture.detectChanges();
605633

606-
cellArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 20, cancel: true };
634+
cellArgs = {
635+
cellID: cell.cellID,
636+
rowID: cell.row.rowID,
637+
rowData: initialRowData,
638+
oldValue: 20,
639+
cancel: true,
640+
column: cell.column,
641+
owner: grid
642+
};
607643
expect(grid.onCellEditEnter.emit).toHaveBeenCalledTimes(2);
608644
expect(grid.onCellEditEnter.emit).toHaveBeenCalledWith(cellArgs);
609645
expect(cell.editMode).toBeFalsy();
@@ -626,7 +662,17 @@ describe('IgxGrid - Cell Editing #grid', () => {
626662
UIInteractions.triggerEventHandlerKeyDown('tab', gridContent);
627663
fixture.detectChanges();
628664

629-
cellArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 'John Brown', newValue: 'New Name', cancel: false };
665+
// TODO: onCellEdit should emit updated rowData - issue #7304
666+
cellArgs = {
667+
cellID: cell.cellID,
668+
rowID: cell.row.rowID,
669+
rowData: cell.rowData,
670+
oldValue: 'John Brown',
671+
newValue: 'New Name',
672+
cancel: false,
673+
column: cell.column,
674+
owner: grid
675+
};
630676
expect(grid.onCellEdit.emit).toHaveBeenCalledTimes(1);
631677
expect(grid.onCellEdit.emit).toHaveBeenCalledWith(cellArgs);
632678

@@ -640,7 +686,17 @@ describe('IgxGrid - Cell Editing #grid', () => {
640686
UIInteractions.triggerEventHandlerKeyDown('enter', gridContent);
641687
fixture.detectChanges();
642688

643-
cellArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 20, newValue: 1, cancel: false };
689+
// TODO: onCellEdit should emit updated rowData - issue #7304
690+
cellArgs = {
691+
cellID: cell.cellID,
692+
rowID: cell.row.rowID,
693+
rowData: cell.rowData,
694+
oldValue: 20,
695+
newValue: 1,
696+
cancel: false,
697+
column: cell.column,
698+
owner: grid
699+
};
644700
expect(grid.onCellEdit.emit).toHaveBeenCalledTimes(2);
645701
expect(grid.onCellEdit.emit).toHaveBeenCalledWith(cellArgs);
646702
});
@@ -652,6 +708,7 @@ describe('IgxGrid - Cell Editing #grid', () => {
652708
});
653709
let cellArgs: IGridEditEventArgs;
654710
let cell = grid.getCellByColumn(0, 'fullName');
711+
let initialRowData = {...cell.rowData};
655712

656713
UIInteractions.simulateDoubleClickAndSelectEvent(cell);
657714
fixture.detectChanges();
@@ -665,14 +722,25 @@ describe('IgxGrid - Cell Editing #grid', () => {
665722
UIInteractions.triggerEventHandlerKeyDown('tab', gridContent);
666723
fixture.detectChanges();
667724

668-
cellArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 'John Brown', newValue: 'New Name', cancel: true };
725+
// TODO: onCellEdit should emit updated rowData - issue #7304
726+
cellArgs = {
727+
cellID: cell.cellID,
728+
rowID: cell.row.rowID,
729+
rowData: initialRowData,
730+
oldValue: 'John Brown',
731+
newValue: 'New Name',
732+
cancel: true,
733+
column: cell.column,
734+
owner: grid
735+
};
669736
expect(grid.onCellEdit.emit).toHaveBeenCalledTimes(1);
670737
expect(grid.onCellEdit.emit).toHaveBeenCalledWith(cellArgs);
671738

672739
expect(cell.editMode).toBe(false);
673740
expect(cell.value).toBe('John Brown');
674741

675742
cell = grid.getCellByColumn(0, 'age');
743+
initialRowData = {...cell.rowData};
676744
expect(cell.editMode).toBe(true);
677745
editTemplate = fixture.debugElement.query(By.css('input'));
678746
UIInteractions.clickAndSendInputElementValue(editTemplate, 1);
@@ -682,7 +750,17 @@ describe('IgxGrid - Cell Editing #grid', () => {
682750
UIInteractions.triggerEventHandlerKeyDown('enter', gridContent);
683751
fixture.detectChanges();
684752

685-
cellArgs = { cellID: cell.cellID, rowID: cell.row.rowID, oldValue: 20, newValue: '1', cancel: true };
753+
// TODO: onCellEdit should emit updated rowData - issue #7304
754+
cellArgs = {
755+
cellID: cell.cellID,
756+
rowID: cell.row.rowID,
757+
rowData: initialRowData,
758+
oldValue: 20,
759+
newValue: '1',
760+
cancel: true,
761+
column: cell.column,
762+
owner: grid
763+
};
686764
expect(grid.onCellEdit.emit).toHaveBeenCalledTimes(2);
687765
expect(grid.onCellEdit.emit).toHaveBeenCalledWith(cellArgs);
688766

@@ -767,6 +845,7 @@ describe('IgxGrid - Cell Editing #grid', () => {
767845
it(`Should properly emit 'onCellEditCancel' event`, () => {
768846
spyOn(grid.onCellEditCancel, 'emit').and.callThrough();
769847
const cell = grid.getCellByColumn(0, 'fullName');
848+
const initialRowData = {...cell.rowData};
770849

771850
UIInteractions.simulateDoubleClickAndSelectEvent(cell);
772851
fixture.detectChanges();
@@ -782,7 +861,13 @@ describe('IgxGrid - Cell Editing #grid', () => {
782861

783862
const cellArgs: IGridEditEventArgs = {
784863
cellID: cell.cellID,
785-
rowID: cell.row.rowID, oldValue: 'John Brown', newValue: 'New Name', cancel: false
864+
rowID: cell.row.rowID,
865+
rowData: initialRowData,
866+
oldValue: 'John Brown',
867+
newValue: 'New Name',
868+
cancel: false,
869+
column: cell.column,
870+
owner: grid
786871
};
787872
expect(grid.onCellEditCancel.emit).toHaveBeenCalledTimes(1);
788873
expect(grid.onCellEditCancel.emit).toHaveBeenCalledWith(cellArgs);
@@ -796,6 +881,7 @@ describe('IgxGrid - Cell Editing #grid', () => {
796881
e.cancel = true;
797882
});
798883
const cell = grid.getCellByColumn(0, 'fullName');
884+
const initialRowData = {...cell.rowData};
799885

800886
UIInteractions.simulateDoubleClickAndSelectEvent(cell);
801887
fixture.detectChanges();
@@ -805,13 +891,19 @@ describe('IgxGrid - Cell Editing #grid', () => {
805891
UIInteractions.clickAndSendInputElementValue(editTemplate, 'New Name');
806892
fixture.detectChanges();
807893

808-
// press escape on edited cell
809-
UIInteractions.triggerEventHandlerKeyDown('escape', gridContent);
810-
fixture.detectChanges();
894+
// press escape on edited cell
895+
UIInteractions.triggerEventHandlerKeyDown('escape', gridContent);
896+
fixture.detectChanges();
811897

812898
const cellArgs: IGridEditEventArgs = {
813899
cellID: cell.cellID,
814-
rowID: cell.row.rowID, oldValue: 'John Brown', newValue: 'New Name', cancel: true
900+
rowID: cell.row.rowID,
901+
rowData: initialRowData,
902+
oldValue: 'John Brown',
903+
newValue: 'New Name',
904+
cancel: true,
905+
column: cell.column,
906+
owner: grid
815907
};
816908
expect(grid.onCellEditCancel.emit).toHaveBeenCalledTimes(1);
817909
expect(grid.onCellEditCancel.emit).toHaveBeenCalledWith(cellArgs);

0 commit comments

Comments
 (0)