Skip to content

Commit 0674b95

Browse files
authored
Merge branch 'master' into tzhelev/noop-strategies
2 parents d9747bf + 65f2d21 commit 0674b95

File tree

9 files changed

+56
-12
lines changed

9 files changed

+56
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ All notable changes for each version of this project will be documented in this
2525
- `sortingExpressionsChange` event emitter is added, which is fired whenever a change to the sorting expressions has occurred (prior to performing the actual sorting).
2626
- `filteringExpressionsTreeChange` event emitter is added, which is fired whenever a change to the filtering expressions has occurred (prior to performing the actual filtering).
2727
- `IgxOverlayService`:
28-
- `setOffset` method added. It repositions the content in the horizontal and vertical directions.
28+
- `setOffset` method added. It offsets the content along the corresponding axis by the provided amount.
2929
- `IgxToggleDirective`:
30-
- `setOffset` method added. It repositions the content in the horizontal and vertical directions.
30+
- `setOffset` method added. It offsets the content along the corresponding axis by the provided amount.
3131

3232
## 8.2.6
3333

projects/igniteui-angular/src/lib/directives/toggle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ handlers when the toggle is opened and respectively closed.
4949
| `close` | --- | `void` | Closes the toggle. |
5050
| `toggle` | overlaySettings?: `OverlaySettings` | `void` | Closes the toggle. |
5151
| `reposition` | --- | `void` | Repositions the toggle. |
52-
| `setOffset` | Repositions the content in the horizontal and/or vertical directions. |deltaX, deltaY |
52+
| `setOffset` | Offsets the content along the corresponding axis by the provided amount. |deltaX, deltaY |
5353

5454

5555

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
277277
}
278278

279279
/**
280-
* Repositions the content in the horizontal and/or vertical directions.
280+
* Offsets the content along the corresponding axis by the provided amount
281281
*/
282282
setOffset(deltaX: number, deltaY: number) {
283283
this.overlayService.setOffset(this._overlayId, deltaX, deltaY);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
477477

478478
this.filteringService.filteredColumn = null;
479479
this.filteringService.selectedExpression = null;
480-
this.cdr.detectChanges();
481480

482481
this.chipAreaScrollOffset = 0;
483482
this.transform(this.chipAreaScrollOffset);

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,11 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
10091009
*/
10101010
set filterMode(value) {
10111011
this._filterMode = value;
1012+
1013+
if (this.filteringService.isFilterRowVisible) {
1014+
this.filteringRow.close();
1015+
}
1016+
this.notifyChanges(true);
10121017
}
10131018

10141019
/**
@@ -4388,6 +4393,17 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
43884393
return pagingHeight;
43894394
}
43904395

4396+
/**
4397+
* @hidden
4398+
*/
4399+
protected getFilterCellHeight(): number {
4400+
const headerGroupNativeEl = (this.headerGroupsList.length !== 0) ?
4401+
this.headerGroupsList[0].element.nativeElement : null;
4402+
const filterCellNativeEl = (headerGroupNativeEl) ?
4403+
headerGroupNativeEl.querySelector('igx-grid-filtering-cell') : null;
4404+
return (filterCellNativeEl) ? filterCellNativeEl.offsetHeight : 0;
4405+
}
4406+
43914407
/**
43924408
* @hidden
43934409
*/
@@ -4396,12 +4412,14 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
43964412
return null;
43974413
}
43984414

