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

Merging 6.2.x into master #3012

Merged
merged 57 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9fcb9c9
feat(grid, chip): add display density DI token to igxGrid and igxChip
kacheshmarova Oct 26, 2018
c0cc258
Merge
kacheshmarova Oct 29, 2018
a6b0f20
Resolving confilcts related to the new structure(grids ->grid)
kacheshmarova Oct 29, 2018
318b560
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Oct 29, 2018
bd802cf
Merge
kacheshmarova Oct 30, 2018
248d782
Merge
kacheshmarova Oct 30, 2018
872fda9
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Oct 30, 2018
0d7bee4
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
zdrawku Oct 30, 2018
8df82f2
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
zdrawku Oct 30, 2018
d1d02f2
Fixing styling issue
kacheshmarova Oct 30, 2018
4047a82
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Oct 30, 2018
f93ebf1
Adding event arguments for DenistyChanged
kacheshmarova Oct 31, 2018
beffda6
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Oct 31, 2018
2ab12be
Renaming IDisplayDenisty to IDisplayDenistyOptions and setting IDensi…
kacheshmarova Oct 31, 2018
254bd4a
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Oct 31, 2018
06bd344
Trigger onDensityChanged only for components that do not have display…
kacheshmarova Nov 1, 2018
675c928
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Nov 1, 2018
c018eda
Merge
kacheshmarova Nov 1, 2018
e12c975
Adding displayDenisty DI in tree grid constructor
kacheshmarova Nov 2, 2018
3573c66
Merge branch 'master'
kacheshmarova Nov 2, 2018
b53a975
Merge master into vkacheshmarova/add-display-density-DI-token-igxGrid
mpavlinov Nov 5, 2018
f0eba7c
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Nov 5, 2018
fd97622
Group by chips are now affected from the global display denisty option
kacheshmarova Nov 5, 2018
f4464e2
Merge branch 'vkacheshmarova/add-display-density-DI-token-igxGrid' of…
kacheshmarova Nov 5, 2018
1a9ec68
fix(igxGrid): dirty check only checks if value exists, #2940
ViktorSlavov Nov 6, 2018
5eda948
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Nov 6, 2018
ef74275
fix(igx-grid): Open date-picker only if condition is not unary, #2937
sstoyanovIG Nov 6, 2018
e79ada8
Merge branch 'master' into VSlavov/grid-edit-dirty
ViktorSlavov Nov 6, 2018
ee9c894
Merge branch 'master' into sstoyanov/bug-fix-2937
bkulov Nov 6, 2018
a85d452
Summaries display denisty classes are now correctly applied
kacheshmarova Nov 6, 2018
40f6dd7
Removing dsiplayDenisty property since it is not needed any more
kacheshmarova Nov 6, 2018
3d6f6f8
Merge branch 'master' into sstoyanov/bug-fix-2937
bkulov Nov 6, 2018
adf480c
Merge branch 'master' into vkacheshmarova/add-display-density-DI-toke…
mpavlinov Nov 6, 2018
70f11a0
Merge branch 'master' into VSlavov/grid-edit-dirty
ViktorSlavov Nov 6, 2018
88067d9
fix(igx-grid): Clear filter when value is cleared from input, #2945
sstoyanovIG Nov 6, 2018
987c798
Merge branch '6.2.x' into vkacheshmarova/add-display-density-DI-token…
kdinev Nov 6, 2018
df616ac
Merge pull request #2942 from IgniteUI/VSlavov/grid-edit-dirty
kdinev Nov 6, 2018
55b91a3
Merge branch '6.2.x' into vkacheshmarova/add-display-density-DI-token…
kdinev Nov 6, 2018
8c99236
Merge branch 'master' into sstoyanov/bug-fix-2937
kdinev Nov 6, 2018
390bddd
Merge branch '6.2.x' into sstoyanov/bug-fix-2945
kdinev Nov 6, 2018
3291f21
Merge pull request #2847 from IgniteUI/vkacheshmarova/add-display-den…
mpavlinov Nov 7, 2018
40f2f19
Merge branch '6.2.x' into sstoyanov/bug-fix-2937
mpavlinov Nov 7, 2018
2e0261e
Merge branch '6.2.x' into sstoyanov/bug-fix-2945
kdinev Nov 7, 2018
3e45fbe
test(treeGrid): Update treeGrid Keyboard navigation tests #2953
nrobakova Nov 8, 2018
cdb7c42
Merge pull request #2952 from IgniteUI/sstoyanov/bug-fix-2945
kdinev Nov 8, 2018
21f7f7c
Merge branch '6.2.x' into sstoyanov/bug-fix-2937
kdinev Nov 8, 2018
18c7ca6
Merge pull request #2947 from IgniteUI/sstoyanov/bug-fix-2937
bkulov Nov 8, 2018
8fe6734
Merge branch '6.2.x' into nrobakova/fix-tests-2953-6.2.x
zdrawku Nov 8, 2018
43f9b21
Merge pull request #2973 from IgniteUI/nrobakova/fix-tests-2953-6.2.x
zdrawku Nov 9, 2018
ab3b06e
Improve keyboard navigation in filtering (#2964)
sstoyanovIG Nov 9, 2018
fb8661e
feat(igx-grid): Close filter row on Esc, #2979
sstoyanovIG Nov 12, 2018
b9a35d9
test(igx-grid): Add test, #2979
sstoyanovIG Nov 12, 2018
ae5233a
Merge pull request #2986 from IgniteUI/sstoyanov/fr-#2979
bkulov Nov 12, 2018
8c7fda5
chore(*): Merging master into 6.2.x
kdinev Nov 13, 2018
44e0538
Merge pull request #3004 from IgniteUI/master-6.2.x
kdinev Nov 13, 2018
3597d0d
Sorting strategy merge 6.2.x (#2998)
kdinev Nov 13, 2018
a507721
chore(*): Merging 6.2.x into master
kdinev Nov 14, 2018
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
Prev Previous commit
Next Next commit
Merge
  • Loading branch information
kacheshmarova committed Oct 29, 2018
commit c0cc258e3565d3e2a9a8511287c6ce53cee7445d
150 changes: 71 additions & 79 deletions projects/igniteui-angular/src/lib/grids/grid-base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import {
ViewChildren,
AfterViewChecked,
ViewContainerRef,
InjectionToken,
Optional
InjectionToken
} from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil, first } from 'rxjs/operators';
Expand Down Expand Up @@ -64,7 +63,7 @@ import {
} from './grid.rowEdit.directive';
import { IgxGridNavigationService } from './grid-navigation.service';
import { DeprecateProperty } from '../core/deprecateDecorators';
import { DisplayDensity, IDisplayDensity, DisplayDensityToken, DisplayDensityBase } from '../core/displayDensity';
import { DisplayDensity } from '../core/displayDensity';

const MINIMUM_COLUMN_WIDTH = 136;

Expand Down Expand Up @@ -151,30 +150,7 @@ export interface IFocusChangeEventArgs {
cancel: boolean;
}

/**
* **Ignite UI for Angular Grid** -
* [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid.html)
*
* The Ignite UI Grid is used for presenting and manipulating tabular data in the simplest way possible. Once data
* has been bound, it can be manipulated through filtering, sorting & editing operations.
*
* Example:
* ```html
* <igx-grid [data]="employeeData" autoGenerate="false">
* <igx-column field="first" header="First Name"></igx-column>
* <igx-column field="last" header="Last Name"></igx-column>
* <igx-column field="role" header="Role"></igx-column>
* </igx-grid>
* ```
*/
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
providers: [IgxGridNavigationService],
selector: 'igx-grid',
templateUrl: './grid.component.html'
})
export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDestroy, AfterContentInit, AfterViewInit, DoCheck {
export abstract class IgxGridBaseComponent implements OnInit, OnDestroy, AfterContentInit, AfterViewInit {

/**
* An @Input property that lets you fill the `IgxGridComponent` with an array of data.
Expand Down Expand Up @@ -406,6 +382,42 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
@Input()
public paginationTemplate: TemplateRef<any>;

/**
* Return the display density currently applied to the grid.
* The default value is `comfortable`.
* Available options are `comfortable`, `cosy`, `compact`.
* ```typescript
* let gridTheme = this.grid.displayDensity;
* ```
* @memberof IgxGridComponent
*/
@Input()
public get displayDensity(): DisplayDensity | string {
return this._displayDensity;
}

/**
* Sets the display density currently applied to the grid.
* ```html
* <igx-grid #grid [data]="localData" [displayDensity]="'compact'" [autoGenerate]="true"></igx-grid>
* ```
* @memberof IgxGridComponent
*/
public set displayDensity(val: DisplayDensity | string) {
switch (val) {
case 'compact':
this._displayDensity = DisplayDensity.compact;
break;
case 'cosy':
this._displayDensity = DisplayDensity.cosy;
break;
case 'comfortable':
default:
this._displayDensity = DisplayDensity.comfortable;
}
this.onDensityChanged.emit();
}

/**
* Returns whether the column hiding UI for the `IgxGridComponent` is enabled.
* By default it is disabled (false).
Expand Down Expand Up @@ -1105,6 +1117,12 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
@Output()
public onFocusChange = new EventEmitter<IFocusChangeEventArgs>();

/**
* @hidden
*/
@Output()
protected onDensityChanged = new EventEmitter<any>();

/**
* @hidden
*/
Expand Down Expand Up @@ -1350,38 +1368,28 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
*/
@HostBinding('attr.class')
get hostClass(): string {
if (this.isCosy()) {
return 'igx-grid--cosy';
} else if (this.isCompact()) {
return 'igx-grid--compact';
} else {
return 'igx-grid';
}
}

/**
* @hidden
*/
get groupAreaHostClass(): string {
if (this.isCosy()) {
return 'igx-drop-area--cosy';
} else if (this.isCompact()) {
return 'igx-drop-area--compact';
} else {
return 'igx-drop-area';
switch (this._displayDensity) {
case DisplayDensity.cosy:
return 'igx-grid--cosy';
case DisplayDensity.compact:
return 'igx-grid--compact';
default:
return 'igx-grid';
}
}

get bannerClass(): string {
let bannerClass = '';
if (this.isCosy()) {
bannerClass = 'igx-banner--cosy';
} else if (this.isCompact()) {
bannerClass = 'igx-banner--compact';
} else {
bannerClass = 'igx-banner';
switch (this._displayDensity) {
case DisplayDensity.cosy:
bannerClass = 'igx-banner--cosy';
break;
case DisplayDensity.compact:
bannerClass = 'igx-banner--compact';
break;
default:
bannerClass = 'igx-banner';
}

bannerClass += this.rowEditPositioningStrategy.isTop ? ' igx-banner__border-top' : ' igx-banner__border-bottom';
return bannerClass;
}
Expand Down Expand Up @@ -1936,6 +1944,7 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
private _height = '100%';
private _width = '100%';
private _rowHeight;
private _displayDensity = DisplayDensity.comfortable;
private _ngAfterViewInitPaassed = false;
private _horizontalForOfs;

Expand Down Expand Up @@ -2009,9 +2018,7 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
private resolver: ComponentFactoryResolver,
protected differs: IterableDiffers,
private viewRef: ViewContainerRef,
private navigation: IgxGridNavigationService,
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensity) {
super(_displayDensityOptions);
private navigation: IgxGridNavigationService) {
this.resizeHandler = () => {
this.calculateGridSizes();
this.zone.run(() => this.markForCheck());
Expand Down Expand Up @@ -2159,23 +2166,6 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
vertScrDC.addEventListener('scroll', (evt) => { this.scrollHandler(evt); });
}

public ngDoCheck(): void {
super.ngDoCheck();
if (this.groupingDiffer) {
const changes = this.groupingDiffer.diff(this.groupingExpressions);
if (changes && this.columnList) {
changes.forEachAddedItem((rec) => {
const col = this.getColumnByName(rec.item.fieldName);
col.hidden = true;
});
changes.forEachRemovedItem((rec) => {
const col = this.getColumnByName(rec.item.fieldName);
col.hidden = false;
});
}
}
}

/**
* @hidden
*/
Expand Down Expand Up @@ -2248,12 +2238,14 @@ export class IgxGridComponent extends DisplayDensityBase implements OnInit, OnDe
* @memberof IgxGridComponent
*/
get defaultRowHeight(): number {
if (this.isCosy()) {
return 40;
} else if (this.isCompact()) {
return 32;
} else {
return 50;
switch (this._displayDensity) {
case DisplayDensity.compact:
return 32;
case DisplayDensity.cosy:
return 40;
case DisplayDensity.comfortable:
default:
return 50;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class IgxGridSummaryComponent implements DoCheck {

@HostBinding('class.igx-grid-summary')
get defaultCSS() {
return this.gridAPI.get(this.gridID).isComfortable();
return this.displayDensity === DisplayDensity.comfortable;
}

get dataType(): DataType {
Expand Down
72 changes: 54 additions & 18 deletions projects/igniteui-angular/src/lib/grids/grid-toolbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import {
HostBinding,
Input,
Optional,
ViewChild,
Inject
ViewChild
} from '@angular/core';

import { DisplayDensity, IDisplayDensity, DisplayDensityToken, DisplayDensityBase } from '../core/displayDensity';
import { DisplayDensity } from '../core/displayDensity';
import {
CsvFileTypes,
IgxBaseExporter,
Expand All @@ -30,7 +29,7 @@ import { ConnectedPositioningStrategy } from '../services/overlay/position';
selector: 'igx-grid-toolbar',
templateUrl: './grid-toolbar.component.html'
})
export class IgxGridToolbarComponent extends DisplayDensityBase {
export class IgxGridToolbarComponent {

/**
* @hidden
Expand Down Expand Up @@ -196,28 +195,65 @@ export class IgxGridToolbarComponent extends DisplayDensityBase {
return this.grid.pinnedColumns.length;
}

private _displayDensity: DisplayDensity | string;

/**
* Returns the theme of the `IgxGridToolbarComponent`.
* The default theme is `comfortable`.
* Available options are `comfortable`, `cosy`, `compact`.
* ```typescript
* let toolbarTheme = this.grid.toolbar.displayDensity;
* ```
*/
@Input()
public get displayDensity(): DisplayDensity | string {
return this._displayDensity;
}

/**
* Sets the theme of the `IgxGridToolbarComponent`.
* ```html
* <igx-grid #grid [data]="localData" [displayDensity]="'compact'" [autoGenerate]="true"></igx-grid>
* ```
*/
public set displayDensity(val: DisplayDensity | string) {
switch (val) {
case 'compact':
this._displayDensity = DisplayDensity.compact;
break;
case 'cosy':
this._displayDensity = DisplayDensity.cosy;
break;
case 'comfortable':
default:
this._displayDensity = DisplayDensity.comfortable;
}
}

/**
* Returns the theme of the `IgxGridToolbarComponent`.
* ```typescript
* const toolbarTheme = this.grid.toolbar.hostClass;
* ```
*/
@HostBinding('attr.class')
get hostClass(): string {
if (this.isCosy()) {
return 'igx-grid-toolbar--cosy';
} else if (this.isCompact()) {
return 'igx-grid-toolbar--compact';
} else {
return 'igx-grid-toolbar';
}
}
constructor(public gridAPI: IgxGridAPIService,

@HostBinding('attr.class')
get hostClass(): string {
switch (this._displayDensity) {
case DisplayDensity.compact:
return 'igx-grid-toolbar--compact';
case DisplayDensity.cosy:
return 'igx-grid-toolbar--cosy';
case DisplayDensity.comfortable:
default:
return 'igx-grid-toolbar';
}
}

constructor(public gridAPI: GridBaseAPIService<IgxGridBaseComponent>,
public cdr: ChangeDetectorRef,
@Optional() public excelExporter: IgxExcelExporterService,
@Optional() public csvExporter: IgxCsvExporterService,
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensity) {
super(_displayDensityOptions);
@Optional() public csvExporter: IgxCsvExporterService) {
}

private _positionSettings: PositionSettings = {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.