Skip to content

Commit a5aae21

Browse files
authored
Merge branch 'master' into mkirova/mch-percentage
2 parents 1862159 + 9f1e5c2 commit a5aae21

File tree

8 files changed

+180
-142
lines changed

8 files changed

+180
-142
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes for each version of this project will be documented in this
1212
- `IgxTransaction` - The `onStateUpdate` now emits with information of its origin. The emitted value is of type `StateUpdateEvent`, which has two properties:
1313
- `origin` - it can vary within the values of the `TransactionEventOrigin` interface;
1414
- `actions` - contains information about the transactions, that caused the emission of the event.
15+
- `IgxPaginator` - The input `overlaySettings` was introduced, which allows applying custom overlay settings for the component.
1516

1617
### New Features
1718
- `IgxGrid`

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

Lines changed: 97 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -610,15 +610,15 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
610610
public dragRowID = null;
611611

612612

613-
/**
614-
* Gets/Sets whether the rows are editable.
615-
* @remarks
616-
* By default it is set to false.
617-
* @example
618-
* ```html
619-
* <igx-grid #grid [showToolbar]="true" [rowEditable]="true" [primaryKey]="'ProductID'" [columnHiding]="true"></igx-grid>
620-
* ```
621-
*/
613+
/**
614+
* Gets/Sets whether the rows are editable.
615+
* @remarks
616+
* By default it is set to false.
617+
* @example
618+
* ```html
619+
* <igx-grid #grid [showToolbar]="true" [rowEditable]="true" [primaryKey]="'ProductID'" [columnHiding]="true"></igx-grid>
620+
* ```
621+
*/
622622
@WatchChanges()
623623
@Input()
624624
get rowEditable(): boolean {
@@ -1096,13 +1096,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
10961096
@Output()
10971097
public onRowSelectionChange = new EventEmitter<IRowSelectionEventArgs>();
10981098

1099-
/**
1100-
* Emitted when `IgxColumnComponent` is selected.
1101-
* @example
1102-
* ```html
1103-
* <igx-grid #grid (onColumnSelectionChange)="onColumnSelectionChange($event)" [data]="localData" [autoGenerate]="true"></igx-grid>
1104-
* ```
1105-
*/
1099+
/**
1100+
* Emitted when `IgxColumnComponent` is selected.
1101+
* @example
1102+
* ```html
1103+
* <igx-grid #grid (onColumnSelectionChange)="onColumnSelectionChange($event)" [data]="localData" [autoGenerate]="true"></igx-grid>
1104+
* ```
1105+
*/
11061106
@Output()
11071107
public onColumnSelectionChange = new EventEmitter<IColumnSelectionEventArgs>();
11081108

@@ -2644,6 +2644,11 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
26442644
positionStrategy: this.rowEditPositioningStrategy
26452645
};
26462646

2647+
/**
2648+
* @hidden @internal
2649+
*/
2650+
public paginatorSettings: OverlaySettings = null;
2651+
26472652
private verticalScrollHandler = (event) => {
26482653
this.verticalScrollContainer.onScroll(event);
26492654
this.disableTransitions = true;
@@ -2879,7 +2884,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
28792884
this.notifyChanges();
28802885
});
28812886

