Skip to content

Commit b2233a1

Browse files
committed
refactor(grids): lint errors updates#10506
1 parent e0203d4 commit b2233a1

14 files changed

+37
-42
lines changed

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
796796
public play() {
797797
if (!this.playing) {
798798
this.playing = true;
799-
this.onCarouselPlaying.emit(this);
799+
this.carouselPlaying.emit(this);
800800
this.restartInterval();
801801
this.stoppedByInteraction = false;
802802
}
@@ -815,7 +815,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
815815
public stop() {
816816
if (this.pause) {
817817
this.playing = false;
818-
this.onCarouselPaused.emit(this);
818+
this.carouselPaused.emit(this);
819819
this.resetInterval();
820820
}
821821
}
@@ -944,7 +944,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
944944
} else {
945945
this.currentItem = slide;
946946
}
947-
this.onSlideChanged.emit({ carousel: this, slide });
947+
this.slideChanged.emit({ carousel: this, slide });
948948
this.restartInterval();
949949
}
950950
}
@@ -967,7 +967,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
967967
diff.forEachAddedItem((record: IterableChangeRecord<IgxSlideComponent>) => {
968968
const slide = record.item;
969969
slide.total = this.total;
970-
this.onSlideAdded.emit({ carousel: this, slide });
970+
this.slideAdded.emit({ carousel: this, slide });
971971
if (slide.active) {
972972
this.currentItem = slide;
973973
}
@@ -976,7 +976,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
976976

977977
diff.forEachRemovedItem((record: IterableChangeRecord<IgxSlideComponent>) => {
978978
const slide = record.item;
979-
this.onSlideRemoved.emit({ carousel: this, slide });
979+
this.slideRemoved.emit({ carousel: this, slide });
980980
if (slide.active) {
981981
slide.active = false;
982982
this.currentItem = this.get(slide.index < this.total ? slide.index : this.total - 1);

projects/igniteui-angular/src/lib/core/displayDensity.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class DisplayDensityBase implements DoCheck, OnInit {
6666
newDensity: this._displayDensity
6767
};
6868

69-
this.onDensityChanged.emit(densityChangedArgs);
69+
this.densityChanged.emit(densityChangedArgs);
7070
}
7171
}
7272

@@ -98,7 +98,7 @@ export class DisplayDensityBase implements DoCheck, OnInit {
9898
newDensity: this.displayDensityOptions.displayDensity
9999
};
100100

101-
this.onDensityChanged.emit(densityChangedArgs);
101+
this.densityChanged.emit(densityChangedArgs);
102102
this.oldDisplayDensityOptions = Object.assign(this.oldDisplayDensityOptions, this.displayDensityOptions);
103103
}
104104
}

projects/igniteui-angular/src/lib/grids/common/crud.service.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,7 @@ export class IgxRowCrudState extends IgxCellCrudState {
359359

360360
this.grid.transactions.endPending(false);
361361

362-
const parentId = this.getParentRowId();
363-
this.grid.gridAPI.addRowToData(this.row.newData ?? this.row.data, parentId);
362+
this.grid.gridAPI.addRowToData(this.row.newData ?? this.row.data);
364363
this.grid.triggerPipes();
365364

366365
nonCancelableArgs = this.rowEditDone(null, event);

projects/igniteui-angular/src/lib/grids/filtering/excel-style/grid.excel-style-filtering.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
203203
this._filteringChanged = this.grid.filteringExpressionsTreeChange.pipe(takeUntil(this.destroy$)).subscribe(() => {
204204
this.init();
205205
});
206-
this._densityChanged = this.grid.onDensityChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
206+
this._densityChanged = this.grid.densityChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
207207
this.cdr.detectChanges();
208208
});
209209
this._columnMoved = this.grid.columnMovingEnd.pipe(takeUntil(this.destroy$)).subscribe(() => {

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -3339,7 +3339,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
33393339
this.calculateGridSizes(false);
33403340
});
33413341

