Skip to content

Commit

Permalink
feat(*): remove all deprecated props and methods related to pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
ddincheva committed Mar 30, 2023
1 parent 1196f93 commit d3ac733
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 248 deletions.
7 changes: 0 additions & 7 deletions projects/igniteui-angular/src/lib/grids/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ Below is the list of all inputs that the developers may set to configure the gri
|`autoGenerateExclude`|Array|A list of property keys to be excluded from the generated column collection, default is _[]_|
|`batchEditing`|boolean|Toggles batch editing in the grid, default is _false_|
|`moving`|boolean|Enables the columns moving feature. Defaults to _false_|
|`paging`|boolean|Enables the paging feature. Defaults to _false_.|
|`page`| number | The current page index.|
|`perPage`|number|Visible items per page, default is 15|
|`allowFiltering`| boolean | Enables quick filtering functionality in the grid. |
|`allowAdvancedFiltering`| boolean | Enables advanced filtering functionality in the grid. |
|`filterMode`| `FilterMode` | Determines the filter mode, default value is `quickFilter`.|
Expand Down Expand Up @@ -237,7 +234,6 @@ A list of the events emitted by the **igx-grid**:
|`columnInit`|Emitted when the grid columns are initialized. Returns the column object.|
|`sortingDone`|Emitted when sorting is performed through the UI. Returns the sorting expression.|
|`filteringDone`|Emitted when filtering is performed through the UI. Returns the filtering expressions tree of the column for which the filtering was performed.|
|`pagingDone`|Emitted when paging is performed. Returns an object consisting of the previous and the new page.|
|`rowAdded`|Emitted when a row is being added to the grid through the API. Returns the data for the new row object.|
|`rowDeleted`|Emitted when a row is deleted through the grid API. Returns the row object being removed.|
|`dataPreLoad`| Emitted when a new chunk of data is loaded from virtualization. |
Expand Down Expand Up @@ -287,9 +283,6 @@ Here is a list of all public methods exposed by **igx-grid**:
|`enableSummaries(expressions: Array)`|Enable summaries for the columns and apply your `customSummary` if it is provided.|
|`disableSummaries(fieldName: string)`|Disable summaries for the specified column.|
|`disableSummaries(columns: string[])`|Disable summaries for the listed columns.|
|`previousPage()`|Goes to the previous page if paging is enabled and the current page is not the first.|
|`nextPage()`|Goes to the next page if paging is enabled and current page is not the last.|
|`paginate(page: number)`|Goes to the specified page if paging is enabled. Page indices are 0 based.|
|`markForCheck()`|Manually triggers a change detection cycle for the grid and its children.|
|`pinColumn(name: string): boolean`|Pins a column by field name. Returns whether the operation is successful.|
|`unpinColumn(name: string): boolean`|Unpins a column by field name. Returns whether the operation is successful.|
Expand Down
240 changes: 5 additions & 235 deletions projects/igniteui-angular/src/lib/grids/grid-base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ import { IgxSnackbarComponent } from '../snackbar/snackbar.component';
import { v4 as uuidv4 } from 'uuid';
import { IgxActionStripComponent } from '../action-strip/action-strip.component';
import { IgxGridRowComponent } from './grid/grid-row.component';
import { IPageEventArgs } from '../paginator/paginator-interfaces';
import { IgxPaginatorComponent } from '../paginator/paginator.component';
import { IgxGridHeaderRowComponent } from './headers/grid-header-row.component';
import { IgxGridGroupByAreaComponent } from './grouping/grid-group-by-area.component';
Expand Down Expand Up @@ -375,45 +374,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
@Output()
public gridScroll = new EventEmitter<IGridScrollEventArgs>();

/**
* @deprecated in version 12.1.0. Use the corresponding output exposed by the `igx-paginator` component instead
*
* Emitted after the current page is changed.
*
*
* @example
* ```html
* <igx-grid (pageChange)="onPageChange($event)"></igx-grid>
* ```
* ```typescript
* public onPageChange(page: number) {
* this.currentPage = page;
* }
* ```
*/
@Output()
public pageChange = new EventEmitter<number>();