2882-
this.resizeNotify.pipe(destructor, filter(() => !this._init), throttleTime(100, undefined, {leading: true, trailing: true}))
2887+
this.resizeNotify.pipe(destructor, filter(() => !this._init), throttleTime(100, undefined, { leading: true, trailing: true }))
28832888
.subscribe(() => {
28842889
this.zone.run(() => {
28852890
this.notifyChanges(true);
@@ -3016,9 +3021,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
30163021
public setFilteredData(data, pinned: boolean) {
30173022
if (this.hasPinnedRecords && pinned) {
30183023
this._filteredPinnedData = data || [];
3019-
const filteredUnpinned = this._filteredUnpinnedData || [];
3020-
const filteredData = [... this._filteredPinnedData, ... filteredUnpinned];
3021-
this.filteredData = filteredData.length > 0 ? filteredData : this._filteredUnpinnedData;
3024+
const filteredUnpinned = this._filteredUnpinnedData || [];
3025+
const filteredData = [... this._filteredPinnedData, ...filteredUnpinned];
3026+
this.filteredData = filteredData.length > 0 ? filteredData : this._filteredUnpinnedData;
30223027
} else if (this.hasPinnedRecords && !pinned) {
30233028
this._filteredUnpinnedData = data;
30243029
} else {
@@ -3079,7 +3084,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
30793084
this._filteredSortedPinnedData = data;
30803085
this.pinnedRecords = data;
30813086
this._filteredSortedData = this.isRowPinningToTop ? [... this._filteredSortedPinnedData, ... this._filteredSortedUnpinnedData] :
3082-
[... this._filteredSortedUnpinnedData, ... this._filteredSortedPinnedData];
3087+
[... this._filteredSortedUnpinnedData, ... this._filteredSortedPinnedData];
30833088
this.refreshSearch(true, false);
30843089
} else if (this.pinnedRecordsCount > 0 && !pinned) {
30853090
this._filteredSortedUnpinnedData = data;
@@ -3131,14 +3136,16 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
31313136
this._setupRowObservers();
31323137
this._zoneBegoneListeners();
31333138

3139+
this.paginatorSettings = { outlet: this.outlet };
3140+
31343141
const vertScrDC = this.verticalScrollContainer.displayContainer;
31353142
vertScrDC.addEventListener('scroll', this.preventContainerScroll);
31363143

31373144
this._pinnedRowList.changes
3138-
.pipe(takeUntil(this.destroy$))
3139-
.subscribe((change: QueryList<IgxGridRowComponent>) => {
3140-
this.onPinnedRowsChanged(change);
3141-
});
3145+
.pipe(takeUntil(this.destroy$))
3146+
.subscribe((change: QueryList<IgxGridRowComponent>) => {
3147+
this.onPinnedRowsChanged(change);
3148+
});
31423149
}
31433150

31443151
/**
@@ -3841,7 +3848,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
38413848
'DropPosition.None is deprecated.' +
38423849
'Use DropPosition.AfterDropTarget instead.',
38433850
warningShown);
3844-
position = DropPosition.AfterDropTarget;
3851+
position = DropPosition.AfterDropTarget;
38453852
}
38463853
if ((column.level !== dropTarget.level) ||
38473854
(column.topLevelParent !== dropTarget.topLevelParent)) {
@@ -4291,7 +4298,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
42914298
* @param rowID The row id - primaryKey value or the data record instance.
42924299
*/
42934300
public unpinRow(rowID: any) {
4294-
const index = this._pinnedRecordIDs.indexOf(rowID);
4301+
const index = this._pinnedRecordIDs.indexOf(rowID);
42954302
if (index === -1) {
42964303
return false;
42974304
}
@@ -4891,7 +4898,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
48914898
const diff = this.rowListDiffer.diff(change);
48924899
if (diff) {
48934900
this.notifyChanges(true);
4894-
}
4901+
}
48954902
}
48964903

48974904
/**
@@ -5187,7 +5194,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
51875194
*/
51885195
protected reinitPinStates() {
51895196
this._pinnedColumns = this.columnList
5190-
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
5197+
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
51915198
this._unpinnedColumns = this.hasColumnGroups ? this.columnList.filter((c) => !c.pinned) :
51925199
this.columnList.filter((c) => !c.pinned)
51935200
.sort((a, b) => this._unpinnedColumns.indexOf(a) - this._unpinnedColumns.indexOf(b));
@@ -5513,14 +5520,14 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55135520
return this.extractDataFromSelection(source, formatters, headers);
55145521
}
55155522

5516-
/**
5517-
* Get current selected columns.
5518-
* @example
5519-
* Returns an array with selected columns
5520-
* ```typescript
5521-
* const selectedColumns = this.grid.selectedColumns();
5522-
* ```
5523-
*/
5523+
/**
5524+
* Get current selected columns.
5525+
* @example
5526+
* Returns an array with selected columns
5527+
* ```typescript
5528+
* const selectedColumns = this.grid.selectedColumns();
5529+
* ```
5530+
*/
55245531
public selectedColumns(): IgxColumnComponent[] {
55255532
const fields = this.selectionService.getSelectedColumns();
55265533
return fields.map(field => this.getColumnByName(field)).filter(field => field);
@@ -5542,9 +5549,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55425549
} else {
55435550
(columns as IgxColumnComponent[]).forEach(col => {
55445551
if (col.columnGroup) {
5545-
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5546-
fieldToSelect = [...fieldToSelect, ...children];
5547-
} else {
5552+
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5553+
fieldToSelect = [...fieldToSelect, ...children];
5554+
} else {
55485555
fieldToSelect.push(col.field);
55495556
}
55505557
});
@@ -5569,9 +5576,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55695576
} else {
55705577
(columns as IgxColumnComponent[]).forEach(col => {
55715578
if (col.columnGroup) {
5572-
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5573-
fieldToDeselect = [...fieldToDeselect, ...children];
5574-
} else {
5579+
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5580+
fieldToDeselect = [...fieldToDeselect, ...children];
5581+
} else {
55755582
fieldToDeselect.push(col.field);
55765583
}
55775584
});
@@ -5580,25 +5587,25 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55805587
this.notifyChanges();
55815588
}
55825589

5583-
/**
5584-
* Deselects all columns
5585-
* @example
5586-
* ```typescript
5587-
* this.grid.deselectAllColumns();
5588-
* ```
5589-
*/
5590+
/**
5591+
* Deselects all columns
5592+
* @example
5593+
* ```typescript
5594+
* this.grid.deselectAllColumns();
5595+
* ```
5596+
*/
55905597
public deselectAllColumns() {
55915598
this.selectionService.clearAllSelectedColumns();
55925599
this.notifyChanges();
55935600
}
55945601

5595-
/**
5596-
* Selects all columns
5597-
* @example
5598-
* ```typescript
5599-
* this.grid.deselectAllColumns();
5600-
* ```
5601-
*/
5602+
/**
5603+
* Selects all columns
5604+
* @example
5605+
* ```typescript
5606+
* this.grid.deselectAllColumns();
5607+
* ```
5608+
*/
56025609
public selectAllColumns() {
56035610
this.selectColumns(this.columnList.filter(c => !c.columnGroup));
56045611
}
@@ -5634,7 +5641,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
56345641
* If `headers` is enabled, it will use the column header (if any) instead of the column field.
56355642
*/
56365643
public getSelectedColumnsData(formatters = false, headers = false) {
5637-
const source = this.filteredSortedData ? this.filteredSortedData : this.data;
5644+
const source = this.filteredSortedData ? this.filteredSortedData : this.data;
56385645
return this.extractDataFromColumnsSelection(source, formatters, headers);
56395646
}
56405647

@@ -5725,34 +5732,36 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
57255732
this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex, () => {
57265733
if (shouldScrollHorizontally) {
57275734
this.navigation.performHorizontalScrollToCell(visibleColIndex, () =>
5728-
this.executeCallback(rowIndex, visibleColIndex, cb));
5735+
this.executeCallback(rowIndex, visibleColIndex, cb));
57295736
} else {
57305737
this.executeCallback(rowIndex, visibleColIndex, cb);
5731-
}});
5738+
}
5739+
});
57325740
} else if (shouldScrollHorizontally) {
57335741
this.navigation.performHorizontalScrollToCell(visibleColIndex, () => {
57345742
if (shouldScrollVertically) {
57355743
this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex, () =>
57365744
this.executeCallback(rowIndex, visibleColIndex, cb));
57375745
} else {
57385746
this.executeCallback(rowIndex, visibleColIndex, cb);
5739-
}});
5747+
}
5748+
});
57405749
} else {
57415750
this.executeCallback(rowIndex, visibleColIndex, cb);
57425751
}
57435752
}
57445753