3342-
this.onDensityChanged.pipe(destructor).subscribe(() => {
3342+
this.densityChanged.pipe(destructor).subscribe(() => {
33433343
this.crudService.endEdit(false);
33443344
this.summaryService.summaryHeight = 0;
33453345
this.notifyChanges(true);
@@ -5615,10 +5615,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
56155615
visibleColIndex = -1;
56165616
}
56175617
// If the target row is pinned no need to scroll as well.
5618-
const shouldScrollVertically = this.navigation.shouldPerformVerticalScroll(rowIndex, visibleColIndex);
5618+
const shouldScrollVertically = this.navigation.shouldPerformVerticalScroll(rowIndex);
56195619
const shouldScrollHorizontally = this.navigation.shouldPerformHorizontalScroll(visibleColIndex, rowIndex);
56205620
if (shouldScrollVertically) {
5621-
this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex, () => {
5621+
this.navigation.performVerticalScrollToCell(rowIndex, () => {
56225622
if (shouldScrollHorizontally) {
56235623
this.navigation.performHorizontalScrollToCell(visibleColIndex, () =>
56245624
this.executeCallback(rowIndex, visibleColIndex, cb));
@@ -5629,7 +5629,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
56295629
} else if (shouldScrollHorizontally) {
56305630
this.navigation.performHorizontalScrollToCell(visibleColIndex, () => {
56315631
if (shouldScrollVertically) {
5632-
this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex, () =>
5632+
this.navigation.performVerticalScrollToCell(rowIndex, () =>
56335633
this.executeCallback(rowIndex, visibleColIndex, cb));
56345634
} else {
56355635
this.executeCallback(rowIndex, visibleColIndex, cb);

projects/igniteui-angular/src/lib/grids/grid-mrl-navigation.service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export class IgxGridMRLNavigationService extends IgxGridNavigationService {
2121
}
2222

2323
public shouldPerformVerticalScroll(targetRowIndex: number, visibleColIndex: number): boolean {
24-
if (!super.shouldPerformVerticalScroll(targetRowIndex, visibleColIndex)) {
24+
if (!super.shouldPerformVerticalScroll(targetRowIndex)) {
2525
return false;
2626
}
2727
if (!this.isDataRow(targetRowIndex) || visibleColIndex < 0) {
28-
return super.shouldPerformVerticalScroll(targetRowIndex, visibleColIndex);
28+
return super.shouldPerformVerticalScroll(targetRowIndex);
2929
}
3030

3131
const targetRow = super.getRowElementByIndex(targetRowIndex);
@@ -79,7 +79,7 @@ export class IgxGridMRLNavigationService extends IgxGridNavigationService {
7979
public performVerticalScrollToCell(rowIndex: number, visibleColIndex: number, cb?: () => void) {
8080
const children = this.parentByChildIndex(visibleColIndex || 0)?.children;
8181
if (!super.isDataRow(rowIndex) || (children && children.length < 2) || visibleColIndex < 0) {
82-
return super.performVerticalScrollToCell(rowIndex, visibleColIndex, cb);
82+
return super.performVerticalScrollToCell(rowIndex, cb);
8383
}
8484

8585
const containerHeight = this.grid.calcHeight ? Math.ceil(this.grid.calcHeight) : 0;

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ export class IgxGridNavigationService {
209209
|| containerHeight && endTopOffset - containerHeight > 5;
210210
}
211211

212-
public performVerticalScrollToCell(rowIndex: number, visibleColIndex = -1, cb?: () => void) {
213-
if (!this.shouldPerformVerticalScroll(rowIndex, visibleColIndex)) {
212+
public performVerticalScrollToCell(rowIndex: number, cb?: () => void) {
213+
if (!this.shouldPerformVerticalScroll(rowIndex)) {
214214
return;
215215
}
216216
this.pendingNavigation = true;
@@ -685,7 +685,7 @@ export class IgxGridNavigationService {
685685
this.grid.visibleColumns.sort((c1, c2) => c1.visibleIndex - c2.visibleIndex)
686686
.find(c => this.isColumnFullyVisible(c.visibleIndex))?.visibleIndex;
687687
const column = this.grid.visibleColumns.find((col) => !col.columnLayout && col.visibleIndex === colIndex);
688-
const rowInd = rowIndex ? rowIndex : this.grid.rowList.find(r => !this.shouldPerformVerticalScroll(r.index, colIndex))?.index;
688+
const rowInd = rowIndex ? rowIndex : this.grid.rowList.find(r => !this.shouldPerformVerticalScroll(r.index))?.index;
689689
const node = { row: rowInd ?? 0,
690690
column: column?.visibleIndex ?? 0, level: column?.level ?? 0,
691691
mchCache: column ? {level: column.level, visibleIndex: column.visibleIndex} : {} as ColumnGroupsCache,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
400400
groupedColumns: groupedCols,
401401
ungroupedColumns: ungroupedCols
402402
};
403-
this.onGroupingDone.emit(groupingDoneArgs);
403+
this.groupingDone.emit(groupingDoneArgs);
404404
}
405405
}
406406

@@ -985,7 +985,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
985985
*/
986986
public ngOnInit() {
987987
super.ngOnInit();
988-
this.onGroupingDone.pipe(takeUntil(this.destroy$)).subscribe((args) => {
988+
this.groupingDone.pipe(takeUntil(this.destroy$)).subscribe((args) => {
989989
this.crudService.endEdit(false);
990990
this.summaryService.updateSummaryCache(args);
991991
this._headerFeaturesWidth = NaN;

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-navigation.service.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
9393
super.navigateInBody(rowIndex, visibleColIndex, cb);
9494
}
9595

96-
public shouldPerformVerticalScroll(index, visibleColumnIndex = -1, isNext?) {
96+
public shouldPerformVerticalScroll(index, isNext?) {
9797
const targetRec = this.grid.dataView[index];
9898
if (this.grid.isChildGridRecord(targetRec)) {
9999
const scrollAmount = this.grid.verticalScrollContainer.getScrollForIndex(index, !isNext);
100100
const currScroll = this.grid.verticalScrollContainer.getScroll().scrollTop;
101101
const shouldScroll = !isNext ? scrollAmount > currScroll : currScroll < scrollAmount;
102102
return shouldScroll;
103103
} else {
104-
return super.shouldPerformVerticalScroll(index, visibleColumnIndex);
104+
return super.shouldPerformVerticalScroll(index);
105105
}
106106
}
107107

@@ -141,9 +141,9 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
141141
* @param cb Optional.Callback function called when operation is complete.
142142
*/
143143
protected _handleScrollInChild(rowIndex: number, isNext?: boolean, cb?: () => void) {
144-
const shouldScroll = this.shouldPerformVerticalScroll(rowIndex, -1, isNext);
144+
const shouldScroll = this.shouldPerformVerticalScroll(rowIndex, isNext);
145145
if (shouldScroll) {
146-
this.grid.navigation.performVerticalScrollToCell(rowIndex, -1, () => {
146+
this.grid.navigation.performVerticalScrollToCell(rowIndex, () => {
147147
this.positionInParent(rowIndex, isNext, cb);
148148
});
149149
} else {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
416416

417417
if (this.parent) {
418418
this._displayDensity = this.rootGrid._displayDensity;
419-
this.rootGrid.onDensityChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
419+
this.rootGrid.densityChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
420420
this._displayDensity = this.rootGrid._displayDensity;
421421
this.notifyChanges(true);
422422
this.cdr.markForCheck();

projects/igniteui-angular/src/lib/grids/summaries/grid-summary.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ export class IgxNumberSummaryOperand extends IgxSummaryOperand {
169169
*
170170
* @memberof IgxNumberSummaryOperand
171171
*/
172-
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
173-
const result = super.operate(data, allData, fieldName);
172+
public operate(data: any[] = []): IgxSummaryResult[] {
173+
const result = super.operate(data);
174174
result.push({
175175
key: 'min',
176176
label: 'Min',
@@ -257,8 +257,8 @@ export class IgxDateSummaryOperand extends IgxSummaryOperand {
257257
*
258258
* @memberof IgxDateSummaryOperand
259259
*/
260-
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
261-
const result = super.operate(data, allData, fieldName);
260+
public operate(data: any[] = []): IgxSummaryResult[] {
261+
const result = super.operate(data);
262262
result.push({
263263
key: 'earliest',
264264
label: 'Earliest',
@@ -310,8 +310,8 @@ export class IgxTimeSummaryOperand extends IgxSummaryOperand {
310310
/**
311311
* @memberof IgxTimeSummaryOperand
312312
*/
313-
public operate(data: any[] = [], allData: any[] = [], fieldName?: string): IgxSummaryResult[] {
314-
const result = super.operate(data, allData, fieldName);
313+
public operate(data: any[] = []): IgxSummaryResult[] {
314+
const result = super.operate(data);
315315
result.push({
316316
key: 'earliest',
317317
label: 'Earliest',

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,9 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
595595
* @memberof IgxTreeGridComponent
596596
*/
597597
// TODO: remove evt emission
598-
public addRow(data: any, parentRowID?: any) {
598+
public addRow(data: any) {
599599
this.crudService.endEdit(true);
600-
this.gridAPI.addRowToData(data, parentRowID);
600+
this.gridAPI.addRowToData(data);
601601

602602
this.rowAddedNotifier.next({ data });
603603
this.pipeTrigger++;

projects/igniteui-angular/src/lib/services/excel/excel-files.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,8 @@ export class WorksheetFile implements IExcelFile {
385385
* @hidden
386386
*/
387387
export class StyleFile implements IExcelFile {
388-
public writeElement(folder: JSZip, worksheetData: WorksheetData) {
389-
const hasNumberValues = worksheetData.dataDictionary && worksheetData.dataDictionary.hasNumberValues;
390-
const hasDateValues = worksheetData.dataDictionary && worksheetData.dataDictionary.hasDateValues;
391-
const isHierarchicalGrid = worksheetData.data[0]?.type === ExportRecordType.HierarchicalGridRecord;
392-
393-
folder.file('styles.xml', ExcelStrings.getStyles(hasNumberValues, hasDateValues, isHierarchicalGrid));
388+
public writeElement(folder: JSZip) {
389+
folder.file('styles.xml', ExcelStrings.getStyles());
394390
}
395391
}
396392

projects/igniteui-angular/src/lib/tree/tree.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export class IgxTreeComponent extends DisplayDensityBase implements IgxTree, OnI
385385
this.expandToNode(this.navService.activeNode);
386386
this.scrollNodeIntoView(node?.header?.nativeElement);
387387
});
388-
this.onDensityChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
388+
this.densityChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
389389
requestAnimationFrame(() => {
390390
this.scrollNodeIntoView(this.navService.activeNode?.header.nativeElement);
391391
});

0 commit comments

Comments
 (0)