Skip to content

Commit a2e37ca

Browse files
authored
Merge branch 'master' into iganchev/select-implement-hint
2 parents abd3631 + 65f3c9d commit a2e37ca

25 files changed

+204
-48
lines changed

.github/workflows/nodejs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ master, 9.1.x ]
9+
pull_request:
10+
branches: [ master, 9.1.x ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [10.x, 12.x, 14.x]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- run: npm ci
28+
- run: npm run lint:lib
29+
- run: npm run build:lib
30+
- run: npm run test:lib:others
31+
env:
32+
NODE_OPTIONS: --max_old_space_size=4096
33+
- run: npm run test:lib:grid
34+
env:
35+
NODE_OPTIONS: --max_old_space_size=4096
36+
- run: npm run test:lib:tgrid
37+
env:
38+
NODE_OPTIONS: --max_old_space_size=4096
39+
- run: npm run test:lib:hgrid
40+
env:
41+
NODE_OPTIONS: --max_old_space_size=4096
42+
- run: npm run test:schematics

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Ignite UI for Angular - from Infragistics
22

3+
![Node.js CI](https://github.com/IgniteUI/igniteui-angular/workflows/Node.js%20CI/badge.svg)
34
[![Build Status](https://dev.azure.com/IgniteUI/igniteui-angular/_apis/build/status/IgniteUI.igniteui-angular)](https://dev.azure.com/IgniteUI/igniteui-angular/_build/latest?definitionId=3)
45
[![Build Status](https://travis-ci.org/IgniteUI/igniteui-angular.svg?branch=master)](https://travis-ci.org/IgniteUI/igniteui-angular)
56
[![Coverage Status](https://coveralls.io/repos/github/IgniteUI/igniteui-angular/badge.svg?branch=master)](https://coveralls.io/github/IgniteUI/igniteui-angular?branch=master)

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, HostBinding } from '@angular/core';
22
import { IgxGridActionsBaseDirective } from './grid-actions-base.directive';
3+
import { showMessage } from '../../core/deprecateDecorators';
34

45
@Component({
56
selector: 'igx-grid-editing-actions',
@@ -16,6 +17,8 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
1617
@HostBinding('class.igx-action-strip__editing-actions')
1718
public cssClass = 'igx-action-strip__editing-actions';
1819

20+
private isMessageShown = false;
21+
1922
/**
2023
* Enter row or cell edit mode depending the grid rowEditable option
2124
* @example
@@ -33,6 +36,12 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
3336
const row = this.strip.context;
3437
const firstEditable = row.cells.filter(cell => cell.editable)[0];
3538
const grid = row.grid;
39+
if (!grid.hasEditableColumns) {
40+
this.isMessageShown = showMessage(
41+
'The grid should be editable in order to use IgxGridEditingActionsComponent',
42+
this.isMessageShown);
43+
return;
44+
}
3645
// be sure row is in view
3746
if (grid.rowList.filter(r => r === row).length !== 0) {
3847
grid.crudService.begin(firstEditable);

projects/igniteui-angular/src/lib/core/styles/base/utilities/_functions.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@
276276
/// @param {Color} $color - The base color used to generate the palette.
277277
/// @param {Map} $shades - A map of variations as keys and opacities as values.
278278
/// Based on the Material color system.
279-
/// @returns {Map} - A map consisting of 10 grayscale color variations and 10
279+
/// @returns {Map} - A map consisting of 10 color variations and 10
280280
/// text contrast colors for each variation.
281281
@function grayscale-palette($color, $shades) {
282282
$result: ();
283283
@each $saturation, $opacity in $shades {
284-
$shade: rgba(grayscale($color), $opacity);
284+
$shade: rgba($color, $opacity);
285285
$result: map-merge($result, ($saturation: $shade));
286286
}
287287
@return $result;
@@ -297,7 +297,7 @@
297297
/// @param {Color} $success [#4eb862] - The success color used throughout the application.
298298
/// @param {Color} $warn [#fbb13c] - The warning color used throughout the application.
299299
/// @param {Color} $error [#ff134a] - The error color used throughout the application.
300-
/// @param {Color} $grays [#000 | $igx-foreground-color] - The color used for generating the grayscale palette.
300+
/// @param {Color} $grays [#000 | $igx-foreground-color] - The color used for generating the grays palette.
301301
/// @param {Color} $surface [#fff] - The color used as a background in components, such as cards, sheets, and menus.
302302
/// @returns {Map} - A map consisting of 74 color variations, including the `primary`, `secondary`, `grays`,
303303
/// `info`, `success`, `warn`, and `error` colors.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@
11321132

11331133
%igx-grid__tr--pinned-bottom {
11341134
border-top: map-get($cell-pin, 'style') map-get($cell-pin, 'color') !important;
1135+
position: absolute;
1136+
bottom: 0;
11351137
}
11361138

11371139
%igx-grid__tr--edit {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,14 +588,12 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
588588

589589
private addPointerListeners(selection) {
590590
if (selection !== GridSelectionMode.multiple) { return; }
591-
this.nativeElement.addEventListener('pointerdown', this.pointerdown);
592591
this.nativeElement.addEventListener('pointerenter', this.pointerenter);
593592
this.nativeElement.addEventListener('pointerup', this.pointerup);
594593
}
595594

596595
private removePointerListeners(selection) {
597596
if (selection !== GridSelectionMode.multiple) { return; }
598-
this.nativeElement.removeEventListener('pointerdown', this.pointerdown);
599597
this.nativeElement.removeEventListener('pointerenter', this.pointerenter);
600598
this.nativeElement.removeEventListener('pointerup', this.pointerup);
601599
}
@@ -606,6 +604,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
606604
*/
607605
ngOnInit() {
608606
this.zone.runOutsideAngular(() => {
607+
this.nativeElement.addEventListener('pointerdown', this.pointerdown);
609608
this.addPointerListeners(this.cellSelectionMode);
610609
// IE 11 workarounds
611610
if (isIE()) {
@@ -629,6 +628,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
629628
*/
630629
ngOnDestroy() {
631630
this.zone.runOutsideAngular(() => {
631+
this.nativeElement.removeEventListener('pointerdown', this.pointerdown);
632632
this.removePointerListeners(this.cellSelectionMode);
633633
if (isIE()) {
634634
this.nativeElement.removeEventListener('compositionstart', this.compositionStartHandler);
@@ -755,6 +755,10 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
755755
* @internal
756756
*/
757757
pointerdown = (event: PointerEvent) => {
758+
if (this.cellSelectionMode !== GridSelectionMode.multiple) {
759+
this.activate(event);
760+
return;
761+
}
758762
if (!isLeftClick(event)) {
759763
this.selectionService.addKeyboardRange();
760764
this.selectionService.initKeyboardState();
@@ -816,9 +820,6 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
816820
*/
817821
@HostListener('click', ['$event'])
818822
public onClick(event: MouseEvent) {
819-
if (this.cellSelectionMode !== GridSelectionMode.multiple) {
820-
this.activate(event);
821-
}
822823
this.grid.onCellClick.emit({
823824
cell: this,
824825
event

projects/igniteui-angular/src/lib/grids/columns/column-group.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
239239
}
240240

241241
/**
242-
* Enables/Disables the column group selection.
243-
* ```html
244-
* <igx-column [selected] = "true"></igx-column>
242+
* Select/deselect the column group.
243+
* ```typescript
244+
* this.columnGroup.selected = true;
245245
* ```
246246
* @memberof IgxColumnGroupComponent
247247
*/

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ export class IgxColumnComponent implements AfterContentInit {
294294
}
295295

296296
/**
297-
* Enables/Disables column selection.
297+
* Select/deselect a column.
298298
* Default value is `false`.
299-
* ```html
300-
* <igx-column [selected] = "true"></igx-column>
299+
* ```typescript
300+
* this.column.selected = true;
301301
* ```
302302
* @memberof IgxColumnComponent
303303
*/

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4294,14 +4294,6 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
42944294
return this.calcHeight ? this.calcHeight + this.pinnedRowHeight : this.calcHeight;
42954295
}
42964296

4297-
get pinnedBottom() {
4298-
const start = this.verticalScrollContainer.state.startIndex;
4299-
const end = this.verticalScrollContainer.state.startIndex + this.verticalScrollContainer.state.chunkSize - 1;
4300-
const bottom = this.verticalScrollContainer.getScrollForIndex(end, true) - this.verticalScrollContainer.getScrollForIndex(start);
4301-
return bottom;
4302-
}
4303-
4304-
43054297
/**
43064298
* Recalculates grid width/height dimensions.
43074299
* @remarks

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ export class IgxGridAPIService extends GridBaseAPIService<IgxGridComponent> {
4343
names.forEach((colName) => {
4444
const grExprIndex = groupingState.findIndex((exp) => exp.fieldName === colName);
4545
const grpExpandState = this.grid.groupingExpansionState;
46-
/* remove expansion states related to the cleared group
47-
and all with deeper hierarchy than the cleared group */
48-
this.grid.groupingExpansionState = grpExpandState
49-
.filter((val) => {
50-
return val.hierarchy && val.hierarchy.length <= grExprIndex;
51-
});
46+
/* remove expansion states related to the cleared group
47+
and all with deeper hierarchy than the cleared group */
48+
const newExpandState = grpExpandState.filter((val) => {
49+
return val.hierarchy && val.hierarchy.length <= grExprIndex;
50+
});
51+
/* Do not set the new instance produced by filter
52+
when there are no differences between expansion states */
53+
if (newExpandState.length !== grpExpandState.length) {
54+
this.grid.groupingExpansionState = newExpandState;
55+
}
5256
});
5357
} else {
5458
// clear all

0 commit comments

Comments
 (0)