Skip to content

Commit b3870e1

Browse files
authored
Merge branch 'master' into vmihalkov/fix-6593
2 parents 9359cee + e897902 commit b3870e1

File tree

7 files changed

+47
-50
lines changed

7 files changed

+47
-50
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ All notable changes for each version of this project will be documented in this
1414
- `IgxHierarchicalGridBaseComponent` -> `IgxHierarchicalGridBaseDirective`
1515
- `IgxMonthPickerBase` -> `IgxMonthPickerBaseDirective`
1616

17+
- **Breaking Changes** Due to a breaking change in Angular 9 with Ivy, Hammer providers are no longer included by default. You can find more information at: https://github.com/angular/angular/blob/master/CHANGELOG.md#breaking-changes-9 . Because of this change the following components require `HammerModule` to be imported in the root module of the application in order for user interactions to work as expected:
18+
- `IgxSlider`
19+
20+
The following components require `HammerModule` to be imported in the root module of the application so that their **touch** interactions work as expected:
21+
- `igxGrid`
22+
- `igxHierarchicalGrid`
23+
- `igxTreeGrid`
24+
- `igxList`
25+
- `igxNavigationDrawer`
26+
- `igxTimePicker`
27+
- `igxMonthPicker`
28+
- `igxSlider`
29+
- `igxCalendar`
30+
- `igxDatePicker`
31+
- `igxCarousel`
32+
1733
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
1834
- **Breaking Change** - Hierarchical grid children no longer use the same `IgxTransactionService` instance and transaction handling should be modified to address each grid's transactions separately.
1935
- **Behavioral Change** - Pinning columns is no longer automatically prevented when the pinning area would exceed the size of the grid.

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-search.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ export class IgxExcelStyleSearchComponent implements AfterViewInit {
6060
@Input()
6161
public inline: boolean;
6262

63-
public filteredData: FilterListItem[];
64-
6563
@Input()
6664
public column: IgxColumnComponent;
6765

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-search.pipe.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@ import { cloneArray } from '../../../core/utils';
99
name: 'excelStyleSearchFilter'
1010
})
1111
export class IgxExcelStyleSearchFilterPipe implements PipeTransform {
12-
13-
constructor(private esf: IgxGridExcelStyleFilteringComponent) { }
14-
1512
transform(items: FilterListItem[], searchText: string): any[] {
1613
if (!items || !items.length) {
1714
return [];
1815
}
1916

2017
if (!searchText) {
21-
if (this.esf.excelStyleSearch) {
22-
this.esf.excelStyleSearch.filteredData = null;
23-
}
2418
return items;
2519
}
2620

@@ -29,16 +23,7 @@ export class IgxExcelStyleSearchFilterPipe implements PipeTransform {
2923
(it.value !== null && it.value !== undefined) &&
3024
it.value.toString().toLowerCase().indexOf(searchText) > -1);
3125

32-
// If 'result' contains the 'Select All' item and at least one more, we use it as a 'finalResult',
33-
// otherwise we use an empty array as a 'finalResult' of the filtering.
34-
const finalResult = result.length > 1 ? result : [];
35-
36-
// Update the filteredData of the search component.
37-
if (this.esf.excelStyleSearch) {
38-
this.esf.excelStyleSearch.filteredData = cloneArray(finalResult);
39-
this.esf.cdr.detectChanges();
40-
}
41-
42-
return finalResult;
26+
// If 'result' contains the 'Select All' item and at least one more - we use it, otherwise we use an empty array.
27+
return result.length > 1 ? result : [];
4328
}
4429
}

projects/igniteui-angular/src/lib/grids/filtering/excel-style/grid.excel-style-filtering.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy, AfterView
237237
* @hidden @internal
238238
*/
239239
@ViewChild('excelStyleSearch', { read: IgxExcelStyleSearchComponent })
240-
public excelStyleSearch: IgxExcelStyleSearchComponent;
240+
protected excelStyleSearch: IgxExcelStyleSearchComponent;
241241

242242
/**
243243
* @hidden @internal
@@ -304,7 +304,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy, AfterView
304304
}
305305
}
306306

307-
constructor(public cdr: ChangeDetectorRef) {}
307+
constructor(private cdr: ChangeDetectorRef) {}
308308

309309
/**
310310
* @hidden @internal
@@ -784,8 +784,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy, AfterView
784784
* @hidden @internal
785785
*/
786786
get applyButtonDisabled() {
787-
return (this.excelStyleSearch && this.excelStyleSearch.filteredData && this.excelStyleSearch.filteredData.length === 0) ||
788-
(this.listData[0] && !this.listData[0].isSelected && !this.listData[0].indeterminate);
787+
return this.listData[0] && !this.listData[0].isSelected && !this.listData[0].indeterminate;
789788
}
790789

