Skip to content

Commit 75cdc50

Browse files
authored
Merge branch 'master' into simeonoff/css-var-refs
2 parents 71fe759 + 9879695 commit 75cdc50

33 files changed

+369
-157
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/base/utilities/_mixins.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,16 @@
346346
@content;
347347
}
348348
}
349+
350+
/// Truncates text at a specific number of lines
351+
/// @param {number|string} $lines - The number of lines to show
352+
/// @param {Boolean} $inline - Sets whether an element displays inline-box or box
353+
/// @param {Boolean} $vertical - Sets whether an element lays out its contents horizontally or vertically
354+
/// @example scss Truncates text after the fourth line
355+
/// @include line-clamp(4, true, true);
356+
@mixin line-clamp($lines, $inline, $vertical) {
357+
display: if($inline, -webkit-inline-box, -webkit-box);
358+
-webkit-line-clamp: if($lines, $lines, initial);
359+
-webkit-box-orient: if($vertical, vertical, initial);
360+
overflow: hidden;
361+
}

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
@@ -265,6 +265,7 @@
265265
%igx-drop-down__list-scroll {
266266
overflow-y: auto;
267267
overflow-x: hidden;
268+
-webkit-overflow-scrolling: touch;
268269
position: relative;
269270

270271
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
@@ -750,6 +750,10 @@
750750
color: inherit;
751751
}
752752
}
753+
754+
> [aria-activedescendant] {
755+
outline-style: none;
756+
}
753757
}
754758

755759
%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/navbar/_navbar-theme.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
@mixin igx-navbar($theme) {
9191
@include igx-css-vars($theme);
9292

93-
$navbar-padding: 0 rem(16px);
93+
$navbar-padding: rem(16px);
9494
$navbar-title-fz: rem(18px, 16px);
9595
$navbar-title-lh: rem(18px, 16px);
9696
$navbar-title-margin: 0;
@@ -103,12 +103,14 @@
103103
align-items: center;
104104
justify-content: space-between;
105105
width: 100%;
106-
height: 56px;
106+
min-height: 56px;
107+
max-height: 128px;
107108
padding: $navbar-padding;
108109
background: --var($theme, 'background');
109110
color: --var($theme, 'text-color');
110111
box-shadow: --var($theme, 'shadow');
111112
z-index: 4;
113+
overflow: hidden;
112114
}
113115

114116
%igx-navbar-part {
@@ -117,6 +119,7 @@
117119
}
118120

119121
%igx-navbar-title {
122+
@include line-clamp(4, true, true);
120123
margin: $navbar-title-margin;
121124
flex-grow: 1;
122125
user-select: text;

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
@@ -73,5 +73,12 @@
7373
background: --var($theme, 'thumb-background');
7474
}
7575
}
76+
77+
@media (hover: none) {
78+
%scrollbar-display ::-webkit-scrollbar {
79+
width: auto;
80+
height: auto;
81+
}
82+
}
7683
}
7784

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
/**

0 commit comments

Comments
 (0)