4399-
4415+
const actualTheadRow = (!this.allowFiltering || (this.allowFiltering && this.filterMode !== FilterMode.quickFilter)) ?
4416+
this.theadRow.nativeElement.offsetHeight - this.getFilterCellHeight() :
4417+
this.theadRow.nativeElement.offsetHeight;
44004418
const footerHeight = this.summariesHeight || this.tfoot.nativeElement.offsetHeight - this.tfoot.nativeElement.clientHeight;
44014419
const toolbarHeight = this.getToolbarHeight();
44024420
const pagingHeight = this.getPagingHeight();
44034421
const groupAreaHeight = this.getGroupAreaHeight();
4404-
const renderedHeight = toolbarHeight + this.theadRow.nativeElement.offsetHeight +
4422+
const renderedHeight = toolbarHeight + actualTheadRow +
44054423
footerHeight + pagingHeight + groupAreaHeight +
44064424
this.scr.nativeElement.clientHeight;
44074425

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3441,6 +3441,34 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
34413441
expect(grid.rowList.length).toBe(8);
34423442
expect(GridFunctions.getCurrentCellFromGrid(grid, 0, 1).value).toBe('Ignite UI for JavaScript');
34433443
expect(GridFunctions.getCurrentCellFromGrid(grid, 1, 1).value).toBe('NetAdvantage');
3444+
}));
3445+
3446+
it('Should close filterRow when changing filterMode from \'quickFilter\' to \'excelStyleFilter\'', (async () => {
3447+
GridFunctions.clickFilterCellChip(fix, 'ProductName');
3448+
fix.detectChanges();
3449+
3450+
// Add a condition chip without submitting it.
3451+
GridFunctions.typeValueInFilterRowInput('a', fix);
3452+
await wait(16);
3453+
3454+
// Change filterMode to 'excelStyleFilter`
3455+
grid.filterMode = FilterMode.excelStyleFilter;
3456+
fix.detectChanges();
3457+
3458+
// Verify the the filterRow is closed.
3459+
const filterUIRow = fix.debugElement.query(By.css(FILTER_UI_ROW));
3460+
expect(filterUIRow).toBeNull('filterRow is visible');
3461+
3462+
// Verify the ESF icons are visible.
3463+
const gridNativeElement = fix.debugElement.query(By.css('igx-grid')).nativeElement;
3464+
const thead = gridNativeElement.querySelector('.igx-grid__thead-wrapper');
3465+
const filterIcons = thead.querySelectorAll('.igx-excel-filter__icon');
3466+
expect(filterIcons.length).toEqual(4, 'incorrect esf filter icons count');
3467+
3468+
// Verify the condition was submitted.
3469+
const header = GridFunctions.getColumnHeader('ProductName', fix);
3470+
const activeFilterIcon = header.nativeElement.querySelector('.igx-excel-filter__icon--filtered');
3471+
expect(activeFilterIcon).toBeDefined('no active filter icon was found');
34443472
}));
34453473
});
34463474
describe(null, () => {
@@ -3650,6 +3678,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
36503678
let fix, grid;
36513679
beforeEach(fakeAsync(() => {
36523680
fix = TestBed.createComponent(IgxGridFilteringComponent);
3681+
fix.detectChanges();
36533682
grid = fix.componentInstance.grid;
36543683
grid.filterMode = FilterMode.excelStyleFilter;
36553684
fix.detectChanges();

projects/igniteui-angular/src/lib/services/overlay/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ this.overlay.show(component, overlaySettings);
9696
|hide | Remove the provided native element of for the component with provided id |id |
9797
|hideAll | Remove the all native elements and hides the overlay |- |
9898
|reposition | Repositions the native element of the component with provided id |id |
99-
|setOffset | Repositions the content in the horizontal and/or vertical directions. |id, deltaX, deltaY |
99+
|setOffset | Offsets the content along the corresponding axis by the provided amount |id, deltaX, deltaY |
100100

101101
###### IPositionStrategy
102102

projects/igniteui-angular/src/lib/services/overlay/overlay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ export class IgxOverlayService implements OnDestroy {
246246
}
247247

248248
/**
249-
* Repositions the content in the horizontal and/or vertical directions.
249+
* Offsets the content along the corresponding axis by the provided amount
250250
* ```typescript
251-
* this.overlay.setOffset(id, x, y);
251+
* this.overlay.setOffset(id, deltaX, deltaY);
252252
* ```
253253
*/
254254
setOffset(id: string, deltaX: number, deltaY: number) {

src/app/grid-filtering/grid-filtering.sample.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ export class GridFilteringComponent implements OnInit, AfterViewInit {
534534
const filterMode = this.filterModes[event.index].value as FilterMode;
535535
if (filterMode !== this.grid1.filterMode) {
536536
this.grid1.filterMode = filterMode;
537-
this.grid1.reflow();
538537
}
539538
}
540539

@@ -552,6 +551,5 @@ export class GridFilteringComponent implements OnInit, AfterViewInit {
552551

553552
public onAllowFilteringChanged(event: IChangeCheckboxEventArgs) {
554553
this.grid1.allowFiltering = event.checked;
555-
this.grid1.reflow();
556554
}
557555
}

0 commit comments

Comments
 (0)