Skip to content

Commit 04b5784

Browse files
authored
Merge branch 'master' into pbozhinov/fix-7416
2 parents a6dd214 + 9f1e5c2 commit 04b5784

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

@@ -2634,6 +2634,11 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
26342634
positionStrategy: this.rowEditPositioningStrategy
26352635
};
26362636

2637+
/**
2638+
* @hidden @internal
2639+
*/
2640+
public paginatorSettings: OverlaySettings = null;
2641+
26372642
private verticalScrollHandler = (event) => {
26382643
this.verticalScrollContainer.onScroll(event);
26392644
this.disableTransitions = true;
@@ -2869,7 +2874,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
28692874
this.notifyChanges();
28702875
});
28712876

2872-
this.resizeNotify.pipe(destructor, filter(() => !this._init), throttleTime(100, undefined, {leading: true, trailing: true}))
2877+
this.resizeNotify.pipe(destructor, filter(() => !this._init), throttleTime(100, undefined, { leading: true, trailing: true }))
28732878
.subscribe(() => {
28742879
this.zone.run(() => {
28752880
this.notifyChanges(true);
@@ -3006,9 +3011,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
30063011
public setFilteredData(data, pinned: boolean) {
30073012
if (this.hasPinnedRecords && pinned) {
30083013
this._filteredPinnedData = data || [];
3009-
const filteredUnpinned = this._filteredUnpinnedData || [];
3010-
const filteredData = [... this._filteredPinnedData, ... filteredUnpinned];
3011-
this.filteredData = filteredData.length > 0 ? filteredData : this._filteredUnpinnedData;
3014+
const filteredUnpinned = this._filteredUnpinnedData || [];
3015+
const filteredData = [... this._filteredPinnedData, ...filteredUnpinned];
3016+
this.filteredData = filteredData.length > 0 ? filteredData : this._filteredUnpinnedData;
30123017
} else if (this.hasPinnedRecords && !pinned) {
30133018
this._filteredUnpinnedData = data;
30143019
} else {
@@ -3069,7 +3074,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
30693074
this._filteredSortedPinnedData = data;
30703075
this.pinnedRecords = data;
30713076
this._filteredSortedData = this.isRowPinningToTop ? [... this._filteredSortedPinnedData, ... this._filteredSortedUnpinnedData] :
3072-
[... this._filteredSortedUnpinnedData, ... this._filteredSortedPinnedData];
3077+
[... this._filteredSortedUnpinnedData, ... this._filteredSortedPinnedData];
30733078
this.refreshSearch(true, false);
30743079
} else if (this.pinnedRecordsCount > 0 && !pinned) {
30753080
this._filteredSortedUnpinnedData = data;
@@ -3121,14 +3126,16 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
31213126
this._setupRowObservers();
31223127
this._zoneBegoneListeners();
31233128

3129+
this.paginatorSettings = { outlet: this.outlet };
3130+
31243131
const vertScrDC = this.verticalScrollContainer.displayContainer;
31253132
vertScrDC.addEventListener('scroll', this.preventContainerScroll);
31263133

31273134
this._pinnedRowList.changes
3128-
.pipe(takeUntil(this.destroy$))
3129-
.subscribe((change: QueryList<IgxGridRowComponent>) => {
3130-
this.onPinnedRowsChanged(change);
3131-
});
3135+
.pipe(takeUntil(this.destroy$))
3136+
.subscribe((change: QueryList<IgxGridRowComponent>) => {
3137+
this.onPinnedRowsChanged(change);
3138+
});
31323139
}
31333140

31343141
/**
@@ -3826,7 +3833,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
38263833
'DropPosition.None is deprecated.' +
38273834
'Use DropPosition.AfterDropTarget instead.',
38283835
warningShown);
3829-
position = DropPosition.AfterDropTarget;
3836+
position = DropPosition.AfterDropTarget;
38303837
}
38313838
if ((column.level !== dropTarget.level) ||
38323839
(column.topLevelParent !== dropTarget.topLevelParent)) {
@@ -4276,7 +4283,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
42764283
* @param rowID The row id - primaryKey value or the data record instance.
42774284
*/
42784285
public unpinRow(rowID: any) {
4279-
const index = this._pinnedRecordIDs.indexOf(rowID);
4286+
const index = this._pinnedRecordIDs.indexOf(rowID);
42804287
if (index === -1) {
42814288
return false;
42824289
}
@@ -4876,7 +4883,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
48764883
const diff = this.rowListDiffer.diff(change);
48774884
if (diff) {
48784885
this.notifyChanges(true);
4879-
}
4886+
}
48804887
}
48814888

48824889
/**
@@ -5172,7 +5179,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
51725179
*/
51735180
protected reinitPinStates() {
51745181
this._pinnedColumns = this.columnList
5175-
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
5182+
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
51765183
this._unpinnedColumns = this.hasColumnGroups ? this.columnList.filter((c) => !c.pinned) :
51775184
this.columnList.filter((c) => !c.pinned)
51785185
.sort((a, b) => this._unpinnedColumns.indexOf(a) - this._unpinnedColumns.indexOf(b));
@@ -5498,14 +5505,14 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
54985505
return this.extractDataFromSelection(source, formatters, headers);
54995506
}
55005507

5501-
/**
5502-
* Get current selected columns.
5503-
* @example
5504-
* Returns an array with selected columns
5505-
* ```typescript
5506-
* const selectedColumns = this.grid.selectedColumns();
5507-
* ```
5508-
*/
5508+
/**
5509+
* Get current selected columns.
5510+
* @example
5511+
* Returns an array with selected columns
5512+
* ```typescript
5513+
* const selectedColumns = this.grid.selectedColumns();
5514+
* ```
5515+
*/
55095516
public selectedColumns(): IgxColumnComponent[] {
55105517
const fields = this.selectionService.getSelectedColumns();
55115518
return fields.map(field => this.getColumnByName(field)).filter(field => field);
@@ -5527,9 +5534,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55275534
} else {
55285535
(columns as IgxColumnComponent[]).forEach(col => {
55295536
if (col.columnGroup) {
5530-
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5531-
fieldToSelect = [...fieldToSelect, ...children];
5532-
} else {
5537+
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5538+
fieldToSelect = [...fieldToSelect, ...children];
5539+
} else {
55335540
fieldToSelect.push(col.field);
55345541
}
55355542
});
@@ -5554,9 +5561,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55545561
} else {
55555562
(columns as IgxColumnComponent[]).forEach(col => {
55565563
if (col.columnGroup) {
5557-
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5558-
fieldToDeselect = [...fieldToDeselect, ...children];
5559-
} else {
5564+
const children = col.allChildren.filter(c => !c.columnGroup).map(c => c.field);
5565+
fieldToDeselect = [...fieldToDeselect, ...children];
5566+
} else {
55605567
fieldToDeselect.push(col.field);
55615568
}
55625569
});
@@ -5565,25 +5572,25 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
55655572
this.notifyChanges();
55665573
}
55675574

5568-
/**
5569-
* Deselects all columns
5570-
* @example
5571-
* ```typescript
5572-
* this.grid.deselectAllColumns();
5573-
* ```
5574-
*/
5575+
/**
5576+
* Deselects all columns
5577+
* @example
5578+
* ```typescript
5579+
* this.grid.deselectAllColumns();
5580+
* ```
5581+
*/
55755582
public deselectAllColumns() {
55765583
this.selectionService.clearAllSelectedColumns();
55775584
this.notifyChanges();
55785585
}
55795586

5580-
/**
5581-
* Selects all columns
5582-
* @example
5583-
* ```typescript
5584-
* this.grid.deselectAllColumns();
5585-
* ```
5586-
*/
5587+
/**
5588+
* Selects all columns
5589+
* @example
5590+
* ```typescript
5591+
* this.grid.deselectAllColumns();
5592+
* ```
5593+
*/
55875594
public selectAllColumns() {
55885595
this.selectColumns(this.columnList.filter(c => !c.columnGroup));
55895596
}
@@ -5619,7 +5626,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
56195626
* If `headers` is enabled, it will use the column header (if any) instead of the column field.
56205627
*/
56215628
public getSelectedColumnsData(formatters = false, headers = false) {
5622-
const source = this.filteredSortedData ? this.filteredSortedData : this.data;
5629+
const source = this.filteredSortedData ? this.filteredSortedData : this.data;
56235630
return this.extractDataFromColumnsSelection(source, formatters, headers);
56245631
}
56255632

@@ -5710,34 +5717,36 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
57105717
this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex, () => {
57115718
if (shouldScrollHorizontally) {
57125719
this.navigation.performHorizontalScrollToCell(visibleColIndex, () =>
5713-
this.executeCallback(rowIndex, visibleColIndex, cb));
5720+
this.executeCallback(rowIndex, visibleColIndex, cb));
57145721
} else {
57155722
this.executeCallback(rowIndex, visibleColIndex, cb);
5716-
}});
5723+
}
5724+
});
57175725
} else if (shouldScrollHorizontally) {
57185726
this.navigation.performHorizontalScrollToCell(visibleColIndex, () => {
57195727
if (shouldScrollVertically) {
57205728
this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex, () =>
57215729
this.executeCallback(rowIndex, visibleColIndex, cb));
57225730
} else {
57235731
this.executeCallback(rowIndex, visibleColIndex, cb);
5724-
}});
5732+
}
5733+
});
57255734
} else {
57265735
this.executeCallback(rowIndex, visibleColIndex, cb);
57275736
}
57285737
}
57295738

