Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(themes): pinned and selected cells would show content under #3196

Merged
merged 6 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@
@extend %grid-cell--fixed-width !optional;
}

@include e(td, $mods: (pinned, selected)) {
@extend %grid-cell--pinned-selected !optional;
}

@include e(td-text) {
@extend %grid-cell-text !optional;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@

$tree-selected-filtered-row-text-color: rgba(text-contrast(map-get($theme, 'row-selected-background')), .5);
$tree-selected-filtered-cell-text-color: rgba(text-contrast(map-get($theme, 'cell-selected-background')), .5);
$row-selected-cell-background: darken(map-get($theme, 'row-selected-background'), 8%);

@if not($ghost-header-icon-color) and $ghost-header-background {
$ghost-header-icon-color: rgba(text-contrast($ghost-header-background), .07);
Expand Down Expand Up @@ -358,7 +359,8 @@

tree-filtered-text-color: $tree-filtered-text-color,
tree-selected-filtered-row-text-color: $tree-selected-filtered-row-text-color,
tree-selected-filtered-cell-text-color: $tree-selected-filtered-cell-text-color
tree-selected-filtered-cell-text-color: $tree-selected-filtered-cell-text-color,
row-selected-cell-background: $row-selected-cell-background
));
}

Expand Down Expand Up @@ -654,6 +656,11 @@
color: --var($theme, 'row-selected-text-color');
background-color: --var($theme, 'row-selected-background');

%grid-cell--selected,
%grid-cell--pinned-selected {
background-color: --var($theme, 'row-selected-cell-background');
}

