Skip to content

Commit fb62c62

Browse files
Merge branch 'master' into dmdimitrov/esf-templates
2 parents 878468c + a56afb2 commit fb62c62

File tree

18 files changed

+589
-151
lines changed

18 files changed

+589
-151
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ All notable changes for each version of this project will be documented in this
2020
- **Breaking Change** - Removed `IgxExcelStyleSortingTemplateDirective`, `IgxExcelStyleHidingTemplateDirective`, `IgxExcelStyleMovingTemplateDirective`, `IgxExcelStylePinningTemplateDirective` and `IgxExcelStyleSelectingTemplateDirective` directives for re-templating the Excel style filter menu. Added two new directives for re-templating the column operations and filter operations areas - `IgxExcelStyleColumnOperationsTemplateDirective` and `IgxExcelStyleFilterOperationsTemplateDirective`. Exposed all internal components of the Excel style filter menu in order to be used inside the templates.
2121
- **Breaking Change** - `IgxColumnHiding` and `IgxColumnPinning` components have been deprecated in favor of a component combining the their functionality - `IgxColumnActions` which is used with either of the new `IgxColumnPinning` and `IgxColumnHiding` directives that specify the action to be triggered through the UI.
2222
- `igxGrid`
23+
- **Behavioral Change** - For numeric columns, the onCellEdit arguments' newValue will now contain the numeric value that will be committed instead of the string input.
2324
- Added `onScroll` event, which is emitted when the grid is scrolled vertically or horizontally.
2425
- Each grid now expose a default handling for boolean column types. The column will display `check` or `close` icon, instead of true/false by default.
2526
- `igxTreeGrid`
@@ -55,6 +56,9 @@ The following example shows how you can use the Indigo theme:
5556
- `igxButton` directive
5657
- Added styles to support extended fab buttons.
5758
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
59+
- Exposed new `cellEditDone` and `rowEditDone` non cancelable events. The arguments contain `rowData` that is the committed `newValue`.
60+
- `cellEditDone` - Emitted after a cell has been edited and editing has been committed.
61+
- `rowEditDone` - Emitted after exiting edit mode for a row and editing has been committed.
5862
- Introduced `showSummaryOnCollapse` grid property which allows you to control whether the summary row stays visible when the groupBy / parent row is collapsed.
5963
- Added support for tooltips on data cells default template and summary cells.
6064
- Added support for binding columns to properties in nested data objects.

package-lock.json

Lines changed: 34 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"gulp-util": "^3.0.8",
9696
"hammer-simulator": "0.0.1",
9797
"igniteui-sassdoc-theme": "^1.1.2",
98-
"igniteui-typedoc-theme": "^1.3.6",
98+
"igniteui-typedoc-theme": "^2.0.5",
9999
"jasmine": "~3.5.0",
100100
"jasmine-core": "~3.5.0",
101101
"jasmine-spec-reporter": "~5.0.2",

projects/igniteui-angular/src/lib/core/styles/components/dialog/_dialog-theme.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@
164164
color: --var($theme, 'message-color');
165165
max-width: 40ch;
166166
padding: $dialog-message-padding;
167+
168+
@media all and (-ms-high-contrast: none)
169+
{
170+
max-width: map-get((
171+
material: 62ch,
172+
fluent: 48ch,
173+
bootstrap: 60ch,
174+
indigo-design: 48ch,
175+
), $variant);
176+
}
167177
}
168178

