Skip to content

Commit 81fad37

Browse files
authored
Merge pull request #8976 from IgniteUI/enrich-deprecation-msgs-m
handle deprecation messages for paging
2 parents 9d2eb00 + b75a8ba commit 81fad37

File tree

1 file changed

+49
-20
lines changed

1 file changed

+49
-20
lines changed

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

+49-20
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ const MIN_ROW_EDITING_COUNT_THRESHOLD = 2;
168168

169169
export const IgxGridTransaction = new InjectionToken<string>('IgxGridTransaction');
170170

171+
171172
@Directive()
172173
export abstract class IgxGridBaseDirective extends DisplayDensityBase implements GridType,
173174
OnInit, DoCheck, OnDestroy, AfterContentInit, AfterViewInit {
@@ -289,10 +290,13 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
289290
@Output()
290291
public onScroll = new EventEmitter<IGridScrollEventArgs>();
291292

293+
/* eslint-disable max-len */
292294
/**
293-
* @deprecated Use `IgxPaginator` corresponding output instead.
294295
* Emitted after the current page is changed.
295296
*
297+
* @deprecated `pageChange` is deprecated. Use the `pageChange` output exposed by the `IgxPaginator`.
298+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
299+
*
296300
* @example
297301
* ```html
298302
* <igx-grid (pageChange)="onPageChange($event)"></igx-grid>
@@ -303,14 +307,16 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
303307
* }
304308
* ```
305309
*/
306-
@DeprecateProperty('Use the corresponding output exposed by the `igx-paginator`.')
310+
@DeprecateProperty('`pageChange` is deprecated. Use the `pageChange` output exposed by the `IgxPaginator`.')
307311
@Output()
308312
public pageChange = new EventEmitter<number>();
309313

310314
/**
311-
* @deprecated Use `IgxPaginator` corresponding output instead.
312315
* Emitted when `perPage` property value of the grid is changed.
313316
*
317+
* @deprecated `perPageChange` is deprecated. Use the `perPageChange` output exposed by the `IgxPaginator`.
318+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
319+
*
314320
* @example
315321
* ```html
316322
* <igx-grid #grid (perPageChange)="onPerPageChange($event)" [autoGenerate]="true"></igx-grid>
@@ -321,9 +327,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
321327
* }
322328
* ```
323329
*/
324-
@DeprecateProperty('Use the corresponding output exposed by the `igx-paginator`.')
330+
@DeprecateProperty('`perPageChange` is deprecated. Use the `perPageChange` output exposed by the `IgxPaginator`.')
325331
@Output()
326332
public perPageChange = new EventEmitter<number>();
333+
/* eslint-enable max-len */
327334

328335
/**
329336
* Gets/Sets a custom `ng-template` for the pagination UI of the grid.
@@ -1421,18 +1428,21 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
14211428
this.notifyChanges(true);
14221429
}
14231430

1431+
/* eslint-disable max-len */
14241432
/**
1425-
* @deprecated Use `IgxPaginator` corresponding method instead.
14261433
* Gets/Sets the current page index.
14271434
*
1435+
* @deprecated `page` is deprecated. Use the `page` input exposed by the `IgxPaginator`.
1436+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
1437+
*
14281438
* @example
14291439
* ```html
14301440
* <igx-grid #grid [data]="Data" [paging]="true" [(page)]="model.page" [autoGenerate]="true"></igx-grid>
14311441
* ```
14321442
* @remarks
14331443
* Supports two-way binding.
14341444
*/
1435-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
1445+
@DeprecateProperty('`page` is deprecated. Use the `page` input exposed by the `IgxPaginator`.')
14361446
@Input()
14371447
public get page(): number {
14381448
return this._page;
@@ -1450,17 +1460,20 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
14501460
}
14511461

14521462
/**
1453-
* @deprecated Use `IgxPaginator` corresponding method instead.
14541463
* Gets/Sets the number of visible items per page.
14551464
*
1465+
* @deprecated `perPage` is deprecated. Use the `perPage` input exposed by the `IgxPaginator`.
1466+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
1467+
*
14561468
* @remarks
14571469
* The default is 15.
14581470
* @example
14591471
* ```html
14601472
* <igx-grid #grid [data]="Data" [paging]="true" [(perPage)]="model.perPage" [autoGenerate]="true"></igx-grid>
14611473
* ```
14621474
*/
1463-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
1475+
/* eslint-enable max-len */
1476+
@DeprecateProperty('`perPage` is deprecated. Use the `perPage` input exposed by the `IgxPaginator`.')
14641477
@Input()
14651478
public get perPage(): number {
14661479
return this._perPage;
@@ -3089,17 +3102,20 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
30893102
this.cdr.detach();
30903103
}
30913104

3105+
/* eslint-disable max-len */
30923106
/**
3093-
* @deprecated Use `IgxPaginator` corresponding method instead.
30943107
* Goes to the desired page index.
30953108
*
3109+
* @deprecated `paginate` is deprecated. Use the `paginate` method exposed by the `IgxPaginator`.
3110+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
3111+
*
30963112
* @example
30973113
* ```typescript
30983114
* this.grid1.paginate(1);
30993115
* ```
31003116
* @param val
31013117
*/
3102-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
3118+
@DeprecateProperty('`paginate` is deprecated. Use the `paginate` method exposed by the `IgxPaginator`.')
31033119
public paginate(val: number): void {
31043120
if (val < 0 || val > this.totalPages - 1) {
31053121
return;
@@ -3109,31 +3125,36 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
31093125
}
31103126

31113127
/**
3112-
* @deprecated Use `IgxPaginator` corresponding method instead.
31133128
* Goes to the next page, if the grid is not already at the last page.
31143129
*
3130+
* @deprecated `nextPage` is deprecated. Use the `nextPage` method exposed by the `IgxPaginator`.
3131+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
3132+
*
31153133
* @example
31163134
* ```typescript
31173135
* this.grid1.nextPage();
31183136
* ```
31193137
*/
3120-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
3138+
@DeprecateProperty('`nextPage` is deprecated. Use the `nextPage` method exposed by the `IgxPaginator`.')
31213139
public nextPage(): void {
31223140
if (!this.isLastPage) {
31233141
this.page += 1;
31243142
}
31253143
}
31263144

31273145
/**
3128-
* @deprecated Use `IgxPaginator` corresponding method instead.
31293146
* Goes to the previous page, if the grid is not already at the first page.
31303147
*
3148+
* @deprecated `previousPage` is deprecated. Use the `previousPage` method exposed by the `IgxPaginator`.
3149+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
3150+
*
31313151
* @example
31323152
* ```typescript
31333153
* this.grid1.previousPage();
31343154
* ```
31353155
*/
3136-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
3156+
/* eslint-enable max-len */
3157+
@DeprecateProperty('`previousPage` is deprecated. Use the `previousPage` method exposed by the `IgxPaginator`.')
31373158
public previousPage(): void {
31383159
if (!this.isFirstPage) {
31393160
this.page -= 1;
@@ -4170,16 +4191,19 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
41704191
return this.gridAPI.get_cell_by_key(rowSelector, columnField);
41714192
}
41724193

4194+
/* eslint-disable max-len */
41734195
/**
4174-
* @deprecated Use `IgxPaginator` corresponding method instead.
41754196
* Gets the total number of pages.
41764197
*
4198+
* @deprecated `totalPages` is deprecated. Use the `totalPages` getter exposed by the `IgxPaginator`.
4199+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
4200+
*
41774201
* @example
41784202
* ```typescript
41794203
* const totalPages = this.grid.totalPages;
41804204
* ```
41814205
*/
4182-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
4206+
@DeprecateProperty('`totalPages` is deprecated. Use the `totalPages` getter exposed by the `IgxPaginator`.')
41834207
public get totalPages(): number {
41844208
if (this.pagingState) {
41854209
return this.pagingState.metadata.countPages;
@@ -4188,15 +4212,17 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
41884212
}
41894213

41904214
/**
4191-
* @deprecated Use `IgxPaginator` corresponding method instead.
41924215
* Gets if the current page is the first page.
41934216
*
4217+
* @deprecated `isFirstPage` is deprecated. Use the `isFirstPage` getter exposed by the `IgxPaginator`.
4218+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
4219+
*
41944220
* @example
41954221
* ```typescript
41964222
* const firstPage = this.grid.isFirstPage;
41974223
* ```
41984224
*/
4199-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
4225+
@DeprecateProperty('`isFirstPage` is deprecated. Use the `isFirstPage` getter exposed by the `IgxPaginator`.')
42004226
public get isFirstPage(): boolean {
42014227
return this.page === 0;
42024228
}
@@ -4225,15 +4251,18 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
42254251
}
42264252

42274253
/**
4228-
* @deprecated Use `IgxPaginator` corresponding method instead.
42294254
* Returns if the current page is the last page.
42304255
*
4256+
* @deprecated `isLastPage` is deprecated. Use the `isLastPage` output exposed by the `IgxPaginator`.
4257+
* See [Paging with custom template](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations#remote-paging-with-custom-template) for more info.
4258+
*
42314259
* @example
42324260
* ```typescript
42334261
* const lastPage = this.grid.isLastPage;
42344262
* ```
42354263
*/
4236-
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
4264+
/* eslint-enable max-len */
4265+
@DeprecateProperty('`isLastPage` is deprecated. Use the `isLastPage` getter exposed by the `IgxPaginator`.')
42374266
public get isLastPage(): boolean {
42384267
return this.page + 1 >= this.totalPages;
42394268
}

0 commit comments

Comments
 (0)