&:hover {
background-color: --var($theme, 'row-selected-background');
color: --var($theme, 'row-selected-text-color');
Expand Down Expand Up @@ -820,7 +827,7 @@

%grid-cell--selected {
color: --var($theme, 'cell-selected-text-color');
background-color: --var($theme, 'cell-selected-background') !important;
background-color: --var($theme, 'cell-selected-background');
border-bottom: 0;

%igx-grid__tree-grouping-indicator {
Expand Down Expand Up @@ -869,6 +876,12 @@
z-index: 9999;
}

%grid-cell--pinned-selected {
color: --var($theme, 'cell-selected-text-color');
background-color: --var($theme, 'cell-selected-background');
border-bottom: 0;
}

%grid-cell--pinned-last {
border-right: map-get($cell-pin, 'style') map-get($cell-pin, 'color') !important;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
/// @prop {Color} content-background [#222] - The table body background color.
/// @prop {Color} row-odd-background [#222] - The background color of odd rows.
/// @prop {Color} row-even-background [#222] - The background color of even rows.
/// @prop {Map} row-hover-background [igx-color: ('grays', 200), hexrgba: #222] - The hover row background color.
/// @prop {Map} row-hover-background [igx-color: ('grays', 100), hexrgba: #222] - The hover row background color.
/// @prop {Map} row-selected-background [igx-color: ('secondary', 500), rgba: .24, hexrgba: #222] - The selected row background color.
/// @prop {Color} row-selected-text-color [#fff] - The selected row text color.
/// @prop {Color} ghost-header-background [#222] - The dragged header background color.
/// @prop {Color} cell-editing-background [#222] - The background for the cell in editing mode.
/// @prop {Map} cell-selected-background [igx-color: ('grays', 200), hexrgba: #222] - The selected cell background color.
/// @prop {Map} cell-selected-text-color [#fff] - The selected cell text color.
/// @prop {Map} grouparea-background [igx-color: ('grays', 100), hexrgba: #222] - The grid group area background color.
/// @prop {Map} group-row-background [igx-color: ('grays', 100), hexrgba: #222] - The grid group row background color.
Expand All @@ -38,7 +39,7 @@ $_dark-grid: extend($_light-grid, (
row-even-background: #222,

row-hover-background: (
igx-color: ('grays', 200),
igx-color: ('grays', 100),
hexrgba: #222
),

Expand All @@ -56,6 +57,11 @@ $_dark-grid: extend($_light-grid, (

cell-editing-background: #222,

cell-selected-background: (
igx-color: ('grays', 200),
hexrgba: #222
),

grouparea-background: (
igx-color: ('grays', 100),
hexrgba: #222
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
/// @prop {Color} row-even-text-color [inherit] - The text color of even rows.
/// @prop {Map} row-selected-background [igx-color: ('secondary', 50), hexrgba: #fff] - The selected row background color.
/// @prop {Map} row-selected-text-color [igx-contrast-color: ('secondary', 50)] - The selected row text color.
/// @prop {Map} row-hover-background [igx-color: ('grays', 200), hexrgba: #fff] - The hover row background color.
/// @prop {Map} row-hover-background [igx-color: ('grays', 100), hexrgba: #fff] - The hover row background color.
/// @prop {Map} row-hover-text-color [igx-contrast-color: ('grays', 200)] - The hover row text color.
/// @prop {Map} row-border-color [igx-color: ('grays', 300)] - The row bottom border color.
/// @prop {Number} pinned-border-width [2px] - The border width of the pinned border.
/// @prop {String} pinned-border-style [solid] - The CSS border style of the pinned border.
/// @prop {Map} pinned-border-color [igx-color: ('grays', 400)] - The color of the pinned border.
/// @prop {Map} cell-selected-background [igx-color: ('grays', 200)] - The selected cell background color.
/// @prop {Map} cell-selected-background [igx-color: ('grays', 200), hexrgba: #fff] - The selected cell background color.
/// @prop {Map} cell-selected-text-color [igx-contrast-color: ('grays', 200)] - The selected cell text color.
/// @prop {Map} resize-line-color [igx-color: ('secondary', 500)] - The table header resize line color.
/// @prop {Map} grouparea-background [igx-color: ('grays', 100), hexrgba: #fff] - The grid group area background color.
Expand Down Expand Up @@ -102,7 +102,7 @@ $_light-grid: (
),

row-hover-background: (
igx-color: ('grays', 200),
igx-color: ('grays', 100),
hexrgba: #fff
),

Expand All @@ -122,6 +122,7 @@ $_light-grid: (

cell-selected-background: (
igx-color: ('grays', 200),
hexrgba: #fff
),

cell-selected-text-color: (
Expand Down
12 changes: 6 additions & 6 deletions projects/igniteui-angular/src/lib/grids/cell.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
const column = this.gridAPI.get(this.gridID).columns[editCell.cellID.columnID];

if (column.inlineEditorTemplate === undefined && (
(column.dataType === DataType.Boolean && (key !== KEYS.SPACE && key !== KEYS.SPACE_IE))
(column.dataType === DataType.Boolean && (key !== KEYS.SPACE && key !== KEYS.SPACE_IE))
|| column.dataType === DataType.Date)) {
event.preventDefault();
}
Expand All @@ -727,11 +727,11 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
(this.gridAPI as any).trigger_row_expansion_toggle(
this.gridID, this.row.treeRow, !this.row.expanded, event, this.visibleColumnIndex);
}
return;
return;
}
}

const args = {cell: this, groupRow: null, event: event, cancel: false };
const args = { cell: this, groupRow: null, event: event, cancel: false };
this.grid.onFocusChange.emit(args);
if (args.cancel) {
return;
Expand Down Expand Up @@ -885,8 +885,8 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
'igx_grid__cell--edit': this.inEditMode,
'igx-grid__td--number': this.gridAPI.should_apply_number_style(this.column),
'igx-grid__td--editing': this.inEditMode,
'igx-grid__th--pinned': this.column.pinned,
'igx-grid__th--pinned-last': this.isLastPinned,
'igx-grid__td--pinned': this.column.pinned,
'igx-grid__td--pinned-last': this.isLastPinned,
'igx-grid__td--selected': this.selected,
'igx-grid__td--edited': this.dirty
};
Expand All @@ -904,7 +904,7 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
*/
public calculateSizeToFit(range: any): number {
return Math.max(...Array.from(this.nativeElement.children)
.map((child) => getNodeSizeViaRange(range, child)));
.map((child) => getNodeSizeViaRange(range, child)));
}

private isToggleKey(key) {
Expand Down
Loading