169179
%igx-dialog-actions {

projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@
4848

4949
%grid-excel-icon--filtered {
5050
&.igx-icon {
51-
color: igx-color($palette, 'secondary');
51+
color: if(
52+
$variant == 'indigo-design',
53+
igx-color($palette, 'warn', 500),
54+
igx-color($palette, 'secondary')
55+
);
5256
}
5357
}
5458

projects/igniteui-angular/src/lib/grids/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,13 @@ A list of the events emitted by the **igx-grid**:
222222
|--- |--- |
223223
|_Event emitters_|_Notify for a change_|
224224
|`onCellEditEnter`|Emitted when cell enters edit mode.|
225-
|`onCellEdit`|Emitted when cell editing has been performed in the grid and the value has been submitted.|
226-
|`onCellEditCancel`|Emitted when cell editing has been performed in the grid and the value has **not** been submitted.|
227-
|`onRowEditEnter`|Emitted when row enters edit mode.|
228-
|`onRowEdit`|Emitted when row editing has been performed in the grid and the value has been submitted.|
229-
|`onRowEditCancel`|Emitted when row editing has been performed in the grid and the value has **not** been submitted.|
225+
|`onCellEdit`|Emitted just before a cell's value is committed (e.g. by pressing Enter).|
226+
|`cellEditDone`|Emitted after a cell has been edited and editing has been committed.|
227+
|`onCellEditCancel`|Emitted when a cell exits edit mode without committing its value (e.g. by pressing Escape).|
228+
|`onRowEditEnter`|If `[rowEditing]` is enabled, emitted when a row enters edit mode (after onCellEditEnter).|
229+
|`onRowEdit`|Emitted just before a row in edit mode's value is committed (e.g. by clicking the Done button on the Row Editing Overlay).|
230+
|`rowEditDone`|Emitted after exiting edit mode for a row and editing has been committed.|
231+
|`onRowEditCancel`|Emitted when a row exits edit mode without committing its values (e.g. by clicking the Cancel button on the Row Editing Overlay).|
230232
|`onCellClick`|Emitted when a cell is clicked. Returns the cell object.|
231233
|`onColumnMoving`|Emitted when a column is moved. Returns the source and target columns objects. This event is cancelable.|
232234
|`onColumnMovingEnd`|Emitted when a column moving ends. Returns the source and target columns objects. This event is cancelable.|

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

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
6565
*/
6666
public getRowData(rowID: any) {
6767
const data = this.get_all_data(this.grid.transactions.enabled);
68-
const index = this.get_row_index_in_data(rowID);
68+
const index = this.get_row_index_in_data(rowID, data);
6969
return data[index];
7070
}
7171

@@ -79,12 +79,12 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
7979
return this.grid.crudService.cell;
8080
}
8181

