Skip to content

Commit c90ca55

Browse files
andrewseguinkara
authored andcommitted
chore(cdk): create cdk/collections (#6208)
1 parent 2fc6a4c commit c90ca55

29 files changed

+95
-42
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ src/lib/core/datetime/** @mmalerba
4949
# CDK
5050
src/cdk/coercion/** @jelbourn
5151
src/cdk/rxjs/** @jelbourn
52-
src/cdk/observers/** @crisbeto @jelbourn
52+
src/cdk/observers/** @jelbourn @crisbeto
53+
src/cdk/collections/** @jelbourn @crisbeto @andrewseguin
5354
src/cdk/a11y/** @jelbourn @devversion
5455
src/cdk/platform/** @jelbourn @devversion
5556
src/cdk/bidi/** @jelbourn
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. 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 {Observable} from 'rxjs/Observable';
10+
11+
/**
12+
* Interface for any component that provides a view of some data collection and wants to provide
13+
* information regarding the view and any changes made.
14+
*/
15+
export interface CollectionViewer {
16+
viewChange: Observable<{start: number, end: number}>;
17+
}

src/cdk/table/data-source.ts renamed to src/cdk/collections/data-source.ts

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

99
import {Observable} from 'rxjs/Observable';
10-
11-
export interface CollectionViewer {
12-
viewChange: Observable<{start: number, end: number}>;
13-
}
10+
import {CollectionViewer} from './collection-viewer';
1411

1512
export abstract class DataSource<T> {
1613
/**

src/cdk/collections/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. 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';

src/cdk/collections/public_api.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. 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 './collection-viewer';
10+
export * from './data-source';
11+
export * from './selection';

src/lib/core/selection/selection.ts renamed to src/cdk/collections/selection.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88

99
import {Subject} from 'rxjs/Subject';
1010

11-
1211
/**
1312
* Class to be used to power selecting one or more options from a list.
14-
* @docs-private
1513
*/
1614
export class SelectionModel<T> {
1715
/** Currently-selected values. */
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig-build",
3+
"files": [
4+
"public_api.ts"
5+
],
6+
"angularCompilerOptions": {
7+
"annotateForClosureCompiler": true,
8+
"strictMetadataEmit": true,
9+
"flatModuleOutFile": "index.js",
10+
"flatModuleId": "@angular/cdk/collections",
11+
"skipTemplateCodegen": true
12+
}
13+
}

src/cdk/table/public_api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import {HeaderRowPlaceholder, RowPlaceholder, CdkTable} from './table';
1212
import {CdkCellOutlet, CdkHeaderRow, CdkHeaderRowDef, CdkRow, CdkRowDef} from './row';
1313
import {CdkColumnDef, CdkHeaderCellDef, CdkHeaderCell, CdkCell, CdkCellDef} from './cell';
1414

15-
export * from './data-source';
1615
export * from './table';
1716
export * from './cell';
1817
export * from './row';
1918

19+
/** Re-export DataSource for a more intuitive experience for users of just the table. */
20+
export {DataSource} from '@angular/cdk/collections';
21+
2022
const EXPORTED_DECLARATIONS = [
2123
CdkTable,
2224
CdkRowDef,

src/cdk/table/table.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22
import {Component, ViewChild} from '@angular/core';
33
import {CdkTable} from './table';
4-
import {CollectionViewer, DataSource} from './data-source';
4+
import {CollectionViewer, DataSource} from '@angular/cdk/collections';
55
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
66
import {Observable} from 'rxjs/Observable';
77
import {combineLatest} from 'rxjs/observable/combineLatest';

0 commit comments

Comments
 (0)