Skip to content

Commit a17b406

Browse files
authored
Merge branch 'master' into PMiteva/input-group-reactive
2 parents fab98ee + a198cba commit a17b406

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+672
-470
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ All notable changes for each version of this project will be documented in this
99
The `rowData` argument may be `undefined` in remote scenarios/applying the callback on filtering labels
1010
so make sure to check its availability.
1111

12+
- `IgxExcelExporterService`
13+
- Added support for freezing column headers in **Excel**. By default, the column headers would not be frozen but this behavior can be controlled by the `freezeHeaders` option of the IgxExcelExporterOptions object.
14+
1215
## 12.1.0
1316

1417
### New Features

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
149149
console.warn('The grid must use row edit mode to perform row adding! Please set rowEditable to true.');
150150
return;
151151
}
152-
grid.beginAddRowByIndex(context.rowID, context.index, asChild, event);
152+
grid.gridAPI.crudService.enterAddRowMode(context, asChild, event);
153153
this.strip.hide();
154154
}
155155

projects/igniteui-angular/src/lib/checkbox/checkbox.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,11 @@ export class IgxCheckboxComponent implements ControlValueAccessor, EditorProvide
454454
this._onTouchedCallback = fn;
455455
}
456456

457+
/** @hidden @internal */
458+
public setDisabledState(isDisabled: boolean) {
459+
this.disabled = isDisabled;
460+
}
461+
457462
/** @hidden @internal */
458463
public getEditElement() {
459464
return this.nativeCheckbox.nativeElement;

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

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { IgxGridBaseDirective } from './grid-base.directive';
88
import { IgxRowDirective } from './row.directive';
99
import { IFilteringExpressionsTree } from '../data-operations/filtering-expressions-tree';
1010
import { Transaction, TransactionType, State } from '../services/transaction/transaction';
11-
import { IgxCell, IgxGridCRUDService, IgxRow } from './common/crud.service';
11+
import { IgxCell, IgxGridCRUDService, IgxEditRow } from './common/crud.service';
1212
import { GridType } from './common/grid.interface';
1313
import { ColumnType } from './common/column.interface';
1414
import { IGridEditEventArgs, IRowToggleEventArgs } from './common/events';
@@ -122,23 +122,6 @@ export class GridBaseAPIService<T extends IgxGridBaseDirective & GridType> {
122122
}
123123
}
124124

125-
public update_add_cell(cell: IgxCell): IGridEditEventArgs {
126-
if (!cell) {
127-
return;
128-
}
129-
130-
const args = cell.createEditEventArgs(true);
131-
132-
const data = cell.rowData;
133-
if (cell.column.hasNestedPath) {
134-
mergeObjects(data, reverseMapper(cell.column.field, args.newValue));
135-
} else {
136-
data[cell.column.field] = args.newValue;
137-
}
138-
mergeObjects(this.crudService.row.data, data);
139-
return args;
140-
}
141-
142125
public update_cell(cell: IgxCell): IGridEditEventArgs {
143126
if (!cell) {
144127
return;
@@ -167,7 +150,7 @@ export class GridBaseAPIService<T extends IgxGridBaseDirective & GridType> {
167150
}
168151

169152
// TODO: CRUD refactor to not emit editing evts.
170-
public update_row(row: IgxRow, value: any, event?: Event) {
153+
public update_row(row: IgxEditRow, value: any, event?: Event) {
171154
const grid = this.grid;
172155
const selected = grid.selectionService.isRowSelected(row.id);
173156
const rowInEditMode = this.crudService.row;
@@ -270,10 +253,11 @@ export class GridBaseAPIService<T extends IgxGridBaseDirective & GridType> {
270253
return this.grid.filteredData;
271254
}
272255

273-
public addRowToData(rowData: any, _parentRowID?) {
256+
public addRowToData(rowData: any, parentID?) {
274257
// Add row goes to transactions and if rowEditable is properly implemented, added rows will go to pending transactions
275258
// If there is a row in edit - > commit and close
276259
const grid = this.grid;
260+
277261
if (grid.transactions.enabled) {
278262
const transactionId = grid.primaryKey ? rowData[grid.primaryKey] : rowData;
279263
const transaction: Transaction = { id: transactionId, type: TransactionType.ADD, newValue: rowData };

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
5858
*/
5959
@HostBinding('class.igx-grid__td--new')
6060
public get isEmptyAddRowCell() {
61-
return this.intRow.addRow && (this.value === undefined || this.value === null);
61+
return this.intRow.addRowUI && (this.value === undefined || this.value === null);
6262
}
6363

6464
/**
@@ -195,7 +195,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
195195
if (this.cellTemplate) {
196196
return this.cellTemplate;
197197
}
198-
if (this.grid.rowEditable && this.intRow.addRow) {
198+
if (this.grid.rowEditable && this.intRow.addRowUI) {
199199
return this.addRowCellTemplate;
200200
}
201201
return this.defaultCellTemplate;
@@ -984,11 +984,8 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
984984

985985
if (this.editable && editMode && !this.intRow.deleted) {
986986
if (editableCell) {
987-
if (this.intRow.addRow) {
988-
editableArgs = this.grid.crudService.updateAddCell(false, event);
989-
} else {
990-
editableArgs = this.grid.crudService.updateCell(false, event);
991-
}
987+
editableArgs = this.grid.crudService.updateCell(false, event);
988+
992989
/* This check is related with the following issue #6517:
993990
* when edit cell that belongs to a column which is sorted and press tab,
994991
* the next cell in edit mode is with wrong value /its context is not updated/;
@@ -1013,16 +1010,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
10131010
}
10141011

10151012
if (editableCell && crud.sameRow(this.cellID.rowID)) {
1016-
if (this.intRow.addRow) {
1017-
const args = this.grid.crudService.updateAddCell(false, event);
1018-
if (args.cancel) {
1019-
this.grid.crudService.endAddRow();
1020-
} else {
1021-
this.grid.crudService.exitCellEdit(event);
1022-
}
1023-
} else {
1024-
this.grid.crudService.updateCell(true, event);
1025-
}
1013+
this.grid.crudService.updateCell(true, event);
10261014
} else if (editMode && !crud.sameRow(this.cellID.rowID)) {
10271015
this.grid.crudService.endEdit(true, event);
10281016
}

0 commit comments

Comments
 (0)