From 243a2f2d1df8007aa88d418f1b19ab95da2efd91 Mon Sep 17 00:00:00 2001 From: katherinedragieva Date: Thu, 7 Oct 2021 11:53:27 +0300 Subject: [PATCH 1/3] refactor(GridCellAPISampleComponent): fix dependencies warnings --- .../src/lib/carousel/carousel.component.ts | 16 ++++++++-------- src/app/grid-cell-api/grid-cell-api.sample.ts | 2 -- src/app/grid-row-api/grid-row-api.sample.ts | 4 +--- .../tree-grid-groupby.sample.ts | 2 +- src/app/tree/tree.sample.ts | 8 ++------ 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/projects/igniteui-angular/src/lib/carousel/carousel.component.ts b/projects/igniteui-angular/src/lib/carousel/carousel.component.ts index 1f1912c7677..3e0f9316d0e 100644 --- a/projects/igniteui-angular/src/lib/carousel/carousel.component.ts +++ b/projects/igniteui-angular/src/lib/carousel/carousel.component.ts @@ -317,7 +317,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public onSlideChanged = new EventEmitter(); + @Output() public SlideChanged = new EventEmitter(); /** * An event that is emitted after a slide has been added to the carousel. @@ -328,7 +328,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public onSlideAdded = new EventEmitter(); + @Output() public SlideAdded = new EventEmitter(); /** * An event that is emitted after a slide has been removed from the carousel. @@ -339,7 +339,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public onSlideRemoved = new EventEmitter(); + @Output() public SlideRemoved = new EventEmitter(); /** * An event that is emitted after the carousel has been paused. @@ -350,7 +350,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public onCarouselPaused = new EventEmitter(); + @Output() public CarouselPaused = new EventEmitter(); /** * An event that is emitted after the carousel has resumed transitioning between `slides`. @@ -815,7 +815,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On public stop() { if (this.pause) { this.playing = false; - this.onCarouselPaused.emit(this); + this.CarouselPaused.emit(this); this.resetInterval(); } } @@ -944,7 +944,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On } else { this.currentItem = slide; } - this.onSlideChanged.emit({ carousel: this, slide }); + this.SlideChanged.emit({ carousel: this, slide }); this.restartInterval(); } } @@ -967,7 +967,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On diff.forEachAddedItem((record: IterableChangeRecord) => { const slide = record.item; slide.total = this.total; - this.onSlideAdded.emit({ carousel: this, slide }); + this.SlideAdded.emit({ carousel: this, slide }); if (slide.active) { this.currentItem = slide; } @@ -976,7 +976,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On diff.forEachRemovedItem((record: IterableChangeRecord) => { const slide = record.item; - this.onSlideRemoved.emit({ carousel: this, slide }); + this.SlideRemoved.emit({ carousel: this, slide }); if (slide.active) { slide.active = false; this.currentItem = this.get(slide.index < this.total ? slide.index : this.total - 1); diff --git a/src/app/grid-cell-api/grid-cell-api.sample.ts b/src/app/grid-cell-api/grid-cell-api.sample.ts index dd779c71e7b..8120a1c190a 100644 --- a/src/app/grid-cell-api/grid-cell-api.sample.ts +++ b/src/app/grid-cell-api/grid-cell-api.sample.ts @@ -4,8 +4,6 @@ import { IgxTreeGridComponent, IgxHierarchicalGridComponent, CellType, - IgxGridTransaction, - IgxTransactionService } from 'igniteui-angular'; import { HIERARCHICAL_SAMPLE_DATA } from '../shared/sample-data'; diff --git a/src/app/grid-row-api/grid-row-api.sample.ts b/src/app/grid-row-api/grid-row-api.sample.ts index 5db1ab23d86..4f472e427ab 100644 --- a/src/app/grid-row-api/grid-row-api.sample.ts +++ b/src/app/grid-row-api/grid-row-api.sample.ts @@ -179,7 +179,6 @@ export class GridRowAPISampleComponent implements OnInit { public togglePinning(grid: IgxGridComponent | IgxTreeGridComponent | IgxHierarchicalGridComponent, byIndex: boolean, index: number, key: any) { const row: RowType = byIndex ? grid.getRowByIndex(index) : grid.getRowByKey(key); - const index2: number = row.index; if (row.pinned) { row.unpin(); } else { @@ -308,11 +307,10 @@ export class GridRowAPISampleComponent implements OnInit { } } - public onEnter(args) { + public onEnter() { this.dragIcon = 'add'; } public onRowDragStart(args: IRowDragStartEventArgs) { - const row = args.dragData; const count = this.grid.selectedRows.length || 1; this.countIcon = `filter_${count > 9 ? '9_plus' : `${count}`}`; } diff --git a/src/app/tree-grid-groupby/tree-grid-groupby.sample.ts b/src/app/tree-grid-groupby/tree-grid-groupby.sample.ts index ee2d9e9fa8a..e0c84c53120 100644 --- a/src/app/tree-grid-groupby/tree-grid-groupby.sample.ts +++ b/src/app/tree-grid-groupby/tree-grid-groupby.sample.ts @@ -59,7 +59,7 @@ export class TreeGridGroupBySampleComponent implements OnInit { this.density = this.displayDensities[event.index].label; } - public cellEditDone(event: any) { + public cellEditDone() { this.groupingExpressions = [...this.groupingExpressions]; // will trigger grouping pipe } } diff --git a/src/app/tree/tree.sample.ts b/src/app/tree/tree.sample.ts index 12130a78cf4..042e35cc0df 100644 --- a/src/app/tree/tree.sample.ts +++ b/src/app/tree/tree.sample.ts @@ -188,18 +188,14 @@ export class TreeSampleComponent implements AfterViewInit, OnDestroy { public ngAfterViewInit() { this.tree.nodes.toArray().forEach(node => { - node.selectedChange.subscribe((ev) => { - // console.log(ev); - }); + node.selectedChange.subscribe(() => { }); }); } public ngOnDestroy() { } - public toggleSelectionMode(args) { - // this.tree.selection = this.selectionModes[args.index].selectMode; - } + public toggleSelectionMode() { } public changeDensity(args) { this.density = this.displayDensities[args.index].selectMode; From c6de3bf5294c72515d70e0b7ca2008c5b1606112 Mon Sep 17 00:00:00 2001 From: katherinedragieva Date: Thu, 7 Oct 2021 14:26:48 +0300 Subject: [PATCH 2/3] refactor(GridRowAPISampleComponent): remove trailing spaces --- .../src/lib/carousel/carousel.component.ts | 16 ++++++++-------- src/app/grid-row-api/grid-row-api.sample.ts | 1 + src/app/tree/tree.sample.ts | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/projects/igniteui-angular/src/lib/carousel/carousel.component.ts b/projects/igniteui-angular/src/lib/carousel/carousel.component.ts index 3e0f9316d0e..1f1912c7677 100644 --- a/projects/igniteui-angular/src/lib/carousel/carousel.component.ts +++ b/projects/igniteui-angular/src/lib/carousel/carousel.component.ts @@ -317,7 +317,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public SlideChanged = new EventEmitter(); + @Output() public onSlideChanged = new EventEmitter(); /** * An event that is emitted after a slide has been added to the carousel. @@ -328,7 +328,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public SlideAdded = new EventEmitter(); + @Output() public onSlideAdded = new EventEmitter(); /** * An event that is emitted after a slide has been removed from the carousel. @@ -339,7 +339,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public SlideRemoved = new EventEmitter(); + @Output() public onSlideRemoved = new EventEmitter(); /** * An event that is emitted after the carousel has been paused. @@ -350,7 +350,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On * * @memberOf IgxCarouselComponent */ - @Output() public CarouselPaused = new EventEmitter(); + @Output() public onCarouselPaused = new EventEmitter(); /** * An event that is emitted after the carousel has resumed transitioning between `slides`. @@ -815,7 +815,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On public stop() { if (this.pause) { this.playing = false; - this.CarouselPaused.emit(this); + this.onCarouselPaused.emit(this); this.resetInterval(); } } @@ -944,7 +944,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On } else { this.currentItem = slide; } - this.SlideChanged.emit({ carousel: this, slide }); + this.onSlideChanged.emit({ carousel: this, slide }); this.restartInterval(); } } @@ -967,7 +967,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On diff.forEachAddedItem((record: IterableChangeRecord) => { const slide = record.item; slide.total = this.total; - this.SlideAdded.emit({ carousel: this, slide }); + this.onSlideAdded.emit({ carousel: this, slide }); if (slide.active) { this.currentItem = slide; } @@ -976,7 +976,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On diff.forEachRemovedItem((record: IterableChangeRecord) => { const slide = record.item; - this.SlideRemoved.emit({ carousel: this, slide }); + this.onSlideRemoved.emit({ carousel: this, slide }); if (slide.active) { slide.active = false; this.currentItem = this.get(slide.index < this.total ? slide.index : this.total - 1); diff --git a/src/app/grid-row-api/grid-row-api.sample.ts b/src/app/grid-row-api/grid-row-api.sample.ts index 4f472e427ab..88c41228588 100644 --- a/src/app/grid-row-api/grid-row-api.sample.ts +++ b/src/app/grid-row-api/grid-row-api.sample.ts @@ -313,6 +313,7 @@ export class GridRowAPISampleComponent implements OnInit { public onRowDragStart(args: IRowDragStartEventArgs) { const count = this.grid.selectedRows.length || 1; this.countIcon = `filter_${count > 9 ? '9_plus' : `${count}`}`; + return args; } public onLeave(args) { this.onRowDragStart(args); diff --git a/src/app/tree/tree.sample.ts b/src/app/tree/tree.sample.ts index 042e35cc0df..6de7c7cce31 100644 --- a/src/app/tree/tree.sample.ts +++ b/src/app/tree/tree.sample.ts @@ -188,7 +188,7 @@ export class TreeSampleComponent implements AfterViewInit, OnDestroy { public ngAfterViewInit() { this.tree.nodes.toArray().forEach(node => { - node.selectedChange.subscribe(() => { }); + node.selectedChange.subscribe(() => {}); }); } From 5ff75caee9a2764adc572fdc947f27a755490e15 Mon Sep 17 00:00:00 2001 From: katherinedragieva Date: Thu, 7 Oct 2021 15:12:16 +0300 Subject: [PATCH 3/3] =?UTF-8?q?refactor(GridRowAPISampleComponent):=20remo?= =?UTF-8?q?ve=C2=A0unused=C2=A0arguments=C2=A0from=C2=A0methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/grid-row-api/grid-row-api.sample.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/grid-row-api/grid-row-api.sample.ts b/src/app/grid-row-api/grid-row-api.sample.ts index 88c41228588..1e99244d6a3 100644 --- a/src/app/grid-row-api/grid-row-api.sample.ts +++ b/src/app/grid-row-api/grid-row-api.sample.ts @@ -6,7 +6,6 @@ import { IgxHierarchicalGridComponent, IPinningConfig, RowPinningPosition, - IRowDragStartEventArgs, GridSummaryCalculationMode, GridSummaryPosition } from 'igniteui-angular'; @@ -310,13 +309,12 @@ export class GridRowAPISampleComponent implements OnInit { public onEnter() { this.dragIcon = 'add'; } - public onRowDragStart(args: IRowDragStartEventArgs) { + public onRowDragStart() { const count = this.grid.selectedRows.length || 1; this.countIcon = `filter_${count > 9 ? '9_plus' : `${count}`}`; - return args; } - public onLeave(args) { - this.onRowDragStart(args); + public onLeave() { + this.onRowDragStart(); this.dragIcon = 'arrow_right_alt'; } }