5730-
/**
5731-
* Returns `ICellPosition` which defines the next cell,
5732-
* according to the current position, that match specific criteria.
5733-
* @remarks
5734-
* You can pass callback function as a third parameter of `getPreviousCell` method.
5735-
* The callback function accepts IgxColumnComponent as a param
5736-
* @example
5737-
* ```typescript
5738-
* const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
5739-
* ```
5740-
*/
5739+
/**
5740+
* Returns `ICellPosition` which defines the next cell,
5741+
* according to the current position, that match specific criteria.
5742+
* @remarks
5743+
* You can pass callback function as a third parameter of `getPreviousCell` method.
5744+
* The callback function accepts IgxColumnComponent as a param
5745+
* @example
5746+
* ```typescript
5747+
* const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
5748+
* ```
5749+
*/
57415750
public getNextCell(currRowIndex: number, curVisibleColIndex: number,
57425751
callback: (IgxColumnComponent) => boolean = null): ICellPosition {
57435752
const columns = this.columnList.filter(col => !col.columnGroup && col.visibleIndex >= 0);
@@ -5760,17 +5769,17 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
57605769
}
57615770
}
57625771

5763-
/**
5764-
* Returns `ICellPosition` which defines the previous cell,
5765-
* according to the current position, that match specific criteria.
5766-
* @remarks
5767-
* You can pass callback function as a third parameter of `getPreviousCell` method.
5768-
* The callback function accepts IgxColumnComponent as a param
5769-
* @example
5770-
* ```typescript
5771-
* const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
5772-
* ```
5773-
*/
5772+
/**
5773+
* Returns `ICellPosition` which defines the previous cell,
5774+
* according to the current position, that match specific criteria.
5775+
* @remarks
5776+
* You can pass callback function as a third parameter of `getPreviousCell` method.
5777+
* The callback function accepts IgxColumnComponent as a param
5778+
* @example
5779+
* ```typescript
5780+
* const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
5781+
* ```
5782+
*/
57745783
public getPreviousCell(currRowIndex: number, curVisibleColIndex: number,
57755784
callback: (IgxColumnComponent) => boolean = null): ICellPosition {
57765785
const columns = this.columnList.filter(col => !col.columnGroup && col.visibleIndex >= 0);
@@ -5841,9 +5850,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
58415850
}
58425851
// find next/prev record that is editable.
58435852
const nextRowIndex = previous ? this.findPrevEditableDataRowIndex(currentRowIndex) :
5844-
this.dataView.findIndex((rec, index) =>
5845-
index > currentRowIndex && this.isEditableDataRecordAtIndex(index));
5846-
return nextRowIndex !== -1 ? nextRowIndex : currentRowIndex ;
5853+
this.dataView.findIndex((rec, index) =>
5854+
index > currentRowIndex && this.isEditableDataRecordAtIndex(index));
5855+
return nextRowIndex !== -1 ? nextRowIndex : currentRowIndex;
58475856
}
58485857

