Skip to content

Commit 90867d3

Browse files
committed
chore: move virtual-scroll to cdk-experimental (#9974)
1 parent 8634551 commit 90867d3

19 files changed

+104
-38
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
# CDK experimental package
8484
/src/cdk-experimental/** @jelbourn
8585
/src/cdk-experimental/dialog/** @jelbourn @josephperrott @crisbeto
86+
/src/cdk-experimental/scrolling/** @mmalerba
8687

8788
# Docs examples & guides
8889
/guides/** @amcdnl @jelbourn

src/cdk-experimental/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
*/
88

99
export * from './public-api';
10+
export * from './scrolling/index';
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@angular//:index.bzl", "ng_module")
3+
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
4+
5+
6+
ng_module(
7+
name = "scrolling",
8+
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
9+
module_name = "@angular/cdk-experimental/scrolling",
10+
assets = [
11+
":virtual_scroll_viewport_css",
12+
],
13+
deps = [
14+
"//src/cdk/collections",
15+
"@rxjs",
16+
],
17+
tsconfig = ":tsconfig-build.json",
18+
)
19+
20+
sass_binary(
21+
name = "virtual_scroll_viewport_scss",
22+
src = "virtual-scroll-viewport.scss",
23+
)
24+
25+
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
26+
# Copy the output of the sass_binary such that the filename and path match what we expect.
27+
genrule(
28+
name = "virtual_scroll_viewport_css",
29+
srcs = [":virtual_scroll_viewport_scss"],
30+
outs = ["virtual-scroll-viewport.css"],
31+
cmd = "cat $(locations :virtual_scroll_viewport_scss) > $@",
32+
)
33+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
9+
export * from './public-api';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
9+
export * from './scrolling-module';
10+
export * from './virtual-for-of';
11+
export * from './virtual-scroll-fixed-size';
12+
export * from './virtual-scroll-strategy';
13+
export * from './virtual-scroll-viewport';
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
9+
import {NgModule} from '@angular/core';
10+
import {CdkVirtualForOf} from './virtual-for-of';
11+
import {CdkVirtualScrollFixedSize} from './virtual-scroll-fixed-size';
12+
import {CdkVirtualScrollViewport} from './virtual-scroll-viewport';
13+
14+
15+
@NgModule({
16+
exports: [
17+
CdkVirtualForOf,
18+
CdkVirtualScrollFixedSize,
19+
CdkVirtualScrollViewport,
20+
],
21+
declarations: [
22+
CdkVirtualForOf,
23+
CdkVirtualScrollFixedSize,
24+
CdkVirtualScrollViewport,
25+
],
26+
})
27+
export class ScrollingModule {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "../tsconfig-build",
3+
"files": [
4+
"public-api.ts",
5+
"../typings.d.ts"
6+
],
7+
"angularCompilerOptions": {
8+
"annotateForClosureCompiler": true,
9+
"strictMetadataEmit": true,
10+
"flatModuleOutFile": "index.js",
11+
"flatModuleId": "@angular/cdk-experimental/scrolling",
12+
"skipTemplateCodegen": true,
13+
"fullTemplateTypeCheck": true
14+
}
15+
}

src/cdk/scrolling/BUILD.bazel

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
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")
54

65

76
ng_module(
87
name = "scrolling",
98
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
109
module_name = "@angular/cdk/scrolling",
11-
assets = [
12-
":virtual_scroll_viewport_css",
13-
],
1410
deps = [
1511
"//src/cdk/collections",
1612
"//src/cdk/platform",
@@ -44,18 +40,3 @@ ts_web_test(
4440
":scrolling_test_sources",
4541
],
4642
)
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/public-api.ts

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

9-
export * from './virtual-for-of';
109
export * from './scroll-dispatcher';
1110
export * from './scrollable';
1211
export * from './scrolling-module';
1312
export * from './viewport-ruler';
14-
export * from './virtual-scroll-viewport';

src/cdk/scrolling/scrolling-module.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,13 @@
88

99
import {PlatformModule} from '@angular/cdk/platform';
1010
import {NgModule} from '@angular/core';
11-
import {CdkVirtualForOf} from './virtual-for-of';
1211
import {SCROLL_DISPATCHER_PROVIDER} from './scroll-dispatcher';
1312
import {CdkScrollable} from './scrollable';
14-
import {CdkVirtualScrollFixedSize} from './virtual-scroll-fixed-size';
15-
import {CdkVirtualScrollViewport} from './virtual-scroll-viewport';
1613

1714
@NgModule({
1815
imports: [PlatformModule],
19-
exports: [
20-
CdkVirtualForOf,
21-
CdkScrollable,
22-
CdkVirtualScrollFixedSize,
23-
CdkVirtualScrollViewport,
24-
],
25-
declarations: [
26-
CdkVirtualForOf,
27-
CdkScrollable,
28-
CdkVirtualScrollFixedSize,
29-
CdkVirtualScrollViewport,
30-
],
16+
exports: [CdkScrollable],
17+
declarations: [CdkScrollable],
3118
providers: [SCROLL_DISPATCHER_PROVIDER],
3219
})
3320
export class ScrollDispatchModule {}

src/cdk/scrolling/tsconfig-build.json

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

src/demo-app/demo-material-module.ts

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

9+
import {ScrollingModule} from '@angular/cdk-experimental';
910
import {A11yModule} from '@angular/cdk/a11y';
1011
import {CdkAccordionModule} from '@angular/cdk/accordion';
1112
import {BidiModule} from '@angular/cdk/bidi';
@@ -105,6 +106,7 @@ import {
105106
OverlayModule,
106107
PlatformModule,
107108
PortalModule,
109+
ScrollingModule,
108110
]
109111
})
110112
export class DemoMaterialModule {}

0 commit comments

Comments
 (0)