82-
public get_row_index_in_data(rowID: any): number {
82+
public get_row_index_in_data(rowID: any, dataCollection?: any[]): number {
8383
const grid = this.grid as IgxGridBaseDirective;
8484
if (!grid) {
8585
return -1;
8686
}
87-
const data = this.get_all_data(grid.transactions.enabled);
87+
const data = dataCollection ?? this.get_all_data(grid.transactions.enabled);
8888
return grid.primaryKey ? data.findIndex(record => record[grid.primaryKey] === rowID) : data.indexOf(rowID);
8989
}
9090

@@ -127,7 +127,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
127127

128128
public submit_value() {
129129
const cell = this.grid.crudService.cell;
130-
if (cell ) {
130+
if (cell) {
131131
const args = this.update_cell(cell, cell.editValue);
132132
if (args.cancel) {
133133
return;
@@ -137,31 +137,24 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
137137
}
138138

139139
update_cell(cell: IgxCell, value: any) {
140-
const data = this.get_all_data(this.grid.transactions.enabled);
141-
const index = this.get_row_index_in_data(cell.id.rowID);
142-
143140
cell.editValue = value;
144-
145141
const args = cell.createEditEventArgs();
146-
147-
// TODO: emit onCellEdit after value is updated - issue #7304
148142
this.grid.onCellEdit.emit(args);
143+
// TODO Implement cellEditExit event end emit if isEqual(args.oldValue, args.newValue)
144+
// TODO do not emit onCellEdit & cellEditDone if isEqual(args.oldValue, args.newValue)
149145
if (args.cancel) {
150146
return args;
151147
}
152148

153-
// Cast to number after emit
154-
// TODO: Clean up this
155-
args.newValue = cell.castToNumber(args.newValue);
156-
157149
if (isEqual(args.oldValue, args.newValue)) {
158150
return args;
159151
}
160152

161153
this.grid.summaryService.clearSummaryCache(args);
162-
this.updateData(this.grid, cell.id.rowID, data[index], cell.rowData, reverseMapper(cell.column.field, args.newValue));
154+
const data = this.getRowData(cell.id.rowID);
155+
this.updateData(this.grid, cell.id.rowID, data, cell.rowData, reverseMapper(cell.column.field, args.newValue));
163156
if (this.grid.primaryKey === cell.column.field) {
164-
if (this.grid.selectionService.isRowSelected(cell.id.rowID)) {
157+
if (this.grid.selectionService.isRowSelected(cell.id.rowID)) {
165158
this.grid.selectionService.deselectRow(cell.id.rowID);
166159
this.grid.selectionService.selectRowById(args.newValue);
167160
}
@@ -175,6 +168,9 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
175168
(this.grid as any)._pipeTrigger++;
176169
}
177170

171+
const doneArgs = cell.createDoneEditEventArgs(args.newValue);
172+
this.grid.cellEditDone.emit(doneArgs);
173+
178174
return args;
179175
}
180176

@@ -203,7 +199,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
203199
const grid = this.grid;
204200

205201
const rowInEditMode = grid.crudService.row;
206-
row.newData = value ? value : grid.transactions.getAggregatedValue(row.id, true);
202+
row.newData = value ?? rowInEditMode.transactionState;
207203

208204

209205
if (rowInEditMode && row.id === rowInEditMode.id) {
@@ -220,9 +216,8 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
220216
const selected = grid.selectionService.isRowSelected(row.id);
221217
const rowInEditMode = grid.crudService.row;
222218
const data = this.get_all_data(grid.transactions.enabled);
223-
const index = this.get_row_index_in_data(row.id);
219+
const index = this.get_row_index_in_data(row.id, data);
224220
const hasSummarized = grid.hasSummarizedColumns;
225-
226221
this._update_row(row, value);
227222

228223
const args = row.createEditEventArgs();
@@ -232,13 +227,13 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
232227
return args;
233228
}
234229

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

238232
if (args.cancel) {
239233
return args;
240234
}
241235

236+
const cachedRowData = { ... args.oldValue };
242237
if (rowInEditMode) {
243238
const hasChanges = grid.transactions.getState(args.rowID, true);
244239
grid.transactions.endPending(false);
@@ -261,16 +256,19 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
261256
grid.selectionService.deselectRow(row.id);
262257
grid.selectionService.selectRowById(newId);
263258
}
259+
// make sure selection is handled prior to updating the row.id
260+
row.id = newId;
264261
if (hasSummarized) {
265262
grid.summaryService.removeSummaries(newId);
266263
}
267264
(grid as any)._pipeTrigger++;
268265

266+
const doneArgs = row.createDoneEditEventArgs(cachedRowData);
267+
grid.rowEditDone.emit(doneArgs);
269268
return args;
270269
}
271270

272271

273-
274272
protected update_row_in_array(value: any, rowID: any, index: number) {
275273
const grid = this.grid;
276274
grid.data[index] = value;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface IGridCellEventArgs extends IBaseEventArgs {
2020
event: Event;
2121
}
2222

23-
export interface IGridEditEventArgs extends CancelableEventArgs, IBaseEventArgs {
23+
export interface IGridEditDoneEventArgs extends IBaseEventArgs {
2424
rowID: any;
2525
cellID?: {
2626
rowID: any,
@@ -35,6 +35,9 @@ export interface IGridEditEventArgs extends CancelableEventArgs, IBaseEventArgs
3535
owner?: IgxGridBaseDirective & GridType;
3636
}
3737

38+
export interface IGridEditEventArgs extends CancelableEventArgs, IGridEditDoneEventArgs {
39+
}
40+
3841
export interface IPinColumnEventArgs extends IBaseEventArgs {
3942
column: IgxColumnComponent;
4043
insertAtIndex: number;

0 commit comments

Comments
 (0)