Skip to content

Commit bdcc53b

Browse files
authored
Merge branch 'master' into vslavov/tree-POC
2 parents a2fc262 + 0555a17 commit bdcc53b

29 files changed

+349
-153
lines changed

CHANGELOG.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes for each version of this project will be documented in this
44

55
## 12.0.0
66

7+
### General
8+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
9+
- **Breaking Change** - The `locale` and `pipeArgs` parameters are removed from the `operate` method exposed by the `IgxNumberSummaryOperand`, `IgxDateSummaryOperand`, `IgxCurrencySummaryOperand` and `IgxPercentSummaryOperand`. They are now set in the `igx-grid-summary-cell` template. To change the locale and format setting of the `igx-grid-summary-cell` the user can use the new `summaryFormatter` property of the `IgxColumnComponent`.
10+
711
### New Features
812
- `IgxForOf`, `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
913
- **Behavioral Change** - Virtual containers now scroll smoothly when using the mouse wheel(s) to scroll them horizontally or vertically. This behavior more closely resembles the scrolling behavior of non-virtualized containers in most modern browsers.
@@ -16,11 +20,28 @@ All notable changes for each version of this project will be documented in this
1620
</ng-template>
1721
</igx-grid>
1822
```
23+
- A new `summaryFormatter` input property is exposed by the `IgxColumnComponent`, which is used to format the displayed summary values for the columns.
24+
```typescript
25+
public dateSummaryFormat(summary: IgxSummaryResult, summaryOperand: IgxSummaryOperand): string {
26+
const result = summary.summaryResult;
27+
if(summaryOperand instanceof IgxDateSummaryOperand && summary.key !== 'count'
28+
&& result !== null && result !== undefined) {
29+
const pipe = new DatePipe('en-US');
30+
return pipe.transform(result,'MMM YYYY');
31+
}
32+
return result;
33+
}
34+
```
35+
```html
36+
<igx-column field="OrderDate" header="Order Date" [sortable]="true" [disableHiding]="true" [dataType]="'date'" [hasSummary]="true"
37+
[summaryFormatter]="dateSummaryFormat">
38+
</igx-column>
39+
```
1940
### Themes:
2041
- Breaking Changes:
2142
- `IgxButton` theme has been simplified. The number of theme params (`igx-button-theme`) has been reduced significantly and no longer includes prefixed parameters (`flat-*`, `raised-*`, etc.). See the migration guide to update existing button themes. Updates performed with `ng update` will migrate existing button themes but some additional tweaking may be required to account for the abscense of prefixed params.
2243
- The `igx-typography` mixin is no longer implicitly included with `igx-core`. To use our typography styles users have to include the mixin explicitly:
23-
44+
2445
```html
2546
@include igx-core();
2647
/// Example with Indigo Design theme:
@@ -48,10 +69,10 @@ All notable changes for each version of this project will be documented in this
4869
- Added support for exporting grouped data.
4970
- `IgxTreeGrid`
5071
- Added `multipleCascade` row selection mode. In this mode, selecting a record results in the selection of all its children recursively. When only some children are selected, their parent's checkbox is in an indeterminate state.
51-
72+
5273

5374
```html
54-
<igx-tree-grid [rowSelection]="'multipleCascade'">
75+
<igx-tree-grid [rowSelection]="'multipleCascade'">
5576
</igx-tree-grid>
5677
```
5778
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
@@ -65,7 +86,7 @@ All notable changes for each version of this project will be documented in this
6586
- `Column Resizing` now does not exit edit mode.
6687
- `IgxInput` now supports `type="file"` and its styling upon all themes.
6788
_Note: validation of file type input is not yet supported._
68-
- `igxSplitter` now has the following additional outputs:
89+
- `igxSplitter` now has the following additional outputs:
6990
- `resizeStart` - Emits when pane resizing starts.
7091
- `resizing`- Emits while panes are being resized.
7192
- `resizeEnd` - Emits when pane resizing ends.

projects/igniteui-angular/src/lib/core/styles/components/drop-down/_drop-down-theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
%igx-drop-down__list-scroll {
263263
overflow-y: auto;
264264
overflow-x: hidden;
265+
-webkit-overflow-scrolling: touch;
265266
position: relative;
266267

267268
igx-input-group {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,10 @@
752752
color: inherit;
753753
}
754754
}
755+
756+
> [aria-activedescendant] {
757+
outline-style: none;
758+
}
755759
}
756760

757761
%grid-thead {
@@ -1771,6 +1775,7 @@
17711775
display: flex;
17721776
overflow: hidden;
17731777
background: --var($theme, 'root-summaries-background');
1778+
outline-style: none;
17741779

17751780
%igx-grid-summary__result {
17761781
color: --var($theme, 'root-summaries-text-color');

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,12 @@
7171
background: --var($theme, 'thumb-background');
7272
}
7373
}
74+
75+
@media (hover: none) {
76+
%scrollbar-display ::-webkit-scrollbar {
77+
width: auto;
78+
height: auto;
79+
}
80+
}
7481
}
7582

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { IgxGridFilteringCellComponent } from '../filtering/base/grid-filtering-
3636
import { IgxGridHeaderGroupComponent } from '../headers/grid-header-group.component';
3737
import { getNodeSizeViaRange } from '../../core/utils';
3838
import { IgxSummaryOperand, IgxNumberSummaryOperand, IgxDateSummaryOperand,
39-
IgxCurrencySummaryOperand, IgxPercentSummaryOperand } from '../summaries/grid-summary';
39+
IgxCurrencySummaryOperand, IgxPercentSummaryOperand, IgxSummaryResult } from '../summaries/grid-summary';
4040
import {
4141
IgxCellTemplateDirective,
4242
IgxCellHeaderTemplateDirective,
@@ -575,6 +575,37 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy {
575575
@WatchColumnChanges()
576576
@Input()
577577
public formatter: (value: any) => any;
578+
579+
/**
580+
* The summaryFormatter is used to format the display of the column summaries.
581+
*
582+
* In this example, we check to see if the column name is OrderDate, and then provide a method as the summaryFormatter
583+
* to change the locale for the dates to 'fr-FR'. The summaries with the count key are skipped so they are displayed as numbers.
584+
*
585+
* ```typescript
586+
* onColumnInit(column: IgxColumnComponent) {
587+
* if (column.field == "OrderDate") {
588+
* column.summaryFormatter = this.summaryFormat;
589+
* }
590+
* }
591+
*
592+
* summaryFormat(summary: IgxSummaryResult, summaryOperand: IgxSummaryOperand): string {
593+
* const result = summary.summaryResult;
594+
* if(summaryResult.key !== 'count' && result !== null && result !== undefined) {
595+
* const pipe = new DatePipe('fr-FR');
596+
* return pipe.transform(result,'mediumDate');
597+
* }
598+
* return result;
599+
* }
600+
* ```
601+
*
602+
* @memberof IgxColumnComponent
603+
*/
604+
@notifyChanges()
605+
@WatchColumnChanges()
606+
@Input()
607+
public summaryFormatter: (summary: IgxSummaryResult, summaryOperand: IgxSummaryOperand) => any;
608+
578609
/**
579610
* Sets/gets whether the column filtering should be case sensitive.
580611
* Default value is `true`.

projects/igniteui-angular/src/lib/grids/common/grid-pipes.module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
IgxStringReplacePipe,
1818
IgxGridTransactionStatePipe,
1919
IgxColumnFormatterPipe,
20+
IgxSummaryFormatterPipe,
2021
IgxGridAddRowPipe
2122
} from './pipes';
2223

@@ -38,7 +39,8 @@ import {
3839
IgxStringReplacePipe,
3940
IgxGridTransactionStatePipe,
4041
IgxGridAddRowPipe,
41-
IgxColumnFormatterPipe
42+
IgxColumnFormatterPipe,
43+
IgxSummaryFormatterPipe
4244
],
4345
exports: [
4446
IgxGridFilterConditionPipe,
@@ -57,7 +59,8 @@ import {
5759
IgxStringReplacePipe,
5860
IgxGridTransactionStatePipe,
5961
IgxGridAddRowPipe,
60-
IgxColumnFormatterPipe
62+
IgxColumnFormatterPipe,
63+
IgxSummaryFormatterPipe
6164
],
6265
imports: [
6366
CommonModule

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { GridType } from './grid.interface';
77
import { IgxColumnComponent } from '../columns/column.component';
88
import { ColumnDisplayOrder } from './enums';
99
import { IgxColumnActionsComponent } from '../column-actions/column-actions.component';
10+
import { IgxSummaryOperand, IgxSummaryResult } from '../grid/public_api';
1011

1112
/**
1213
* @hidden
@@ -308,6 +309,15 @@ export class IgxColumnFormatterPipe implements PipeTransform {
308309
}
309310
}
310311

312+
@Pipe({ name: 'summaryFormatter' })
313+
export class IgxSummaryFormatterPipe implements PipeTransform {
314+
315+
transform(summaryResult: IgxSummaryResult, summaryOperand: IgxSummaryOperand,
316+
summaryFormatter: (s: IgxSummaryResult, o: IgxSummaryOperand) => any) {
317+
return summaryFormatter(summaryResult, summaryOperand);
318+
}
319+
}
320+
311321
@Pipe({
312322
name: 'gridAddRow',
313323
pure: true

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,11 +2259,14 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
22592259

22602260
public get activeDescendant() {
22612261
const activeElem = this.navigation.activeNode;
2262-
if (activeElem) {
2263-
return !this.navigation.isDataRow(activeElem.row, true) ? this.id + '_' + activeElem.row :
2264-
this.id + '_' + activeElem.row + '_' + activeElem.column;
2262+
2263+
if (!activeElem || !Object.keys(activeElem).length) {
2264+
return this.id;
22652265
}
2266-
return null;
2266+
2267+
return activeElem.row < 0 ?
2268+
`${this.id}_${activeElem.row}_${activeElem.mchCache.level}_${activeElem.column}` :
2269+
`${this.id}_${activeElem.row}_${activeElem.column}`;
22672270
}
22682271

22692272
/**

projects/igniteui-angular/src/lib/grids/grid/column-hiding.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ describe('Column Hiding UI #grid', () => {
669669
const toolbar = GridFunctions.getToolbar(fix);
670670
const gridHeader = GridFunctions.getGridHeader(fix);
671671
const gridScroll = GridFunctions.getGridScroll(fix);
672-
const gridFooter = GridFunctions.getGridFooter(fix);
672+
const gridFooter = GridFunctions.getGridFooterWrapper(fix);
673673
let expectedHeight = parseInt(window.getComputedStyle(grid.nativeElement).height, 10)
674674
- parseInt(window.getComputedStyle(toolbar.nativeElement).height, 10)
675675
- parseInt(window.getComputedStyle(gridHeader.nativeElement).height, 10)

0 commit comments

Comments
 (0)