Skip to content

Commit 6dbf0d0

Browse files
MKirovaMKirova
authored andcommitted
Merge branch 'mkirova/fix-6411-9.0.x' of https://github.com/IgniteUI/igniteui-angular.git
2 parents e655467 + edee2ce commit 6dbf0d0

File tree

11 files changed

+401
-290
lines changed

11 files changed

+401
-290
lines changed

ROADMAP.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66
1. Dock Manger [#5980](https://github.com/IgniteUI/igniteui-angular/issues/5980)
77
2. Theming service for Ignite UI for Angular [#5999](https://github.com/IgniteUI/igniteui-angular/issues/5999)
88
3. Range Date Picker [#5732](https://github.com/IgniteUI/igniteui-angular/issues/5732)
9-
4. igxGrid overlay components exposed for instantiation in arbitrary container [#5878](https://github.com/IgniteUI/igniteui-angular/issues/5878)
9+
4. **[DONE]** igxGrid overlay components exposed for instantiation in arbitrary container [#5878](https://github.com/IgniteUI/igniteui-angular/issues/5878)
1010
5. RTL Support across Ignite UI for Angular components [#5958](https://github.com/IgniteUI/igniteui-angular/issues/5958)
11-
6. Carousel slide animations/transitions [#4268](https://github.com/IgniteUI/igniteui-angular/issues/4268)
12-
7. Access all data when calculating summary per column [#5754](https://github.com/IgniteUI/igniteui-angular/issues/5754)
11+
6. **[DONE]** Carousel slide animations/transitions [#4268](https://github.com/IgniteUI/igniteui-angular/issues/4268)
12+
7. **[DONE]** Access all data when calculating summary per column [#5754](https://github.com/IgniteUI/igniteui-angular/issues/5754)
1313
8. Angular 9 support [#5998](https://github.com/IgniteUI/igniteui-angular/issues/5998)
14-
9. Allow master-detail style visualization with igxHierarchicalGrid [#5880](https://github.com/IgniteUI/igniteui-angular/issues/5880)
15-
10. Collapsible column groups (column expansion state templates) [#3343](https://github.com/IgniteUI/igniteui-angular/issues/3343)
14+
9. **[DONE]** Allow master-detail style visualization with igxHierarchicalGrid [#5880](https://github.com/IgniteUI/igniteui-angular/issues/5880)
15+
10. **[DONE]** Collapsible column groups (column expansion state templates) [#3343](https://github.com/IgniteUI/igniteui-angular/issues/3343)
1616

1717
## Going down the road
1818

1919
1. Row-pinning
20-
2. Column Groups expand/collapse, with column grouping templates
21-
3. Visual Cell merging
22-
4. Splitter
23-
5. PDF Integration
20+
2. Visual Cell merging
21+
3. Splitter
22+
4. PDF Integration
2423

2524
# Previous Milestones
2625

package-lock.json

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

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@
4545
},
4646
"private": true,
4747
"dependencies": {
48-
"@angular/animations": "^9.0.0-rc.5",
49-
"@angular/common": "^9.0.0-rc.5",
50-
"@angular/compiler": "^9.0.0-rc.5",
51-
"@angular/core": "^9.0.0-rc.5",
52-
"@angular/forms": "^9.0.0-rc.5",
53-
"@angular/platform-browser": "^9.0.0-rc.5",
54-
"@angular/platform-browser-dynamic": "^9.0.0-rc.5",
55-
"@angular/router": "^9.0.0-rc.5",
48+
"@angular/animations": "^9.0.0-rc.7",
49+
"@angular/common": "^9.0.0-rc.7",
50+
"@angular/compiler": "^9.0.0-rc.7",
51+
"@angular/core": "^9.0.0-rc.7",
52+
"@angular/forms": "^9.0.0-rc.7",
53+
"@angular/platform-browser": "^9.0.0-rc.7",
54+
"@angular/platform-browser-dynamic": "^9.0.0-rc.7",
55+
"@angular/router": "^9.0.0-rc.7",
5656
"@types/hammerjs": "^2.0.36",
5757
"@types/source-map": "0.5.2",
5858
"classlist.js": "^1.1.20150312",
@@ -66,12 +66,12 @@
6666
"zone.js": "~0.10.2"
6767
},
6868
"devDependencies": {
69-
"@angular-devkit/build-angular": "~0.900.0-rc.5",
70-
"@angular-devkit/build-ng-packagr": "~0.900.0-rc.5",
69+
"@angular-devkit/build-angular": "~0.900.0-rc.7",
70+
"@angular-devkit/build-ng-packagr": "~0.900.0-rc.7",
7171
"@angular-devkit/schematics": "^7.2.1",
72-
"@angular/cli": "~9.0.0-rc.5",
73-
"@angular/compiler-cli": "^9.0.0-rc.5",
74-
"@angular/language-service": "^9.0.0-rc.5",
72+
"@angular/cli": "~9.0.0-rc.7",
73+
"@angular/compiler-cli": "^9.0.0-rc.7",
74+
"@angular/language-service": "^9.0.0-rc.7",
7575
"@angularclass/hmr": "^2.1.3",
7676
"@types/jasmine": "~3.3.5",
7777
"@types/jasminewd2": "~2.0.6",

projects/igniteui-angular/src/lib/directives/template-outlet/template_outlet.directive.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export class IgxTemplateOutletDirective implements OnChanges {
3232
@Output()
3333
public onCachedViewLoaded = new EventEmitter<ICachedViewLoadedEventArgs>();
3434

35+
@Output()
36+
public onBeforeViewDetach = new EventEmitter<IViewChangeEventArgs>();
37+
3538
constructor(public _viewContainerRef: ViewContainerRef, private _zone: NgZone, public cdr: ChangeDetectorRef) {
3639
}
3740

@@ -66,6 +69,7 @@ export class IgxTemplateOutletDirective implements OnChanges {
6669
const prevIndex = this._viewRef ? this._viewContainerRef.indexOf(this._viewRef) : -1;
6770
// detach old and create new
6871
if (prevIndex !== -1) {
72+
this.onBeforeViewDetach.emit({ owner: this, view: this._viewRef, context: this.igxTemplateOutletContext });
6973
this._viewContainerRef.detach(prevIndex);
7074
}
7175
if (this.igxTemplateOutlet) {
@@ -92,9 +96,11 @@ export class IgxTemplateOutletDirective implements OnChanges {
9296
if (view !== this._viewRef) {
9397
if (owner._viewContainerRef.indexOf(view) !== -1) {
9498
// detach in case view it is attached somewhere else at the moment.
99+
this.onBeforeViewDetach.emit({ owner: this, view: this._viewRef, context: this.igxTemplateOutletContext });
95100
owner._viewContainerRef.detach(owner._viewContainerRef.indexOf(view));
96101
}
97102
if (this._viewRef && this._viewContainerRef.indexOf(this._viewRef) !== -1) {
103+
this.onBeforeViewDetach.emit({ owner: this, view: this._viewRef, context: this.igxTemplateOutletContext });
98104
this._viewContainerRef.detach(this._viewContainerRef.indexOf(this._viewRef));
99105
}
100106
this._viewRef = view;
@@ -113,6 +119,7 @@ export class IgxTemplateOutletDirective implements OnChanges {
113119
// then detach old view and insert the stored one with the matching template
114120
// after that update its context.
115121
if (this._viewContainerRef.length > 0) {
122+
this.onBeforeViewDetach.emit({ owner: this, view: this._viewRef, context: this.igxTemplateOutletContext });
116123
this._viewContainerRef.detach(this._viewContainerRef.indexOf(this._viewRef));
117124
}
118125

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6012,6 +6012,19 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
60126012
return this.cellSelection !== GridSelectionMode.none;
60136013
}
60146014

6015+
public viewDetachHandler(args: ICachedViewLoadedEventArgs) {
6016+
const context = args.view.context;
6017+
if (context['templateID'] === 'dataRow') {
6018+
// some browsers (like FireFox and Edge) do not trigger onBlur when the focused element is detached from DOM
6019+
// hence we need to trigger it manually when cell is detached.
6020+
const row = this.getRowByIndex(context.index);
6021+
const focusedCell = row.cells.find(x => x.focused);
6022+
if (focusedCell) {
6023+
focusedCell.onBlur();
6024+
}
6025+
}
6026+
}
6027+
60156028
/**
60166029
* @hidden
60176030
*/

projects/igniteui-angular/src/lib/grids/grid/grid-row-selection.spec.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { GridFunctions, GridSelectionFunctions } from '../../test-utils/grid-fun
1919
import { SampleTestData } from '../../test-utils/sample-test-data.spec';
2020
import { GridSelectionMode } from '../common/enums';
2121
import { IgxGridSelectionModule } from '../selection/selection.module';
22+
import { FilteringExpressionsTree } from '../../data-operations/filtering-expressions-tree';
23+
import { FilteringLogic } from '../../data-operations/filtering-expression.interface';
2224

2325
const DEBOUNCETIME = 30;
2426

@@ -1671,6 +1673,38 @@ describe('IgxGrid - Row Selection #grid', () => {
16711673
expect(grid.getRowByIndex(1).selected).toBeTruthy();
16721674
expect(grid.onRowSelectionChange.emit).toHaveBeenCalledTimes(6);
16731675
}));
1676+
1677+
it('Should select only filtered records', fakeAsync(() => {
1678+
grid.height = '1100px';
1679+
const tree = new FilteringExpressionsTree(FilteringLogic.And);
1680+
tree.filteringOperands.push({
1681+
fieldName: 'UnitsInStock',
1682+
searchVal: 0,
1683+
condition: IgxNumberFilteringOperand.instance().condition('greaterThan'),
1684+
});
1685+
tree.filteringOperands.push({
1686+
fieldName: 'ProductName',
1687+
searchVal: 'a',
1688+
condition: IgxStringFilteringOperand.instance().condition('contains'),
1689+
ignoreCase: true
1690+
});
1691+
grid.advancedFilteringExpressionsTree = tree;
1692+
GridSelectionFunctions.headerCheckboxClick(grid);
1693+
fix.detectChanges();
1694+
tick();
1695+
1696+
expect(grid.rowList.length).toBe(9);
1697+
expect(grid.selectedRows().length).toBe(9);
1698+
GridSelectionFunctions.verifyHeaderRowCheckboxState(grid, true, false);
1699+
1700+
grid.advancedFilteringExpressionsTree = null;
1701+
fix.detectChanges();
1702+
tick();
1703+
1704+
expect(grid.rowList.length).toBe(19);
1705+
expect(grid.selectedRows().length).toBe(9);
1706+
GridSelectionFunctions.verifyHeaderRowCheckboxState(grid, false, true);
1707+
}));
16741708
});
16751709

16761710
describe('Integration with CRUD and transactions', () => {

projects/igniteui-angular/src/lib/grids/grid/grid.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
[igxTemplateOutletContext]='getContext(rowData, rowIndex)'
123123
(onCachedViewLoaded)='cachedViewLoaded($event)'
124124
(onViewCreated)='viewCreatedHandler($event)'
125-
(onViewMoved)='viewMovedHandler($event)'>
125+
(onViewMoved)='viewMovedHandler($event)'
126+
(onBeforeViewDetach)='viewDetachHandler($event)'>
126127
</ng-template>
127128
</ng-template>
128129
<ng-template #record_template let-rowIndex="index" let-rowData>

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@
108108
<ng-template
109109
[igxTemplateOutlet]='(isHierarchicalRecord(rowData) ? hierarchical_record_template : (isChildGridRecord(rowData) && isExpanded(rowData) ? child_record_template : hierarchical_record_template))'
110110
[igxTemplateOutletContext]='getContext(rowData)' (onViewCreated)='viewCreatedHandler($event)'
111-
(onViewMoved)='viewMovedHandler($event)' (onCachedViewLoaded)='cachedViewLoaded($event)'></ng-template>
111+
(onViewMoved)='viewMovedHandler($event)' (onCachedViewLoaded)='cachedViewLoaded($event)'
112+
(onBeforeViewDetach)='viewDetachHandler($event)'></ng-template>
112113
<!-- <ng-container *igxTemplateOutlet="(isHierarchicalRecord(rowData) ? hierarchical_record_template : (isChildGridRecord(rowData) && isExpanded(rowData) ? child_record_template : hierarchical_record_template)); context: getContext(rowData)"></ng-container> -->
113114
</ng-template>
114115
<ng-container *ngTemplateOutlet="template"></ng-container>

projects/igniteui-angular/src/lib/grids/row-drag.directive.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { fromEvent, Subscription } from 'rxjs';
55
import { IgxRowDirective, IgxGridBaseDirective } from './grid';
66
import { IRowDragStartEventArgs, IRowDragEndEventArgs } from './common/events';
77
import { GridType } from './common/grid.interface';
8+
import { IgxHierarchicalRowComponent } from './hierarchical-grid/hierarchical-row.component';
89

910

1011
const ghostBackgroundClass = 'igx-grid__tr--ghost';
@@ -107,6 +108,15 @@ export class IgxRowDragDirective extends IgxDragDirective implements OnDestroy {
107108
};
108109
super.createGhost(pageX, pageY, this.row.nativeElement);
109110

111+
// check if there is an expander icon and create the ghost at the corresponding position
112+
if (this.isHierarchicalGrid) {
113+
const row = this.row as IgxHierarchicalRowComponent;
114+
if (row.expander) {
115+
const expanderWidth = row.expander.nativeElement.getBoundingClientRect().width;
116+
this._ghostHostX += expanderWidth;
117+
}
118+
}
119+
110120
const ghost = this.ghostElement;
111121

112122
const gridRect = this.row.grid.nativeElement.getBoundingClientRect();
@@ -145,6 +155,10 @@ export class IgxRowDragDirective extends IgxDragDirective implements OnDestroy {
145155
}
146156
this.endDragging();
147157
}
158+
159+
private get isHierarchicalGrid() {
160+
return this.row.grid.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid';
161+
}
148162
}
149163

150164
/**

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Injectable, EventEmitter, NgZone } from '@angular/core';
22
import { IGridEditEventArgs } from '../common/events';
3+
import { IgxGridBaseDirective } from '../grid';
4+
import { FilteringExpressionsTree } from '../../data-operations/filtering-expressions-tree';
35

46

57
export interface GridSelectionRange {
@@ -689,7 +691,9 @@ export class IgxGridSelectionService {
689691
}
690692

691693
private isFilteringApplied(): boolean {
692-
return this.grid.filteringExpressionsTree.filteringOperands.length > 0;
694+
const grid = this.grid as IgxGridBaseDirective;
695+
return !FilteringExpressionsTree.empty(grid.filteringExpressionsTree) ||
696+
!FilteringExpressionsTree.empty(grid.advancedFilteringExpressionsTree);
693697
}
694698

695699
private isRowDeleted(rowID): boolean {

0 commit comments

Comments
 (0)