58495858
/**
@@ -5869,7 +5878,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
58695878
private isEditableDataRecordAtIndex(dataViewIndex) {
58705879
const rec = this.dataView[dataViewIndex];
58715880
return !rec.expression && !rec.summaries && !rec.childGridsData && !rec.detailsData &&
5872-
!this.isGhostRecordAtIndex(dataViewIndex);
5881+
!this.isGhostRecordAtIndex(dataViewIndex);
58735882
}
58745883

58755884
/**
@@ -6237,7 +6246,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
62376246
private configureRowEditingOverlay(rowID: any, useOuter = false) {
62386247
this.rowEditSettings.outlet = useOuter ? this.parentRowOutletDirective : this.rowOutletDirective;
62396248
this.rowEditPositioningStrategy.settings.container = this.tbody.nativeElement;
6240-
const pinned = this._pinnedRecordIDs.indexOf(rowID) !== -1;
6249+
const pinned = this._pinnedRecordIDs.indexOf(rowID) !== -1;
62416250
const targetRow = !pinned ? this.gridAPI.get_row_by_key(rowID) : this.pinnedRows.find(x => x.rowID === rowID);
62426251
if (!targetRow) {
62436252
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
@@ -173,7 +173,7 @@
173173
</div>
174174

175175
<ng-template #defaultPaginator>
176-
<igx-paginator [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords"
176+
<igx-paginator [overlaySettings]="paginatorSettings" [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords"
177177
[(perPage)]="perPage">
178178
</igx-paginator>
179179
</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)