Skip to content

Commit 0d228d2

Browse files
authored
Merge branch 'master' into mkirkova/fix-10242-master
2 parents e672d77 + 461f2e9 commit 0d228d2

31 files changed

+918
-275
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ All notable changes for each version of this project will be documented in this
7373
- Inputs `showToolbar`, `toolbarTitle`, `columnHiding`, `columnHidingTitle`, `hiddenColumnsText`,
7474
`columnPinning`, `columnPinningTitle`, `pinnedColumnsText`.
7575
Use `IgxGridToolbarComponent`, `IgxGridToolbarHidingComponent`, `IgxGridToolbarPinningComponent` instead.
76+
- **Breaking Change** - The `rowSelected` event is renamed to `rowSelectionChanging` to better reflect its function
7677
- `igxGrid`
7778
- Exposed a `groupStrategy` input that functions similarly to `sortStrategy`, allowing customization of the grouping behavior of the grid. Please, refer to the [Group By ](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/groupby) topic for more information.
7879
- `IgxColumnActionsComponent`

projects/igniteui-angular/migrations/update-13_0_0/changes/members.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
"definedIn": [
2222
"IgxComboBaseDirective"
2323
]
24+
},
25+
{
26+
"member": "rowSelected",
27+
"replaceWith": "rowSelectionChanging",
28+
"definedIn": [
29+
"IgxGridComponent",
30+
"IgxTreeGridComponent",
31+
"IgxHierarchicalGridComponent",
32+
"IgxRowIslandComponent"
33+
]
2434
}
2535
]
2636
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../../common/schema/binding.schema.json",
3+
"changes": [
4+
{
5+
"name": "rowSelected",
6+
"replaceWith": "rowSelectionChanging",
7+
"owner": {
8+
"selector": "igx-grid",
9+
"type": "component"
10+
}
11+
},
12+
{
13+
"name": "rowSelected",
14+
"replaceWith": "rowSelectionChanging",
15+
"owner": {
16+
"selector": "igx-tree-grid",
17+
"type": "component"
18+
}
19+
},
20+
{
21+
"name": "rowSelected",
22+
"replaceWith": "rowSelectionChanging",
23+
"owner": {
24+
"selector": "igx-hierarchical-grid",
25+
"type": "component"
26+
}
27+
},
28+
{
29+
"name": "rowSelected",
30+
"replaceWith": "rowSelectionChanging",
31+
"owner": {
32+
"selector": "igx-row-island",
33+
"type": "component"
34+
}
35+
}
36+
]
37+
}

projects/igniteui-angular/src/lib/data-operations/sorting-strategy.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,20 @@ export class IgxSorting implements IGridSortingStrategy {
150150
fullResult.data.push(groupItem);
151151
}
152152
if (expanded) {
153-
metadata.push(...fullResult.metadata.slice(fullResult.metadata.length - group.length));
154-
result.push(...fullResult.data.slice(fullResult.data.length - group.length));
153+
// Replaced object destructing as in a single big group scenario
154+
// it hits the max number of arguments for a function the underlying JS engine
155+
// supports.
156+
let j = fullResult.metadata.length - group.length;
157+
158+
for (; j < fullResult.metadata.length; j++) {
159+
metadata.push(fullResult.metadata[j]);
160+
}
161+
162+
j = fullResult.data.length - group.length;
163+
164+
for (; j < fullResult.data.length; j++) {
165+
result.push(fullResult.data[j]);
166+
}
155167
}
156168
}
157169
i += group.length;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ A list of the events emitted by the **igx-grid**:
228228
|`columnMovingEnd`|Emitted when a column moving ends. Returns the source and target columns objects. This event is cancelable.|
229229
|`columnMovingStart`|Emitted when a column moving starts. Returns the moved column object.|
230230
|`selected`|Emitted when a cell is selected. Returns the cell object.|
231-
|`rowSelected`|Emitted when a row selection has changed. Returns array with old and new selected rows' IDs and the target row, if available.|
231+
|`rowSelectionChanging`|Emitted when row selection is changing. Returns array with old and new selected rows' IDs and the target row, if available.|
232232
|`columnSelected`|Emitted when a column selection has changed. Returns array with old and new selected column' fields|
233233
|`columnInit`|Emitted when the grid columns are initialized. Returns the column object.|
234234
|`sortingDone`|Emitted when sorting is performed through the UI. Returns the sorting expression.|

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ export interface IColumnResizingEventArgs extends IColumnResizeEventArgs, Cancel
8383
}
8484

8585
export interface IRowSelectionEventArgs extends CancelableEventArgs, IBaseEventArgs {
86-
oldSelection: any[];
86+
readonly oldSelection: any[];
8787
newSelection: any[];
88-
added: any[];
89-
removed: any[];
90-
event?: Event;
88+
readonly added: any[];
89+
readonly removed: any[];
90+
readonly event?: Event;
9191
}
9292

9393
export interface IColumnSelectionEventArgs extends CancelableEventArgs, IBaseEventArgs {

projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { AbsoluteScrollStrategy } from '../../../services/overlay/scroll';
2929
import { DisplayDensity } from '../../../core/displayDensity';
3030
import { IgxDatePickerComponent } from '../../../date-picker/date-picker.component';
3131
import { IgxTimePickerComponent } from '../../../time-picker/time-picker.component';
32-
import { PlatformUtil } from '../../../core/utils';
32+
import { isEqual, PlatformUtil } from '../../../core/utils';
3333
import { Subject } from 'rxjs';
3434
import { takeUntil } from 'rxjs/operators';
3535

@@ -70,14 +70,23 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
7070
public set value(val) {
7171
if (!val && val !== 0) {
7272
this.expression.searchVal = null;
73-
this.showHideArrowButtons();
73+
const index = this.expressionsList.findIndex(item => item.expression === this.expression);
74+
if (index === 0 && this.expressionsList.length === 1) {
75+
this.clearFiltering();
76+
return;
77+
}
7478
} else {
79+
const oldValue = this.expression.searchVal;
80+
if (isEqual(oldValue, val)) {
81+
return;
82+
}
83+
7584
this.expression.searchVal = DataUtil.parseValue(this.column.dataType, val);
7685
if (this.expressionsList.find(item => item.expression === this.expression) === undefined) {
7786
this.addExpression(true);
7887
}
88+
this.filter();
7989
}
80-
this.filter();
8190
}
8291

8392
public get displayDensity() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
465465
*
466466
* @example
467467
* ```html
468-
* <igx-grid #grid (rowSelected)="onCellClickChange($event)" [data]="localData" [autoGenerate]="true"></igx-grid>
468+
* <igx-grid #grid (rowSelectionChanging)="rowSelectionChanging($event)" [data]="localData" [autoGenerate]="true"></igx-grid>
469469
* ```
470470
*/
471471
@Output()
472-
public rowSelected = new EventEmitter<IRowSelectionEventArgs>();
472+
public rowSelectionChanging = new EventEmitter<IRowSelectionEventArgs>();
473473

474474
/**
475475
* Emitted when `IgxColumnComponent` is selected.

0 commit comments

Comments
 (0)