5745-
/**
5746-
* Returns `ICellPosition` which defines the next cell,
5747-
* according to the current position, that match specific criteria.
5748-
* @remarks
5749-
* You can pass callback function as a third parameter of `getPreviousCell` method.
5750-
* The callback function accepts IgxColumnComponent as a param
5751-
* @example
5752-
* ```typescript
5753-
* const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
5754-
* ```
5755-
*/
5754+
/**
5755+
* Returns `ICellPosition` which defines the next cell,
5756+
* according to the current position, that match specific criteria.
5757+
* @remarks
5758+
* You can pass callback function as a third parameter of `getPreviousCell` method.
5759+
* The callback function accepts IgxColumnComponent as a param
5760+
* @example
5761+
* ```typescript
5762+
* const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
5763+
* ```
5764+
*/
57565765
public getNextCell(currRowIndex: number, curVisibleColIndex: number,
57575766
callback: (IgxColumnComponent) => boolean = null): ICellPosition {
57585767
const columns = this.columnList.filter(col => !col.columnGroup && col.visibleIndex >= 0);
@@ -5775,17 +5784,17 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
57755784
}
57765785
}
57775786

5778-
/**
5779-
* Returns `ICellPosition` which defines the previous cell,
5780-
* according to the current position, that match specific criteria.
5781-
* @remarks
5782-
* You can pass callback function as a third parameter of `getPreviousCell` method.
5783-
* The callback function accepts IgxColumnComponent as a param
5784-
* @example
5785-
* ```typescript
5786-
* const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
5787-
* ```
5788-
*/
5787+
/**
5788+
* Returns `ICellPosition` which defines the previous cell,
5789+
* according to the current position, that match specific criteria.
5790+
* @remarks
5791+
* You can pass callback function as a third parameter of `getPreviousCell` method.
5792+
* The callback function accepts IgxColumnComponent as a param
5793+
* @example
5794+
* ```typescript
5795+
* const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
5796+
* ```
5797+
*/
57895798
public getPreviousCell(currRowIndex: number, curVisibleColIndex: number,
57905799
callback: (IgxColumnComponent) => boolean = null): ICellPosition {
57915800
const columns = this.columnList.filter(col => !col.columnGroup && col.visibleIndex >= 0);
@@ -5856,9 +5865,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
58565865
}
58575866
// find next/prev record that is editable.
58585867
const nextRowIndex = previous ? this.findPrevEditableDataRowIndex(currentRowIndex) :
5859-
this.dataView.findIndex((rec, index) =>
5860-
index > currentRowIndex && this.isEditableDataRecordAtIndex(index));
5861-
return nextRowIndex !== -1 ? nextRowIndex : currentRowIndex ;
5868+
this.dataView.findIndex((rec, index) =>
5869+
index > currentRowIndex && this.isEditableDataRecordAtIndex(index));
5870+
return nextRowIndex !== -1 ? nextRowIndex : currentRowIndex;
58625871
}
58635872

