Skip to content

Commit 4e5a44b

Browse files
authored
Merge branch '8.1.x' into tzhelev/fix-5238-8.1.x
2 parents a89255d + 64c6bde commit 4e5a44b

File tree

9 files changed

+94
-65
lines changed

9 files changed

+94
-65
lines changed

projects/igniteui-angular/src/lib/core/grid-selection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ export class IgxGridCRUDService {
105105
return new IgxRow(cell.id.rowID, cell.rowIndex, cell.rowData);
106106
}
107107

108-
sameRow(rowIndex): boolean {
109-
return this.row && this.row.index === rowIndex;
108+
sameRow(rowID): boolean {
109+
return this.row && this.row.id === rowID;
110110
}
111111

112112
sameCell(cell: IgxCell): boolean {
@@ -175,7 +175,7 @@ export class IgxGridCRUDService {
175175
return;
176176
}
177177

178-
if (this.row && !this.sameRow(this.cell.rowIndex)) {
178+
if (this.row && !this.sameRow(this.cell.id.rowID)) {
179179
this.grid.endEdit(true);
180180
this.cell = this.createCell(cell);
181181
this.beginRowEdit();

projects/igniteui-angular/src/lib/core/styles/components/icon/_icon-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
width: inherit;
6262
height: inherit;
6363
fill: currentColor;
64+
65+
use {
66+
pointer-events: none;
67+
}
6468
}
6569
}
6670

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

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,41 @@
328328
flex-flow: column wrap;
329329
justify-content: center;
330330
border-radius: --var($theme, 'item-border-radius');
331+
color: --var($theme, 'item-text-color');
332+
background: --var($theme, 'item-background');
333+
334+
&:hover {
335+
color: --var($theme, 'item-text-color-hover');
336+
background: --var($theme, 'item-background-hover');
337+
338+
%igx-list__item-lines {
339+
color: currentColor;
340+
}
341+
342+
%igx-list__item-line-title {
343+
color: --var($theme, 'item-title-color-hover');
344+
}
345+
346+
%igx-list__item-line-subtitle {
347+
color: --var($theme, 'item-subtitle-color-hover');
348+
}
349+
350+
%igx-list__item-actions {
351+
color: --var($theme, 'item-action-color-hover');
352+
353+
%igx-icon-display {
354+
color: --var($theme, 'item-action-color-hover')
355+
}
356+
}
357+
358+
%igx-list__item-thumbnail {
359+
color: --var($theme, 'item-thumbnail-color-hover');
360+
361+
%igx-icon-display {
362+
color: --var($theme, 'item-thumbnail-color-hover')
363+
}
364+
}
365+
}
331366
}
332367

333368
%igx-list-item-pan {
@@ -381,43 +416,9 @@
381416
align-items: center;
382417
position: relative;
383418
padding: map-get($list-item-padding, 'comfortable');
384-
color: --var($theme, 'item-text-color');
385-
background: --var($theme, 'item-background');
386419
border-radius: --var($theme, 'item-border-radius');
420+
background: inherit;
387421
z-index: 2;
388-
389-
&:hover {
390-
color: --var($theme, 'item-text-color-hover');
391-
background: --var($theme, 'item-background-hover');
392-
393-
%igx-list__item-lines {
394-
color: currentColor;
395-
}
396-
397-
%igx-list__item-line-title {
398-
color: --var($theme, 'item-title-color-hover');
399-
}
400-
401-
%igx-list__item-line-subtitle {
402-
color: --var($theme, 'item-subtitle-color-hover');
403-
}
404-
405-
%igx-list__item-actions {
406-
color: --var($theme, 'item-action-color-hover');
407-
408-
%igx-icon-display {
409-
color: --var($theme, 'item-action-color-hover')
410-
}
411-
}
412-
413-
%igx-list__item-thumbnail {
414-
color: --var($theme, 'item-thumbnail-color-hover');
415-
416-
%igx-icon-display {
417-
color: --var($theme, 'item-thumbnail-color-hover')
418-
}
419-
}
420-
}
421422
}
422423

423424
%igx-list-item-content--compact {

projects/igniteui-angular/src/lib/core/styles/themes/_index.scss

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,22 @@
274274
$exclude: (),
275275
$legacy-support: true
276276
) {
277-
$primary: igx-color($palette, 'primary');
278-
$secondary: igx-color($palette, 'secondary');
277+
$grays: igx-color($palette, 'grays');
279278
$surface: igx-color($palette, 'surface');
280279

280+
$light-palette: igx-palette(
281+
$primary: igx-color($palette, 'primary'),
282+
$secondary: igx-color($palette, 'secondary'),
283+
$info: igx-color($palette, 'info'),
284+
$success: igx-color($palette, 'success'),
285+
$warn: igx-color($palette, 'warn'),
286+
$error: igx-color($palette, 'error'),
287+
$surface: if($surface != #fff, $surface, #fff),
288+
$grays: if($grays != rgba(0, 0, 0, .38), $grays, #000),
289+
);
290+
281291
@include igx-theme(
282-
$palette: igx-palette(
283-
$primary,
284-
$secondary,
285-
$surface: if($surface != #fff, $surface, #fff),
286-
$grays: #000
287-
),
292+
$palette: $light-palette,
288293
$schema: $light-schema,
289294
$legacy-support: $legacy-support,
290295
$exclude: $exclude
@@ -300,17 +305,22 @@
300305
$exclude: (),
301306
$legacy-support: true
302307
) {
303-
$primary: igx-color($palette, 'primary');
304-
$secondary: igx-color($palette, 'secondary');
308+
$grays: igx-color($palette, 'grays');
305309
$surface: igx-color($palette, 'surface');
306310

311+
$dark-palette: igx-palette(
312+
$primary: igx-color($palette, 'primary'),
313+
$secondary: igx-color($palette, 'secondary'),
314+
$info: igx-color($palette, 'info'),
315+
$success: igx-color($palette, 'success'),
316+
$warn: igx-color($palette, 'warn'),
317+
$error: igx-color($palette, 'error'),
318+
$surface: if($surface != #fff, $surface, #222),
319+
$grays: if($grays != rgba(0, 0, 0, .38), $grays, #fff),
320+
);
321+
307322
@include igx-theme(
308-
$palette: igx-palette(
309-
$primary,
310-
$secondary,
311-
$surface: if($surface != #fff, $surface, #222),
312-
$grays: #fff
313-
),
323+
$palette: $dark-palette,
314324
$schema: $dark-schema,
315325
$legacy-support: $legacy-support,
316326
$exclude: $exclude

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,9 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
594594
return;
595595
}
596596

597-
if (editableCell && crud.sameRow(this.rowIndex)) {
597+
if (editableCell && crud.sameRow(this.cellID.rowID)) {
598598
this.gridAPI.submit_value();
599-
} else if (editMode && !crud.sameRow(this.rowIndex)) {
599+
} else if (editMode && !crud.sameRow(this.cellID.rowID)) {
600600
this.grid.endEdit(true);
601601
}
602602
}

projects/igniteui-angular/src/lib/grids/grid-base.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3321,6 +3321,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
33213321
return this.rowSelectable && this.hasVisibleColumns;
33223322
}
33233323

3324+
get showDragIcons(): boolean {
3325+
return this.rowDraggable && this.columns.length > this.hiddenColumnsCount;
3326+
}
3327+
33243328
/**
33253329
* @hidden
33263330
*/
@@ -4198,6 +4202,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
41984202
computedWidth -= this.headerCheckboxContainer ? this.headerCheckboxContainer.nativeElement.offsetWidth : 0;
41994203
}
42004204

4205+
if (this.showDragIcons) {
4206+
computedWidth -= this.headerDragContainer ? this.headerDragContainer.nativeElement.offsetWidth : 0;
4207+
}
4208+
42014209
const visibleChildColumns = this.visibleColumns.filter(c => !c.columnGroup);
42024210

42034211

projects/igniteui-angular/src/lib/grids/grid/row-drag.directive.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,11 @@ describe('IgxGrid - Row Drag Tests', () => {
240240
grid.rowSelectable = true;
241241
grid.rowDraggable = true;
242242
fixture.detectChanges();
243-
rowSelectElement = fixture.debugElement.query(By.css(CSS_CLASS_SELECTION_CHECKBOX));
244-
dragIndicatorElement = fixture.debugElement.query(By.css('.' + CSS_CLASS_DRAG_INDICATOR));
245243
horizontalScrollbarElement = fixture.debugElement.query(By.css(CSS_CLASS_VIRTUAL_HSCROLLBAR));
246-
const rowSelectRect = rowSelectElement.nativeElement.getBoundingClientRect();
247244
horizontalScrollbarRect = horizontalScrollbarElement.nativeElement.getBoundingClientRect();
248-
expect(rowSelectRect.right).toBe(horizontalScrollbarRect.left);
245+
246+
// The horizontal scrollbar should not be visible
247+
expect(horizontalScrollbarRect.left).toBe(0);
249248
}));
250249
it('should align horizontal scrollbar with first non-pinned column when column pinning is enabled', fakeAsync(() => {
251250
grid.pinColumn('ProductName');
@@ -257,7 +256,9 @@ describe('IgxGrid - Row Drag Tests', () => {
257256
let horizontalScrollbarRect = horizontalScrollbarElement.nativeElement.getBoundingClientRect();
258257
let pinnedColumnHeaderElement: DebugElement = fixture.debugElement.query(By.css('.' + CSS_CLASS_LAST_PINNED_HEADER));
259258
let pinnedColumnHeaderRect = pinnedColumnHeaderElement.nativeElement.getBoundingClientRect();
260-
expect(pinnedColumnHeaderRect.right).toBe(horizontalScrollbarRect.left);
259+
260+
// The horizontal scrollbar should not be visible
261+
expect(horizontalScrollbarRect.left).toBe(0);
261262

262263
// selectable rows enabled
263264
grid.rowSelectable = true;

projects/igniteui-angular/src/lib/services/overlay/overlay.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,14 @@ export class IgxOverlayService implements OnDestroy {
620620
return;
621621
}
622622
if (info.settings.closeOnOutsideClick) {
623+
const target = ev.target as any;
623624
// if the click is on the element do not close this overlay
624-
if (!info.elementRef.nativeElement.contains(ev.target)) {
625+
if (!info.elementRef.nativeElement.contains(target)) {
625626
// if we should exclude position target check if the click is over it. If so do not close overlay
626627
const positionTarget = info.settings.positionStrategy.settings.target as HTMLElement;
627628
let clickOnPositionTarget = false;
628629
if (positionTarget) {
629-
const positionTargetRect = positionTarget.getBoundingClientRect();
630-
clickOnPositionTarget = ev.clientX >= positionTargetRect.left && ev.clientX <= positionTargetRect.right &&
631-
ev.clientY >= positionTargetRect.top && ev.clientY <= positionTargetRect.bottom;
630+
clickOnPositionTarget = positionTarget.contains(target);
632631
}
633632

634633
if (!(info.settings.excludePositionTarget && clickOnPositionTarget)) {

src/app/tree-grid-load-on-demand/tree-grid-load-on-demand.sample.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export class TreeGridLoadOnDemandSampleComponent implements OnInit {
8585

8686
public addChildRow() {
8787
const selectedRowId = this.grid1.selectedRows()[0];
88+
const parent = this.grid1.records.get(selectedRowId).data;
89+
90+
if (!parent[this.grid1.hasChildrenKey]) {
91+
parent[this.grid1.hasChildrenKey] = true;
92+
}
93+
8894
this.grid1.addRow(
8995
{
9096
'employeeID': this.data1.length + this.nextRow++,

0 commit comments

Comments
 (0)