/**
* @deprecated in version 12.1.0. Use the corresponding output exposed by the `igx-paginator` component instead
*
* Emitted when `perPage` property value of the grid is changed.
*
*
* @example
* ```html
* <igx-grid #grid (perPageChange)="onPerPageChange($event)" [autoGenerate]="true"></igx-grid>
* ```
* ```typescript
* public onPerPageChange(perPage: number) {
* this.perPage = perPage;
* }
* ```
*/
@Output()
public perPageChange = new EventEmitter<number>();

/**
/**
* @deprecated in version 12.2.0. We suggest using `rowClasses` property instead
*
* Gets/Sets the styling classes applied to all even `IgxGridRowComponent`s in the grid.
Expand Down Expand Up @@ -808,21 +769,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
@Output()
public filteringDone = new EventEmitter<IFilteringExpressionsTree>();

/**
* @deprecated in version 12.1.0. Use the corresponding output exposed by the `igx-paginator` component instead
*
* Emitted after paging is performed.
*
*
* @remarks
* Returns an object consisting of the previous and next pages.
* @example
* ```html
* <igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true" (pagingDone)="pagingDone($event)"></igx-grid>
* ```
*/
@Output()
public pagingDone = new EventEmitter<IPageEventArgs>();

/**
* Emitted when a row is added.
Expand Down Expand Up @@ -1848,55 +1794,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this.notifyChanges(true);
}

/**
* @deprecated in version 12.1.0. Define `igx-paginator` as a grid child component and paging will be enabled, otherwise disabled.
*
* Gets/Sets whether the paging feature is enabled.
*
*
* @remarks
* The default state is disabled (false).
* @example
* ```html
* <!-- old -->
* <igx-grid #grid [data]="Data" [paging]="true" [autoGenerate]="true"></igx-grid>
*
* <!-- new -->
* <igx-grid #grid [data]="Data" [autoGenerate]="true">
* <igx-paginator></igx-paginator>
* </igx-grid>
* ```
*/
@Input()
public get paging(): boolean {
return this._paging;
}

public set paging(value: boolean) {
this._paging = value;
this.pipeTrigger++;
}

/**
* @deprecated in version 12.1.0. Use `page` property from `igx-paginator` component instance instead.
*
* Gets/Sets the current page index.
*
*
* @example
* ```html
* <!-- old -->
* <igx-grid #grid [data]="Data" [page]="model.page" [autoGenerate]="true"></igx-grid>
*
* <!-- new -->
* <igx-grid #grid [data]="Data" [autoGenerate]="true">
* <igx-paginator [(page)]="model.page"></igx-paginator>
* </igx-grid>
* ```
* @remarks
* Supports two-way binding.
*/
@Input()
/** @hidden @internal */
public get page(): number {
return this.paginator?.page || 0;
}
Expand All @@ -1907,32 +1805,12 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
}
}

/**
* @deprecated in version 12.1.0. Use `perPage` property from `igx-paginator` component instance instead
*
* Gets/Sets the number of visible items per page.
*
*
* @remarks
* The default is 15.
* @example
* ```html
* <!-- old -->
* <igx-grid #grid [data]="Data" [perPage]="model.perPage" [autoGenerate]="true"></igx-grid>
*
* <!-- new -->
* <igx-grid #grid [data]="Data" [autoGenerate]="true">
* <igx-paginator [(perPage)]="model.perPage"></igx-paginator>
* </igx-grid>
* ```
*/
@Input()
/** @hidden @internal */
public get perPage(): number {
return this.paginator?.perPage || DEFAULT_ITEMS_PER_PAGE;
}