791790
/**

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

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,40 +3210,27 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
32103210
tick(100);
32113211
}));
32123212

3213-
it('Should filter, clear and enable/disable the apply button correctly.', fakeAsync(() => {
3213+
it('Should enable/disable the apply button correctly.', fakeAsync(() => {
32143214
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
32153215
tick(100);
32163216
fix.detectChanges();
32173217

3218-
// Type string in search box.
3218+
// Verify there are filtered-in results and that apply button is enabled.
32193219
const searchComponent = GridFunctions.getExcelStyleSearchComponent(fix);
3220-
const inputNativeElement = searchComponent.querySelector('.igx-input-group__input');
3221-
sendInputNativeElement(inputNativeElement, 'hello there', fix);
3222-
tick(100);
3223-
fix.detectChanges();
3224-
3225-
// Verify there are no filtered-in results and that apply button is disabled.
3226-
let listItems = searchComponent.querySelectorAll('igx-list-item');
3227-
let excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
3228-
let raisedButtons = Array.from(excelMenu.querySelectorAll('.igx-button--raised'));
3220+
const listItems = searchComponent.querySelectorAll('igx-list-item');
3221+
const excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
3222+
const raisedButtons = Array.from(excelMenu.querySelectorAll('.igx-button--raised'));
32293223
let applyButton: any = raisedButtons.find((rb: any) => rb.innerText === 'apply');
3230-
expect(listItems.length).toBe(0, 'ESF search result should be empty');
3231-
expect(applyButton.classList.contains('igx-button--disabled')).toBe(true);
3224+
expect(listItems.length).toBe(6, 'ESF search result should NOT be empty');
3225+
expect(applyButton.classList.contains('igx-button--disabled')).toBe(false);
32323226

3233-
// Clear filtering.
3234-
const icons = Array.from(searchComponent.querySelectorAll('igx-icon'));
3235-
const clearIcon: any = icons.find((ic: any) => ic.innerText === 'clear');
3236-
clearIcon.click();
3237-
tick(100);
3227+
// Verify the apply button is disabled when all items are unchecked (when unchecking 'Select All').
3228+
const checkbox = excelMenu.querySelectorAll('.igx-checkbox__input');
3229+
checkbox[0].click(); // Select All
3230+
tick();
32383231
fix.detectChanges();
3239-
3240-
// Verify there are filtered-in results and that apply button is enabled.
3241-
listItems = searchComponent.querySelectorAll('igx-list-item');
3242-
excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
3243-
raisedButtons = Array.from(excelMenu.querySelectorAll('.igx-button--raised'));
32443232
applyButton = raisedButtons.find((rb: any) => rb.innerText === 'apply');
3245-
expect(listItems.length).toBe(6, 'ESF search result should NOT be empty');
3246-
expect(applyButton.classList.contains('igx-button--disabled')).toBe(false);
3233+
expect(applyButton.classList.contains('igx-button--disabled')).toBe(true);
32473234
}));
32483235

32493236
it('display density is properly applied on the excel style filtering component', fakeAsync(() => {

projects/igniteui-angular/src/lib/navigation-drawer/navigation-drawer.component.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,14 @@ describe('Navigation Drawer', () => {
571571
done();
572572
});
573573

574+
it('should retain classes added in markup, fix for #6508', () => {
575+
const fix = TestBed.createComponent(TestComponent);
576+
fix.detectChanges();
577+
578+
expect(fix.componentInstance.navDrawer.element.classList.contains('markupClass')).toBeTruthy();
579+
expect(fix.componentInstance.navDrawer.element.classList.contains('igx-nav-drawer')).toBeTruthy();
580+
});
581+
574582
function swipe(element, posX, posY, duration, deltaX, deltaY) {
575583
const swipeOptions = {
576584
deltaX,
@@ -610,7 +618,7 @@ describe('Navigation Drawer', () => {
610618

611619
@Component({
612620
selector: 'igx-test-cmp',
613-
template: '<igx-nav-drawer></igx-nav-drawer>'
621+
template: '<igx-nav-drawer class="markupClass"></igx-nav-drawer>'
614622
})
615623
class TestComponent {
616624
@ViewChild(IgxNavigationDrawerComponent, { static: true }) public navDrawer: IgxNavigationDrawerComponent;

projects/igniteui-angular/src/lib/navigation-drawer/navigation-drawer.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ export class IgxNavigationDrawerComponent implements
6161
AfterContentInit,
6262
OnDestroy,
6363
OnChanges {
64+
6465
private _isOpen = false;
65-
@HostBinding('class') public cssClass = 'igx-nav-drawer';
66+
67+
/** @hidden @internal */
68+
@HostBinding('class.igx-nav-drawer')
69+
public cssClass = true;
6670

6771
/**
6872
* ID of the component

0 commit comments

Comments
 (0)