Skip to content

Commit 6e0ed9a

Browse files
committed
Merge branch 'mvenkov/drop-down-flicker-fix' of https://github.com/IgniteUI/igniteui-angular into mvenkov/drop-down-flicker-fix
2 parents 279eb3d + 665209d commit 6e0ed9a

21 files changed

+383
-96
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
@@ -64,6 +64,14 @@
6464
}
6565
}
6666

67+
@include e(tr, $m: odd) {
68+
@extend %grid-row--odd !optional;
69+
}
70+
71+
@include e(tr, $m: even) {
72+
@extend %grid-row--even !optional;
73+
}
74+
6775
@include e(tr, $m: selected) {
6876
@extend %grid-row--selected !optional;
6977
}
@@ -142,6 +150,10 @@
142150
@extend %grid-cell--fixed-width !optional;
143151
}
144152

153+
@include e(td-text) {
154+
@extend %grid-cell-text !optional;
155+
}
156+
145157
@include e(cbx-selection) {
146158
@extend %grid__cbx-selection !optional;
147159
}

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
}
@@ -457,15 +499,27 @@
457499

458500
&:hover {
459501
background-color: --var($theme, 'row-hover-background');
502+
color: --var($theme, 'row-hover-text-color');
460503
}
461504
}
462505

506+
%grid-row--odd {
507+
background: --var($theme, 'row-odd-background');
508+
color: --var($theme, 'row-odd-text-color');
509+
}
510+
511+
%grid-row--even {
512+
background: --var($theme, 'row-even-background');
513+
color: --var($theme, 'row-even-text-color');
514+
}
515+
463516
%grid-row--selected {
464517
color: --var($theme, 'row-selected-text-color');
465518
background-color: --var($theme, 'row-selected-background');
466519

467520
&:hover {
468521
background-color: --var($theme, 'row-selected-background');
522+
color: --var($theme, 'row-selected-text-color');
469523
}
470524
}
471525

@@ -484,9 +538,10 @@
484538
line-height: $grid-cell-lh;
485539
color: inherit;
486540
text-align: left;
487-
overflow: hidden;
488-
white-space: nowrap;
489-
text-overflow: ellipsis;
541+
}
542+
543+
%grid-cell-text {
544+
@include ellipsis();
490545
}
491546

492547
%grid-cell-display--cosy {
@@ -509,8 +564,7 @@
509564

510565
%grid-cell--editing {
511566
background-color: --var($theme, 'cell-editing-background') !important;
512-
border: 1px solid --var($theme, 'cell-selected-background');
513-
box-shadow: igx-elevation($elevations, 2);
567+
border: 2px solid --var($theme, 'cell-selected-background');
514568

515569
igx-input-group {
516570
width: 100%;
@@ -526,6 +580,10 @@
526580

527581
%grid-cell--pinned-last {
528582
border-right: map-get($cell-pin, 'style') map-get($cell-pin, 'color') !important;
583+
584+
&%grid-cell--editing {
585+
border-right: map-get($cell-pin, 'style') --var($theme, 'cell-selected-background') !important;
586+
}
529587
}
530588

531589
%grid-cell-header {
@@ -539,10 +597,6 @@
539597
padding: map-get($grid-header-padding, 'comfortable');
540598
border-right: 1px dotted igx-color($palette, 'grays', 400);
541599
overflow: visible;
542-
543-
&:last-of-type {
544-
border-right: transparent;
545-
}
546600
}
547601

548602
%grid-cell-header--cosy {
@@ -601,9 +655,8 @@
601655
display: flex;
602656
justify-content: center;
603657
align-items: center;
604-
z-index: 1;
605-
position: relative;
606658
background: inherit;
659+
z-index: 1;
607660
}
608661

609662
%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
@@ -136,37 +136,43 @@ export class IgxGridAPIService {
136136
if (editableCell) {
137137
if (!editableCell.cell.column.inlineEditorTemplate && editableCell.cell.column.dataType === 'number') {
138138
if (!this.get_cell_inEditMode(gridId).cell.editValue) {
139-
this.update_cell(gridId, editableCell.cellID.rowIndex, editableCell.cellID.columnID, 0);
139+
this.update_cell(gridId, editableCell.cellID.rowID, editableCell.cellID.columnID, 0);
140140
} else {
141141
const val = parseFloat(this.get_cell_inEditMode(gridId).cell.editValue);
142142
if (!isNaN(val) || isFinite(val)) {
143-
this.update_cell(gridId, editableCell.cellID.rowIndex, editableCell.cellID.columnID, val);
143+
this.update_cell(gridId, editableCell.cellID.rowID, editableCell.cellID.columnID, val);
144144
}
145145
}
146146
} else {
147-
this.update_cell(gridId, editableCell.cellID.rowIndex, editableCell.cellID.columnID, editableCell.cell.editValue);
147+
this.update_cell(gridId, editableCell.cellID.rowID, editableCell.cellID.columnID, editableCell.cell.editValue);
148148
}
149149
}
150150
}
151151

152152
public update_cell(id: string, rowSelector, columnID, editValue) {
153153
let cellObj;
154-
let rowIndex;
154+
let rowID;
155155
const row = this.get_row_by_key(id, rowSelector);
156156
const editableCell = this.get_cell_inEditMode(id);
157157
if (editableCell) {
158158
cellObj = editableCell.cell;
159-
rowIndex = rowSelector;
159+
rowID = editableCell.cellID.rowID;
160160
} else if (row) {
161-
rowIndex = row.index;
162-
cellObj = this.get(id).columnList.toArray()[columnID].cells[rowIndex];
161+
rowID = row.rowID;
162+
cellObj = this.get(id).columnList.toArray()[columnID].cells[row.index];
163163
}
164164
if (cellObj) {
165165
const args: IGridEditEventArgs = { row: cellObj.row, cell: cellObj,
166166
currentValue: cellObj.value, newValue: editValue };
167167
this.get(id).onEditDone.emit(args);
168168
const column = this.get(id).columnList.toArray()[columnID];
169-
this.get(id).data[rowIndex][column.field] = args.newValue;
169+
if (this.get(id).primaryKey) {
170+
const index = this.get(id).data.map((record) => record[this.get(id).primaryKey]).indexOf(rowSelector);
171+
this.get(id).data[index][column.field] = args.newValue;
172+
} else {
173+
this.get(id).data[this.get(id).data.indexOf(rowID)][column.field] = args.newValue;
174+
}
175+
(this.get(id) as any)._pipeTrigger++;
170176
this.get(id).refreshSearch();
171177
}
172178
}
@@ -176,6 +182,7 @@ export class IgxGridAPIService {
176182
const args: IGridEditEventArgs = { row, cell: null, currentValue: this.get(id).data[index], newValue: value };
177183
this.get(id).onEditDone.emit(args);
178184
this.get(id).data[index] = args.newValue;
185+
(this.get(id) as any)._pipeTrigger++;
179186
}
180187

181188
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)