58645873
/**
@@ -5884,7 +5893,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
58845893
private isEditableDataRecordAtIndex(dataViewIndex) {
58855894
const rec = this.dataView[dataViewIndex];
58865895
return !rec.expression && !rec.summaries && !rec.childGridsData && !rec.detailsData &&
5887-
!this.isGhostRecordAtIndex(dataViewIndex);
5896+
!this.isGhostRecordAtIndex(dataViewIndex);
58885897
}
58895898

58905899
/**
@@ -6252,7 +6261,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
62526261
private configureRowEditingOverlay(rowID: any, useOuter = false) {
62536262
this.rowEditSettings.outlet = useOuter ? this.parentRowOutletDirective : this.rowOutletDirective;
62546263
this.rowEditPositioningStrategy.settings.container = this.tbody.nativeElement;
6255-
const pinned = this._pinnedRecordIDs.indexOf(rowID) !== -1;
6264+
const pinned = this._pinnedRecordIDs.indexOf(rowID) !== -1;
62566265
const targetRow = !pinned ? this.gridAPI.get_row_by_key(rowID) : this.pinnedRows.find(x => x.rowID === rowID);
62576266
if (!targetRow) {
62586267
return;

projects/igniteui-angular/src/lib/grids/grid/grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
</div>
242242

243243
<ng-template #defaultPaginator>
244-
<igx-paginator [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords" [(perPage)]="perPage">
244+
<igx-paginator [overlaySettings]="paginatorSettings" [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords" [(perPage)]="perPage">
245245
</igx-paginator>
246246
</ng-template>
247247

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
</div>
201201

202202
<ng-template #defaultPaginator>
203-
<igx-paginator [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords" [(perPage)]="perPage">
203+
<igx-paginator [overlaySettings]="paginatorSettings" [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords" [(perPage)]="perPage">
204204
</igx-paginator>
205205
</ng-template>
206206

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
</div>
175175

176176
<ng-template #defaultPaginator>
177-
<igx-paginator [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords"
177+
<igx-paginator [overlaySettings]="paginatorSettings" [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords"
178178
[(perPage)]="perPage">
179179
</igx-paginator>
180180
</ng-template>

projects/igniteui-angular/src/lib/paginator/paginator.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="igx-paginator__select" [hidden]="dropdownHidden">
22
<label class="igx-paginator__label">{{ resourceStrings.igx_paginator_label }}</label>
33
<div class="igx-paginator__select-input">
4-
<igx-select [(ngModel)]="perPage" [displayDensity]="paginatorSelectDisplayDensity()" type="border"
4+
<igx-select [overlaySettings]="overlaySettings" [(ngModel)]="perPage" [displayDensity]="paginatorSelectDisplayDensity()" type="border"
55
[disabled]="!dropdownEnabled">
66
<label igxLabel [hidden]="true">{{ resourceStrings.igx_paginator_label }}</label>
77
<igx-select-item [value]="val" *ngFor="let val of selectOptions">

0 commit comments

Comments
 (0)