Skip to content

Commit 33cb26f

Browse files
committed
fix lint & build
1 parent d3aa780 commit 33cb26f

File tree

10 files changed

+86
-38
lines changed

10 files changed

+86
-38
lines changed

src/cdk/scrolling/BUILD.bazel

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
package(default_visibility=["//visibility:public"])
22
load("@angular//:index.bzl", "ng_module")
33
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
4+
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
45

56

67
ng_module(
78
name = "scrolling",
89
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
910
module_name = "@angular/cdk/scrolling",
11+
assets = [
12+
":virtual_scroll_viewport_css",
13+
],
1014
deps = [
15+
"//src/cdk/collections",
1116
"//src/cdk/platform",
1217
"@rxjs",
1318
],
@@ -28,9 +33,7 @@ ts_library(
2833

2934
ts_web_test(
3035
name = "unit_tests",
31-
bootstrap = [
32-
"//:web_test_bootstrap_scripts",
33-
],
36+
bootstrap = ["//:web_test_bootstrap_scripts"],
3437

3538
# Do not sort
3639
deps = [
@@ -41,3 +44,18 @@ ts_web_test(
4144
":scrolling_test_sources",
4245
],
4346
)
47+
48+
sass_binary(
49+
name = "virtual_scroll_viewport_scss",
50+
src = "virtual-scroll-viewport.scss",
51+
)
52+
53+
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
54+
# Copy the output of the sass_binary such that the filename and path match what we expect.
55+
genrule(
56+
name = "virtual_scroll_viewport_css",
57+
srcs = [":virtual_scroll_viewport_scss"],
58+
outs = ["virtual-scroll-viewport.css"],
59+
cmd = "cat $(locations :virtual_scroll_viewport_scss) > $@",
60+
)
61+

src/cdk/scrolling/tsconfig-build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../tsconfig-build",
33
"files": [
4-
"public-api.ts"
4+
"public-api.ts",
5+
"../typings.d.ts"
56
],
67
"angularCompilerOptions": {
78
"annotateForClosureCompiler": true,

src/cdk/scrolling/typings.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare var module: {id: string};

src/cdk/scrolling/virtual-for-of.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class CdkVirtualForOf<T> implements CollectionViewer, DoCheck, OnDestroy
245245
private _updateContext() {
246246
const count = this._data.length;
247247
let i = this._viewContainerRef.length;
248-
while(i--) {
248+
while (i--) {
249249
let view = this._viewContainerRef.get(i) as EmbeddedViewRef<CdkVirtualForOfContext<T>>;
250250
view.context.index = this._renderedRange.start + i;
251251
view.context.count = count;
@@ -289,7 +289,7 @@ export class CdkVirtualForOf<T> implements CollectionViewer, DoCheck, OnDestroy
289289
// We have nulled-out all of the views that were removed or moved from previousViews. What is
290290
// left is the unchanged items that we queue up to be re-inserted.
291291
i = previousViews.length;
292-
while(i--) {
292+
while (i--) {
293293
if (previousViews[i]) {
294294
insertTuples[i] = {record: null, view: previousViews[i]!};
295295
}

src/cdk/scrolling/virtual-scroll-fixed-size.ts

Lines changed: 9 additions & 1 deletion
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 {Range} from '@angular/cdk/collections';
210
import {Directive, forwardRef, Input, OnChanges} from '@angular/core';
311
import {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-strategy';
@@ -69,7 +77,7 @@ export class VirtualScrollFixedSizeStrategy implements VirtualScrollStrategy {
6977
}
7078

7179
this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);
72-
};
80+
}
7381

7482
/** Update the viewport's rendered range. */
7583
private _updateRenderedRange() {

src/cdk/scrolling/virtual-scroll-strategy.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 {CdkVirtualScrollViewport} from './virtual-scroll-viewport';
210
import {InjectionToken} from '@angular/core';
311

src/cdk/scrolling/virtual-scroll-viewport.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
*/
88

99
import {Range} from '@angular/cdk/collections';
10-
import {CdkVirtualForOf} from '@angular/cdk/scrolling/virtual-for-of';
1110
import {
1211
ChangeDetectionStrategy,
1312
ChangeDetectorRef,
1413
Component,
1514
DoCheck,
1615
ElementRef,
1716
Inject,
17+
Input,
1818
NgZone,
1919
OnDestroy,
2020
OnInit,
2121
ViewChild,
2222
ViewEncapsulation,
23-
Input,
2423
} from '@angular/core';
24+
import {Observable} from 'rxjs/Observable';
2525
import {fromEvent} from 'rxjs/observable/fromEvent';
2626
import {takeUntil} from 'rxjs/operators/takeUntil';
2727
import {Subject} from 'rxjs/Subject';
28-
import {Observable} from 'rxjs/Observable';
28+
import {CdkVirtualForOf} from './virtual-for-of';
2929
import {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-strategy';
3030

3131

@@ -130,7 +130,7 @@ export class CdkVirtualScrollViewport implements OnInit, DoCheck, OnDestroy {
130130
/** Sets the offset of the rendered portion of the data from the start (in pixels). */
131131
setRenderedContentOffset(offset: number) {
132132
const transform =
133-
this.orientation === 'horizontal' ? `translateX(${offset}px)`: `translateY(${offset}px)`;
133+
this.orientation === 'horizontal' ? `translateX(${offset}px)` : `translateY(${offset}px)`;
134134
if (this._renderedContentTransform != transform) {
135135
// Re-enter the Angular zone so we can mark for change detection.
136136
this._ngZone.run(() => {

src/demo-app/virtual-scroll/virtual-scroll-demo.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
}
1919

2020
.demo-item {
21+
-ms-writing-mode: tb-lr;
22+
-webkit-writing-mode: vertical-lr;
23+
/* stylelint-disable-next-line material/no-prefixes */
2124
writing-mode: vertical-lr;
2225
}
2326
}

src/demo-app/virtual-scroll/virtual-scroll-demo.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
import {Component, ViewEncapsulation} from '@angular/core';
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+
*/
28

9+
import {Component, ViewEncapsulation} from '@angular/core';
310

411
@Component({
512
moduleId: module.id,

tools/package-tools/rollup-globals.ts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,64 +26,66 @@ const rollupMatEntryPoints = matSecondaryEntryPoints.reduce((globals: any, entry
2626

2727
/** Map of globals that are used inside of the different packages. */
2828
export const rollupGlobals = {
29-
'tslib': 'tslib',
3029
'moment': 'moment',
30+
'tslib': 'tslib',
3131

3232
'@angular/animations': 'ng.animations',
33-
'@angular/core': 'ng.core',
3433
'@angular/common': 'ng.common',
35-
'@angular/forms': 'ng.forms',
3634
'@angular/common/http': 'ng.common.http',
37-
'@angular/router': 'ng.router',
35+
'@angular/common/http/testing': 'ng.common.http.testing',
36+
'@angular/common/testing': 'ng.common.testing',
37+
'@angular/core': 'ng.core',
38+
'@angular/core/testing': 'ng.core.testing',
39+
'@angular/forms': 'ng.forms',
3840
'@angular/platform-browser': 'ng.platformBrowser',
39-
'@angular/platform-server': 'ng.platformServer',
4041
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
4142
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
42-
'@angular/core/testing': 'ng.core.testing',
43-
'@angular/common/testing': 'ng.common.testing',
44-
'@angular/common/http/testing': 'ng.common.http.testing',
43+
'@angular/platform-server': 'ng.platformServer',
44+
'@angular/router': 'ng.router',
4545

4646
// Some packages are not really needed for the UMD bundles, but for the missingRollupGlobals rule.
47-
'@angular/material-examples': 'ng.materialExamples',
47+
'@angular/cdk': 'ng.cdk',
4848
'@angular/material': 'ng.material',
49+
'@angular/material-examples': 'ng.materialExamples',
4950
'@angular/material-moment-adapter': 'ng.materialMomentAdapter',
50-
'@angular/cdk': 'ng.cdk',
5151

5252
// Include secondary entry-points of the cdk and material packages
5353
...rollupCdkEntryPoints,
5454
...rollupMatEntryPoints,
5555

5656
'rxjs/BehaviorSubject': 'Rx',
5757
'rxjs/Observable': 'Rx',
58-
'rxjs/Subject': 'Rx',
59-
'rxjs/Subscription': 'Rx',
6058
'rxjs/Observer': 'Rx',
61-
'rxjs/Subscriber': 'Rx',
6259
'rxjs/Scheduler': 'Rx',
60+
'rxjs/Subject': 'Rx',
61+
'rxjs/Subscriber': 'Rx',
62+
'rxjs/Subscription': 'Rx',
6363

6464
'rxjs/observable/combineLatest': 'Rx.Observable',
65+
'rxjs/observable/defer': 'Rx.Observable',
66+
'rxjs/observable/empty': 'Rx.Observable',
6567
'rxjs/observable/forkJoin': 'Rx.Observable',
6668
'rxjs/observable/fromEvent': 'Rx.Observable',
69+
'rxjs/observable/fromEventPattern': 'Rx.Observable',
6770
'rxjs/observable/merge': 'Rx.Observable',
6871
'rxjs/observable/of': 'Rx.Observable',
6972
'rxjs/observable/throw': 'Rx.Observable',
70-
'rxjs/observable/defer': 'Rx.Observable',
71-
'rxjs/observable/fromEventPattern': 'Rx.Observable',
72-
'rxjs/observable/empty': 'Rx.Observable',
7373

74+
'rxjs/operators/auditTime': 'Rx.operators',
75+
'rxjs/operators/catchError': 'Rx.operators',
76+
'rxjs/operators/combineLatest': 'Rx.operators',
7477
'rxjs/operators/debounceTime': 'Rx.operators',
75-
'rxjs/operators/takeUntil': 'Rx.operators',
76-
'rxjs/operators/take': 'Rx.operators',
77-
'rxjs/operators/first': 'Rx.operators',
78+
'rxjs/operators/delay': 'Rx.operators',
7879
'rxjs/operators/filter': 'Rx.operators',
80+
'rxjs/operators/finalize': 'Rx.operators',
81+
'rxjs/operators/first': 'Rx.operators',
7982
'rxjs/operators/map': 'Rx.operators',
80-
'rxjs/operators/tap': 'Rx.operators',
83+
'rxjs/operators/pairwise': 'Rx.operators',
84+
'rxjs/operators/share': 'Rx.operators',
85+
'rxjs/operators/shareReplay': 'Rx.operators',
8186
'rxjs/operators/startWith': 'Rx.operators',
82-
'rxjs/operators/auditTime': 'Rx.operators',
8387
'rxjs/operators/switchMap': 'Rx.operators',
84-
'rxjs/operators/finalize': 'Rx.operators',
85-
'rxjs/operators/catchError': 'Rx.operators',
86-
'rxjs/operators/share': 'Rx.operators',
87-
'rxjs/operators/delay': 'Rx.operators',
88-
'rxjs/operators/combineLatest': 'Rx.operators',
88+
'rxjs/operators/take': 'Rx.operators',
89+
'rxjs/operators/takeUntil': 'Rx.operators',
90+
'rxjs/operators/tap': 'Rx.operators',
8991
};

0 commit comments

Comments
 (0)