Skip to content

Commit d1c373c

Browse files
authored
Merge branch 'master' into rkaraivanov/multi-column-headers
2 parents c9beca0 + 4d713f5 commit d1c373c

File tree

16 files changed

+212
-71
lines changed

16 files changed

+212
-71
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ export class IgxCustomFilteringOperand extends IgxFilteringOperand {
5757
```
5858
For more information, please head over to `igxGrid`'s [ReadMe](https://github.com/IgniteUI/igniteui-angular/blob/master/src/grid/README.md) or the [official documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid_groupby.html).
5959

60+
- `igxGrid` theme now has support for alternating grid row background and text colors.
6061
- `igxColumn` changes:
6162
- **Breaking change** filteringExpressions property is removed.
6263

64+
- `igxCell` default editing template is changed according column data type. For more information you can read the [specification](https://github.com/IgniteUI/igniteui-angular/wiki/Cell-Editing) or the [official documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid_editing.html)
65+
6366
- `igxToggle` changes
6467
- `onOpening` event added.
6568
- `onClosing` event added.
@@ -73,15 +76,18 @@ export class IgxCustomFilteringOperand extends IgxFilteringOperand {
7376
- `onClose` event renamed to `onClosed`.
7477
- **Breaking change** All properties that were named `isDisabled` have been renamed to `disabled` in order to acheive consistency across our component suite. This affects: date-picker, input directive, input-group, dropdown-item, tabbar and time-picker.
7578

79+
## 6.0.3
80+
- **igxGrid** exposing the `filteredSortedData` method publicly - returns the grid data with current filtering and sorting applied.
81+
7682
## 6.0.2
7783
- **igxGrid** Improve scrolling on mac [#1563](https://github.com/IgniteUI/igniteui-angular/pull/1563)
7884
- The `ng update igniteui-angular` migration schematics now also update the theme import path in SASS files. [#1582](https://github.com/IgniteUI/igniteui-angular/issues/1582)
7985

8086
## 6.0.1
8187
- Introduced migration schematics to integrate with the Angular CLI update command. You can now run
82-
88+
8389
`ng update igniteui-angular`
84-
90+
8591
in existing projects to both update the package and apply any migrations needed to your project. Make sure to commit project state before proceeding.
8692
Currently these cover converting submodule imports as well as the deprecation of `igxForRemote` and rename of `igx-tab-bar` to `igx-bottom-nav` from 6.0.0.
8793
- **Breaking changes**:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@
110110

111111
fab-text-color: igx-contrast-color($palette, 'secondary', 500),
112112
fab-background: igx-color($palette, 'secondary', 500),
113-
fab-hover-text-color: null,
114-
fab-hover-background: null,
113+
fab-hover-text-color: igx-contrast-color($palette, 'secondary', 500),
114+
fab-hover-background: igx-color($palette, 'secondary', 400),
115115
fab-focus-background: igx-color($palette, 'secondary', 500),
116116
fab-focus-text-color: igx-contrast-color($palette, 'secondary', 500),
117117

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
) {
5252
$default-theme: (
5353
name: 'igx-grid-filtering',
54+
toggle-background: transparent,
5455
toggle-icon-color: inherit,
5556
toggle-icon-hover-color: #fff,
5657
toggle-icon-active-color: igx-contrast-color($palette, 'secondary'),
@@ -60,7 +61,8 @@
6061
toggle-filtered-background: transparent,
6162
menu-background: #fff,
6263
menu-text-color: igx-color($palette, 'grays', 900),
63-
menu-button-text-color: igx-color($palette, 'secondary')
64+
menu-button-text-color: igx-color($palette, 'secondary'),
65+
menu-button-disabled-text-color: initial
6466
);
6567

6668
@if not($menu-text-color) and $menu-background {
@@ -213,7 +215,7 @@
213215
color: --var($theme, 'menu-button-text-color');
214216

215217
&:disabled {
216-
color: --var($theme, 'menu-button-text-color');
218+
color: --var($theme, 'menu-button-disabled-text-color');
217219
}
218220
}
219221

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160

161161
%igx-grid-summary__result {
162162
color: --var($theme, 'result-color');
163-
font-weight: 800;
163+
font-weight: 600;
164164
flex: 1 1 auto;
165165
text-align: right;
166166
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@
7878
}
7979
}
8080

81+
@include e(tr, $m: odd) {
82+
@extend %grid-row--odd !optional;
83+
}
84+
85+
@include e(tr, $m: even) {
86+
@extend %grid-row--even !optional;
87+
}
88+
8189
@include e(tr, $m: selected) {
8290
@extend %grid-row--selected !optional;
8391
}
@@ -156,6 +164,10 @@
156164
@extend %grid-cell--fixed-width !optional;
157165
}
158166

167+
@include e(td-text) {
168+
@extend %grid-cell-text !optional;
169+
}
170+
159171
@include e(cbx-selection) {
160172
@extend %grid__cbx-selection !optional;
161173
}

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

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313
/// @param {Color} $ghost-header-background [null] - The dragged header background color.
1414
/// @param {Color} $content-background [null] - The table body background color.
1515
/// @param {Color} $content-text-color [null] - The table body text color.
16+
/// @param {Color} $row-odd-background [null] - The background color of odd rows.
17+
/// @param {Color} $row-even-background [null] - The background color of even rows.
18+
/// @param {Color} $row-odd-text-color [null] - The text color of odd rows.
19+
/// @param {Color} $row-even-text-color [null] - The text color of even rows.
1620
/// @param {Color} $row-selected-background [null] - The selected row background color.
1721
/// @param {Color} $row-selected-text-color [null] - The selected row text color.
1822
/// @param {Color} $row-hover-background [null] - The hover row background color.
23+
/// @param {Color} $row-hover-text-color [null] - The hover row text color.
1924
/// @param {Color} $row-border-color [null] - The row bottom border color.
2025
/// @param {Color} $pinned-border-width [null] - The border width of the pinned border.
2126
/// @param {Color} $pinned-border-style [null] - The CSS border style of the pinned border.
@@ -61,9 +66,14 @@
6166
$ghost-header-icon-color: null,
6267
$ghost-header-background: null,
6368
69+
$row-odd-background: null,
70+
$row-even-background: null,
71+
$row-odd-text-color: null,
72+
$row-even-text-color: null,
6473
$row-selected-background: null,
6574
$row-selected-text-color: null,
6675
$row-hover-background: null,
76+
$row-hover-text-color: null,
6777
$row-border-color: null,
6878
6979
$pinned-border-width: null,
@@ -109,9 +119,14 @@
109119
ghost-header-icon-color: igx-color($palette, 'grays'),
110120
ghost-header-background: #fff,
111121

122+
row-odd-background: #fff,
123+
row-even-background: #fff,
124+
row-odd-text-color: inherit,
125+
row-even-text-color: inherit,
112126
row-selected-background: hexrgba(igx-color($palette, 'grays', 800)),
113127
row-selected-text-color: igx-contrast-color($palette, 'grays', 900),
114-
row-hover-background: darken(hexrgba(igx-color($palette, 'grays', 100)), 10%),
128+
row-hover-background: hexrgba(igx-color($palette, 'grays', 200)),
129+
row-hover-text-color: igx-color($palette, 'grays', 800),
115130
row-border-color: igx-color($palette, 'grays', 300),
116131

117132
pinned-border-width: 2px,
@@ -163,6 +178,26 @@
163178
$content-text-color: text-contrast($content-background);
164179
}
165180

181+
@if not($row-odd-background) and $content-background {
182+
$row-odd-background: $content-background;
183+
}
184+
185+
@if not($row-even-background) and $content-background {
186+
$row-even-background: $content-background;
187+
}
188+
189+
@if not($row-odd-text-color) and $row-odd-background {
190+
$row-odd-text-color: text-contrast($row-odd-background);
191+
}
192+
193+
@if not($row-even-text-color) and $row-even-background {
194+
$row-even-text-color: text-contrast($row-even-background);
195+
}
196+
197+
@if not($row-hover-text-color) and $row-hover-background {
198+
$row-hover-text-color: text-contrast($row-hover-background);
199+
}
200+
166201
@if not($cell-selected-text-color) and $cell-selected-background {
167202
$cell-selected-text-color: text-contrast($cell-selected-background);
168203
}
@@ -220,9 +255,14 @@
220255
content-background: $content-background,
221256
content-text-color: $content-text-color,
222257

258+
row-odd-background: $row-odd-background,
259+
row-even-background: $row-even-background,
260+
row-odd-text-color: $row-odd-text-color,
261+
row-even-text-color: $row-even-text-color,
223262
row-selected-background: $row-selected-background,
224263
row-selected-text-color: $row-selected-text-color,
225264
row-hover-background: $row-hover-background,
265+
row-hover-text-color: $row-hover-text-color,
226266
row-border-color: $row-border-color,
227267

228268
pinned-border-width: $pinned-border-width,
@@ -371,9 +411,11 @@
371411

372412
%grid-row {
373413
background: inherit;
414+
color: inherit;
374415

375416
&:hover {
376417
background: inherit;
418+
color: inherit;
377419
}
378420
}
379421
}
@@ -483,15 +525,27 @@
483525

484526
&:hover {
485527
background-color: --var($theme, 'row-hover-background');
528+
color: --var($theme, 'row-hover-text-color');
486529
}
487530
}
488531

532+
%grid-row--odd {
533+
background: --var($theme, 'row-odd-background');
534+
color: --var($theme, 'row-odd-text-color');
535+
}
536+
537+
%grid-row--even {
538+
background: --var($theme, 'row-even-background');
539+
color: --var($theme, 'row-even-text-color');
540+
}
541+
489542
%grid-row--selected {
490543
color: --var($theme, 'row-selected-text-color');
491544
background-color: --var($theme, 'row-selected-background');
492545

493546
&:hover {
494547
background-color: --var($theme, 'row-selected-background');
548+
color: --var($theme, 'row-selected-text-color');
495549
}
496550
}
497551

@@ -510,9 +564,10 @@
510564
line-height: $grid-cell-lh;
511565
color: inherit;
512566
text-align: left;
513-
overflow: hidden;
514-
white-space: nowrap;
515-
text-overflow: ellipsis;
567+
}
568+
569+
%grid-cell-text {
570+
@include ellipsis();
516571
}
517572

518573
%grid-cell-display--cosy {
@@ -535,8 +590,7 @@
535590

536591
%grid-cell--editing {
537592
background-color: --var($theme, 'cell-editing-background') !important;
538-
border: 1px solid --var($theme, 'cell-selected-background');
539-
box-shadow: igx-elevation($elevations, 2);
593+
border: 2px solid --var($theme, 'cell-selected-background');
540594

541595
igx-input-group {
542596
width: 100%;
@@ -552,6 +606,10 @@
552606

553607
%grid-cell--pinned-last {
554608
border-right: map-get($cell-pin, 'style') map-get($cell-pin, 'color') !important;
609+
610+
&%grid-cell--editing {
611+
border-right: map-get($cell-pin, 'style') --var($theme, 'cell-selected-background') !important;
612+
}
555613
}
556614

557615
%grid-cell-header {
@@ -565,10 +623,6 @@
565623
padding: map-get($grid-header-padding, 'comfortable');
566624
border-right: 1px dotted igx-color($palette, 'grays', 400);
567625
overflow: visible;
568-
569-
&:last-of-type {
570-
border-right: transparent;
571-
}
572626
}
573627

574628
%grid-cell-header--cosy {
@@ -642,9 +696,8 @@
642696
display: flex;
643697
justify-content: center;
644698
align-items: center;
645-
z-index: 1;
646-
position: relative;
647699
background: inherit;
700+
z-index: 1;
648701
}
649702

650703
%grid__cbx-selection--cosy {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
$default-theme: (
3333
name: 'igx-list',
3434
background: #fff,
35+
header-background: #fff,
3536
header-text-color: igx-color($palette, 'secondary'),
37+
item-background: #fff,
3638
item-text-color: igx-color($palette, 'grays', 800),
3739
item-background-active: igx-color($palette, 'grays', 100),
3840
item-text-color-active: igx-color($palette, 'grays', 800)

projects/igniteui-angular/src/lib/grid/api.service.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,37 +140,43 @@ export class IgxGridAPIService {
140140
if (editableCell) {
141141
if (!editableCell.cell.column.inlineEditorTemplate && editableCell.cell.column.dataType === 'number') {
142142
if (!this.get_cell_inEditMode(gridId).cell.editValue) {
143-
this.update_cell(gridId, editableCell.cellID.rowIndex, editableCell.cellID.columnID, 0);
143+
this.update_cell(gridId, editableCell.cellID.rowID, editableCell.cellID.columnID, 0);
144144
} else {
145145
const val = parseFloat(this.get_cell_inEditMode(gridId).cell.editValue);
146146
if (!isNaN(val) || isFinite(val)) {
147-
this.update_cell(gridId, editableCell.cellID.rowIndex, editableCell.cellID.columnID, val);
147+
this.update_cell(gridId, editableCell.cellID.rowID, editableCell.cellID.columnID, val);
148148
}
149149
}
150150
} else {
151-
this.update_cell(gridId, editableCell.cellID.rowIndex, editableCell.cellID.columnID, editableCell.cell.editValue);
151+
this.update_cell(gridId, editableCell.cellID.rowID, editableCell.cellID.columnID, editableCell.cell.editValue);
152152
}
153153
}
154154
}
155155

156156
public update_cell(id: string, rowSelector, columnID, editValue) {
157157
let cellObj;
158-
let rowIndex;
158+
let rowID;
159159
const row = this.get_row_by_key(id, rowSelector);
160160
const editableCell = this.get_cell_inEditMode(id);
161161
if (editableCell) {
162162
cellObj = editableCell.cell;
163-
rowIndex = rowSelector;
163+
rowID = editableCell.cellID.rowID;
164164
} else if (row) {
165-
rowIndex = row.index;
166-
cellObj = this.get(id).columnList.toArray()[columnID].cells[rowIndex];
165+
rowID = row.rowID;
166+
cellObj = this.get(id).columnList.toArray()[columnID].cells[row.index];
167167
}
168168
if (cellObj) {
169169
const args: IGridEditEventArgs = { row: cellObj.row, cell: cellObj,
170170
currentValue: cellObj.value, newValue: editValue };
171171
this.get(id).onEditDone.emit(args);
172172
const column = this.get(id).columnList.toArray()[columnID];
173-
this.get(id).data[rowIndex][column.field] = args.newValue;
173+
if (this.get(id).primaryKey) {
174+
const index = this.get(id).data.map((record) => record[this.get(id).primaryKey]).indexOf(rowSelector);
175+
this.get(id).data[index][column.field] = args.newValue;
176+
} else {
177+
this.get(id).data[this.get(id).data.indexOf(rowID)][column.field] = args.newValue;
178+
}
179+
(this.get(id) as any)._pipeTrigger++;
174180
this.get(id).refreshSearch();
175181
}
176182
}
@@ -180,6 +186,7 @@ export class IgxGridAPIService {
180186
const args: IGridEditEventArgs = { row, cell: null, currentValue: this.get(id).data[index], newValue: value };
181187
this.get(id).onEditDone.emit(args);
182188
this.get(id).data[index] = args.newValue;
189+
(this.get(id) as any)._pipeTrigger++;
183190
}
184191

185192
public sort(id: string, fieldName: string, dir: SortingDirection, ignoreCase: boolean): void {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ng-template #defaultCell igxTextHighlight [cssClass]="highlightClass" [activeCssClass]="activeHighlightClass" [groupName]="gridID"
22
[value]="formatter ? formatter(value) : value" [row]="rowIndex" [column]="this.column.visibleIndex" [page]="this.grid.page">
3-
<div>{{ formatter ? formatter(value) : value }}</div>
3+
<div class="igx-grid__td-text">{{ formatter ? formatter(value) : value }}</div>
44
</ng-template>
55
<ng-template #inlineEditor let-cell="cell">
66
<ng-container *ngIf="column.dataType === 'string'">

0 commit comments

Comments
 (0)