Skip to content

Commit 4941f26

Browse files
authored
Merge branch '10.0.x' into SIvanova/ExcelStyleFiltering
2 parents 61a5f4d + 6e6a53f commit 4941f26

File tree

9 files changed

+43
-7
lines changed

9 files changed

+43
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All notable changes for each version of this project will be documented in this
2727
### General
2828
- `igxGrid`
2929
- **Behavioral Change** - Group rows now display the group column's header name instead of field when one is available.
30+
- Each grid now expose a default handling for boolean column types. The column will display `check` or `close` icon, instead of true/false by default.
3031
- `igx-select`, `igx-combo`, `igx-drop-down`
3132
- **Behavioral Change** - The select, combo, and dropdown items now have display block and text-overflow ellipsis enabled by default. This requires styling to be handled on the application-level if there is something more than a simple text in the item.
3233
- `IgxTransaction` - The `onStateUpdate` now emits with information of its origin. The emitted value is of type `StateUpdateEvent`, which has two properties:

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,14 @@
325325
@extend %grid-cell--cross-selected !optional;
326326
}
327327

328+
@include e(td, $m: bool) {
329+
@extend %igx-grid__td--bool !optional;
330+
}
331+
332+
@include e(td, $m: bool-true) {
333+
@extend %igx-grid__td--bool-true !optional;
334+
}
335+
328336
@include e(tr, $mods: (selected, filtered)) {
329337
@extend %grid-row--selected--filtered !optional;
330338
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,23 @@
11361136
bottom: 0;
11371137
}
11381138

1139+
%igx-grid__td--bool {
1140+
justify-content: center;
1141+
1142+
igx-icon {
1143+
height: rem(18px);
1144+
width: rem(18px);
1145+
font-size: rem(18px);
1146+
color: igx-color($palette, 'grays', 500);
1147+
}
1148+
}
1149+
1150+
%igx-grid__td--bool-true {
1151+
igx-icon {
1152+
color: igx-color($palette, 'grays', 700);
1153+
}
1154+
}
1155+
11391156
%igx-grid__tr--edit {
11401157
border-bottom: 1px solid --var($theme, 'edit-mode-color');
11411158
position: relative;

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
</ng-template>
44
<ng-template #defaultCell>
55
<div igxTextHighlight style="pointer-events: none" [cssClass]="highlightClass" [activeCssClass]="activeHighlightClass" [groupName]="gridID"
6-
[value]="formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value"
7-
[row]="rowData" [column]="this.column.field" [containerClass]="'igx-grid__td-text'" [metadata]="searchMetadata"
8-
class="igx-grid__td-text">{{ formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal:
9-
grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</div>
6+
[value]="formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value"
7+
[row]="rowData" [column]="this.column.field" [containerClass]="'igx-grid__td-text'" [metadata]="searchMetadata"
8+
class="igx-grid__td-text">{{ formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal:
9+
grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : column.dataType === 'boolean' ? "" : value }}</div>
10+
<igx-icon *ngIf="column.dataType === 'boolean'">{{value ? 'check' : 'close'}}</igx-icon>
1011
</ng-template>
1112
<ng-template #inlineEditor let-cell="cell">
1213
<ng-container *ngIf="column.dataType === 'string'">

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
285285
return `${this.row.gridID}_${this.rowIndex}_${ this.visibleColumnIndex}`;
286286
}
287287

288+
@HostBinding('class.igx-grid__td--bool-true')
289+
public get booleanClass() {
290+
return this.column.dataType === 'boolean' && this.value;
291+
}
292+
288293
/**
289294
* Returns a reference to the nativeElement of the cell.
290295
* ```typescript

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
class="igx-grid__td igx-grid__td--fw"
9191
[class.igx-grid__td--pinned]="col.pinned"
9292
[class.igx-grid__td--number]="col.dataType === 'number'"
93+
[class.igx-grid__td--bool]="col.dataType === 'boolean'"
9394
[ngClass]="col.cellClasses | igxCellStyleClasses:rowData[col.field]:rowData:col.field:viewIndex"
9495
[ngStyle]="col.cellStyles | igxCellStyles:rowData[col.field]:rowData:col.field:viewIndex"
9596
[editMode]="col.editable && crudService.isInEditMode(index, col.index)"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<igx-hierarchical-grid-cell
4242
class="igx-grid__td igx-grid__td--fw"
4343
[class.igx-grid__td--number]="col.dataType === 'number'"
44+
[class.igx-grid__td--bool]="col.dataType === 'boolean'"
4445
[ngClass]="col.cellClasses | igxCellStyleClasses:rowData[col.field]:rowData:col.field:viewIndex"
4546
[ngStyle]="col.cellStyles | igxCellStyles:rowData[col.field]:rowData:col.field:viewIndex"
4647
[editMode]="col.editable && crudService.isInEditMode(index, col.index)"
@@ -108,4 +109,4 @@
108109
[cellSelectionMode]="grid.cellSelection"
109110
[displayPinnedChip]="shouldDisplayPinnedChip(col.visibleIndex)">
110111
</igx-hierarchical-grid-cell>
111-
</ng-template>
112+
</ng-template>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[value]="formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value"
77
[row]="rowData" [column]="this.column.field" [containerClass]="'igx-grid__td-text'" [metadata]="searchMetadata"
88
class="igx-grid__td-text">{{ formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal:
9-
grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</div>
9+
grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : column.dataType === 'boolean' ? "" : value }}</div>
10+
<igx-icon *ngIf="column.dataType === 'boolean'">{{value ? 'check' : 'close'}}</igx-icon>
1011
</ng-template>
1112
<ng-template #inlineEditor let-cell="cell">
1213
<ng-container *ngIf="column.dataType === 'string'">

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<igx-grid-cell
2020
class="igx-grid__td igx-grid__td--fw"
2121
[class.igx-grid__td--number]="col.dataType === 'number'"
22+
[class.igx-grid__td--bool]="col.dataType === 'boolean'"
2223
[ngClass]="col.cellClasses | igxCellStyleClasses:rowData[col.field]:rowData:col.field:viewIndex"
2324
[ngStyle]="col.cellStyles | igxCellStyles:rowData[col.field]:rowData:col.field:viewIndex"
2425
[editMode]="col.editable && crudService.isInEditMode(index, col.index)"
@@ -155,4 +156,4 @@
155156
</ng-template>
156157
<ng-container *ngTemplateOutlet="col.visibleIndex === 0 ? treeCellTemplate : cellTemplate"></ng-container>
157158
</ng-template>
158-
</ng-template>
159+
</ng-template>

0 commit comments

Comments
 (0)