public set perPage(val: number) {
this._perPage = val;
if (this.paginator) {
this.paginator.perPage = val;
}
Expand Down Expand Up @@ -3014,14 +2892,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
*/
public destroy$ = new Subject<any>();

/**
* @hidden
*/
protected _perPage = DEFAULT_ITEMS_PER_PAGE;
/**
* @hidden
*/
protected _paging = false;
/**
* @hidden
*/
Expand Down Expand Up @@ -3862,22 +3732,16 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
public setUpPaginator() {
if (this.paginator) {
this.paginator.pageChange.pipe(takeWhile(() => !!this.paginator), filter(() => !this._init))
.subscribe((page: number) => {
this.pageChange.emit(page);
});
this.paginator.pagingDone.pipe(takeWhile(() => !!this.paginator), filter(() => !this._init))
.subscribe((args: IPageEventArgs) => {
.subscribe(() => {
this.selectionService.clear(true);
this.pagingDone.emit({ previous: args.previous, current: args.current });
this.crudService.endEdit(false);
this.pipeTrigger++;
this.navigateTo(0);
this.notifyChanges();
});
this.paginator.perPageChange.pipe(takeWhile(() => !!this.paginator), filter(() => !this._init))
.subscribe((perPage: number) => {
.subscribe(() => {
this.selectionService.clear(true);
this.perPageChange.emit(perPage);
this.paginator.page = 0;
this.crudService.endEdit(false);
this.notifyChanges();
Expand Down Expand Up @@ -3987,7 +3851,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
// Keep the stream open for future subscribers
this.rendered$.pipe(takeUntil(this.destroy$)).subscribe(() => {
if (this.paginator) {
this.paginator.perPage = this._perPage !== DEFAULT_ITEMS_PER_PAGE ? this._perPage : this.paginator.perPage;
this.paginator.totalRecords = this.totalRecords ? this.totalRecords : this.paginator.totalRecords;
this.paginator.overlaySettings = { outlet: this.outlet };
}
Expand Down Expand Up @@ -4486,65 +4349,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
return this._visibleColumns;
}

/**
* @deprecated in version 12.1.0. Use the corresponding property exposed by the `igx-paginator`
*
* Gets the total number of pages.
*
*
* @example
* ```typescript
* const totalPages = this.grid.totalPages;
* ```
*/
public get totalPages(): number {
return this.paginator?.totalPages;
}

/**
* @deprecated in version 12.1.0. Use the corresponding property exposed by the `igx-paginator`
*
* Gets if the current page is the first page.
*
*
* @example
* ```typescript
* const firstPage = this.grid.isFirstPage;
* ```
*/
public get isFirstPage(): boolean {
return this.paginator.isLastPage;
}

/**
* @deprecated in version 12.1.0. Use the corresponding method `nextPage()` exposed by the `igx-paginator` instance.
*
* Goes to the next page, if the grid is not already at the last page.
*
*
* @example
* ```typescript
* this.grid1.nextPage();
* ```
*/
// eslint-disable-next-line @typescript-eslint/member-ordering
public nextPage(): void {
this.paginator?.nextPage();
}

/**
* @deprecated in version 12.1.0. Use the corresponding method `nextPage()` exposed by the `igx-paginator` instance.
*
* Goes to the previous page, if the grid is not already at the first page.
*
* @example
* ```
*/
// eslint-disable-next-line @typescript-eslint/member-ordering
public previousPage(): void {
this.paginator?.previousPage();
}

/**
* Returns the total number of records.
*
Expand All @@ -4571,21 +4375,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
}
}

/**
* @deprecated in version 12.1.0. Use the corresponding property exposed by the `igx-paginator`
*
* Returns if the current page is the last page.
*
*
* @example
* ```typescript
* const lastPage = this.grid.isLastPage;
* ```
*/
public get isLastPage(): boolean {
return this.paginator.isLastPage;
}

/**
* Returns the total width of the `IgxGridComponent`.
*
Expand Down Expand Up @@ -4713,25 +4502,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this._columnsReordered(column);
}

/**
* @deprecated in version 12.1.0. Use the corresponding method `paginate()` exposed by the `igx-paginator` instance.
*
* Goes to the desired page index.
*
*
* @example
* ```typescript
* // old
* this.grid1.paginate(1);
* // new
* this.paginator1.paginate(1);
* ```
* @param val
*/
public paginate(val: number): void {
this.paginator?.paginate(val);
}

/**
* Triggers change detection for the `IgxGridComponent`.
* Calling markForCheck also triggers the grid pipes explicitly, resulting in all updates being processed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,12 +1405,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
*/
public clearSearch() { }

/**
* @hidden @internal
*/
public paginate(_val: number): void {
}

/**
* @hidden @internal
*/
Expand Down

0 comments on commit d3ac733

Please sign in to comment.