Skip to content

Commit 356eaf4

Browse files
committed
lint and ivy fixes
1 parent 5fe6291 commit 356eaf4

File tree

9 files changed

+118
-28
lines changed

9 files changed

+118
-28
lines changed

src/cdk-experimental/column-resize/column-resize-directives/column-resize-flex.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {Directive, ElementRef, NgZone} from '@angular/core';
210
import {Directionality} from '@angular/cdk/bidi';
311

src/cdk-experimental/column-resize/column-resize-directives/column-resize.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {Directive, ElementRef, NgZone} from '@angular/core';
210
import {Directionality} from '@angular/cdk/bidi';
311

src/cdk-experimental/column-resize/column-resize-directives/constants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {ColumnResizeNotifier, ColumnResizeNotifierSource} from '../column-resize-notifier';
210
import {HeaderRowEventDispatcher} from '../event-dispatcher';
311
import {

src/cdk-experimental/column-resize/column-resize-directives/default-enabled-column-resize-flex.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {Directive, ElementRef, NgZone} from '@angular/core';
210
import {Directionality} from '@angular/cdk/bidi';
311

src/cdk-experimental/column-resize/column-resize-directives/default-enabled-column-resize.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {Directive, ElementRef, NgZone} from '@angular/core';
210
import {Directionality} from '@angular/cdk/bidi';
311

src/cdk-experimental/column-resize/column-resize-module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ import {NgModule} from '@angular/core';
1010

1111
import {CdkColumnResize} from './column-resize-directives/column-resize';
1212
import {CdkColumnResizeFlex} from './column-resize-directives/column-resize-flex';
13-
import {CdkDefaultEnabledColumnResize} from './column-resize-directives/default-enabled-column-resize';
14-
import {CdkDefaultEnabledColumnResizeFlex} from './column-resize-directives/default-enabled-column-resize-flex';
13+
import {
14+
CdkDefaultEnabledColumnResize
15+
} from './column-resize-directives/default-enabled-column-resize';
16+
import {
17+
CdkDefaultEnabledColumnResizeFlex
18+
} from './column-resize-directives/default-enabled-column-resize-flex';
1519

1620
@NgModule({
1721
declarations: [CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex],

src/cdk-experimental/column-resize/overlay-handle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export abstract class ResizeOverlayHandle implements AfterViewInit, OnDestroy {
6464
map(event => event.relatedTarget &&
6565
closest(event.relatedTarget as Element, HEADER_CELL_SELECTOR)),
6666
).subscribe(cell => this.eventDispatcher.headerCellHovered.next(cell));
67-
67+
6868
fromEvent<MouseEvent>(this.elementRef.nativeElement!, 'mousedown')
6969
.pipe(takeUntilDestroyed).subscribe(mousedownEvent => {
7070
this._dragStarted(mousedownEvent);
@@ -190,7 +190,7 @@ export abstract class ResizeOverlayHandle implements AfterViewInit, OnDestroy {
190190
this.updateResizeActive(false);
191191

192192
this.ngZone.run(() => {
193-
const sizeMessage = {columnId: this.columnDef.name, size}
193+
const sizeMessage = {columnId: this.columnDef.name, size};
194194
if (completedSuccessfully) {
195195
this.resizeNotifier.resizeCompleted.next(sizeMessage);
196196
} else {

src/cdk-experimental/column-resize/resizable.ts

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
import {
1010
AfterViewInit,
1111
ElementRef,
12-
Inject,
1312
Injector,
1413
NgZone,
1514
OnDestroy,
1615
Type,
17-
ViewContainerRef
16+
ViewContainerRef,
1817
} from '@angular/core';
19-
import {DOCUMENT} from '@angular/common';
2018
import {ComponentPortal, PortalInjector} from '@angular/cdk/portal';
2119
import {Overlay, OverlayRef} from '@angular/cdk/overlay';
2220
import {CdkColumnDef} from '@angular/cdk/table';
@@ -41,7 +39,18 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
4139
protected inlineHandle?: HTMLElement;
4240
protected overlayRef?: OverlayRef;
4341
protected readonly destroyed = new ReplaySubject<void>();
44-
protected readonly document: Document;
42+
43+
protected abstract readonly columnDef: CdkColumnDef;
44+
protected abstract readonly columnResize: ColumnResize;
45+
protected abstract readonly document: Document;
46+
protected abstract readonly elementRef: ElementRef;
47+
protected abstract readonly eventDispatcher: HeaderRowEventDispatcher;
48+
protected abstract readonly injector: Injector;
49+
protected abstract readonly ngZone: NgZone;
50+
protected abstract readonly overlay: Overlay;
51+
protected abstract readonly resizeNotifier: ColumnResizeNotifierSource;
52+
protected abstract readonly resizeStrategy: ResizeStrategy;
53+
protected abstract readonly viewContainerRef: ViewContainerRef;
4554

4655
get minWidthPx(): number {
4756
return this.minWidthPxInternal;
@@ -65,21 +74,6 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
6574
}
6675
}
6776

68-
constructor(
69-
protected readonly columnDef: CdkColumnDef,
70-
protected readonly columnResize: ColumnResize,
71-
@Inject(DOCUMENT) document: any,
72-
protected readonly elementRef: ElementRef,
73-
protected readonly eventDispatcher: HeaderRowEventDispatcher,
74-
protected readonly injector: Injector,
75-
protected readonly ngZone: NgZone,
76-
protected readonly overlay: Overlay,
77-
protected readonly resizeNotifier: ColumnResizeNotifierSource,
78-
protected readonly resizeStrategy: ResizeStrategy,
79-
protected readonly viewContainerRef: ViewContainerRef) {
80-
this.document = document;
81-
}
82-
8377
ngAfterViewInit() {
8478
this._listenForRowHoverEvents();
8579
this._listenForResizeEvents();
@@ -187,9 +181,10 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
187181
}
188182

189183
private _createHandlePortal(): ComponentPortal<HandleComponent> {
190-
const injector = new PortalInjector(this.injector, new WeakMap([
191-
[ResizeRef, new ResizeRef(this.elementRef, this.overlayRef!, this.minWidthPx, this.maxWidthPx)]
192-
]));
184+
const injector = new PortalInjector(this.injector, new WeakMap([[
185+
ResizeRef,
186+
new ResizeRef(this.elementRef, this.overlayRef!, this.minWidthPx, this.maxWidthPx),
187+
]]));
193188
return new ComponentPortal(this.getOverlayHandleComponentType(),
194189
this.viewContainerRef, injector);
195190
}

src/material-experimental/column-resize/resizable.ts

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,25 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Directive, Type} from '@angular/core';
10-
import {Resizable} from '@angular/cdk-experimental/column-resize';
9+
import {
10+
Directive,
11+
ElementRef,
12+
Inject,
13+
Injector,
14+
NgZone,
15+
Type,
16+
ViewContainerRef,
17+
} from '@angular/core';
18+
import {DOCUMENT} from '@angular/common';
19+
import {Overlay} from '@angular/cdk/overlay';
20+
import {CdkColumnDef} from '@angular/cdk/table';
21+
import {
22+
ColumnResize,
23+
ColumnResizeNotifierSource,
24+
HeaderRowEventDispatcher,
25+
Resizable,
26+
ResizeStrategy,
27+
} from '@angular/cdk-experimental/column-resize';
1128

1229
import {MatColumnResizeOverlayHandle} from './overlay-handle';
1330

@@ -38,6 +55,23 @@ const RESIZABLE_INPUTS = [
3855
inputs: RESIZABLE_INPUTS,
3956
})
4057
export class MatDefaultResizable extends AbstractMatResizable {
58+
protected readonly document: Document;
59+
60+
constructor(
61+
protected readonly columnDef: CdkColumnDef,
62+
protected readonly columnResize: ColumnResize,
63+
@Inject(DOCUMENT) document: any,
64+
protected readonly elementRef: ElementRef,
65+
protected readonly eventDispatcher: HeaderRowEventDispatcher,
66+
protected readonly injector: Injector,
67+
protected readonly ngZone: NgZone,
68+
protected readonly overlay: Overlay,
69+
protected readonly resizeNotifier: ColumnResizeNotifierSource,
70+
protected readonly resizeStrategy: ResizeStrategy,
71+
protected readonly viewContainerRef: ViewContainerRef) {
72+
super();
73+
this.document = document;
74+
}
4175
}
4276

4377
@Directive({
@@ -46,4 +80,21 @@ export class MatDefaultResizable extends AbstractMatResizable {
4680
inputs: RESIZABLE_INPUTS,
4781
})
4882
export class MatResizable extends AbstractMatResizable {
83+
protected readonly document: Document;
84+
85+
constructor(
86+
protected readonly columnDef: CdkColumnDef,
87+
protected readonly columnResize: ColumnResize,
88+
@Inject(DOCUMENT) document: any,
89+
protected readonly elementRef: ElementRef,
90+
protected readonly eventDispatcher: HeaderRowEventDispatcher,
91+
protected readonly injector: Injector,
92+
protected readonly ngZone: NgZone,
93+
protected readonly overlay: Overlay,
94+
protected readonly resizeNotifier: ColumnResizeNotifierSource,
95+
protected readonly resizeStrategy: ResizeStrategy,
96+
protected readonly viewContainerRef: ViewContainerRef) {
97+
super();
98+
this.document = document;
99+
}
49100
}

0 commit comments

Comments
 (0)