mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore(cdk): create cdk/collections (#6208)
This commit is contained in:
+2
-1
@@ -49,7 +49,8 @@ src/lib/core/datetime/** @mmalerba
|
||||
# CDK
|
||||
src/cdk/coercion/** @jelbourn
|
||||
src/cdk/rxjs/** @jelbourn
|
||||
src/cdk/observers/** @crisbeto @jelbourn
|
||||
src/cdk/observers/** @jelbourn @crisbeto
|
||||
src/cdk/collections/** @jelbourn @crisbeto @andrewseguin
|
||||
src/cdk/a11y/** @jelbourn @devversion
|
||||
src/cdk/platform/** @jelbourn @devversion
|
||||
src/cdk/bidi/** @jelbourn
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Interface for any component that provides a view of some data collection and wants to provide
|
||||
* information regarding the view and any changes made.
|
||||
*/
|
||||
export interface CollectionViewer {
|
||||
viewChange: Observable<{start: number, end: number}>;
|
||||
}
|
||||
@@ -7,10 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
export interface CollectionViewer {
|
||||
viewChange: Observable<{start: number, end: number}>;
|
||||
}
|
||||
import {CollectionViewer} from './collection-viewer';
|
||||
|
||||
export abstract class DataSource<T> {
|
||||
/**
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './public_api';
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './collection-viewer';
|
||||
export * from './data-source';
|
||||
export * from './selection';
|
||||
@@ -8,10 +8,8 @@
|
||||
|
||||
import {Subject} from 'rxjs/Subject';
|
||||
|
||||
|
||||
/**
|
||||
* Class to be used to power selecting one or more options from a list.
|
||||
* @docs-private
|
||||
*/
|
||||
export class SelectionModel<T> {
|
||||
/** Currently-selected values. */
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../tsconfig-build",
|
||||
"files": [
|
||||
"public_api.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": true,
|
||||
"flatModuleOutFile": "index.js",
|
||||
"flatModuleId": "@angular/cdk/collections",
|
||||
"skipTemplateCodegen": true
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,13 @@ import {HeaderRowPlaceholder, RowPlaceholder, CdkTable} from './table';
|
||||
import {CdkCellOutlet, CdkHeaderRow, CdkHeaderRowDef, CdkRow, CdkRowDef} from './row';
|
||||
import {CdkColumnDef, CdkHeaderCellDef, CdkHeaderCell, CdkCell, CdkCellDef} from './cell';
|
||||
|
||||
export * from './data-source';
|
||||
export * from './table';
|
||||
export * from './cell';
|
||||
export * from './row';
|
||||
|
||||
/** Re-export DataSource for a more intuitive experience for users of just the table. */
|
||||
export {DataSource} from '@angular/cdk/collections';
|
||||
|
||||
const EXPORTED_DECLARATIONS = [
|
||||
CdkTable,
|
||||
CdkRowDef,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {CdkTable} from './table';
|
||||
import {CollectionViewer, DataSource} from './data-source';
|
||||
import {CollectionViewer, DataSource} from '@angular/cdk/collections';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {combineLatest} from 'rxjs/observable/combineLatest';
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
ViewContainerRef,
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
import {CollectionViewer, DataSource} from './data-source';
|
||||
import {CollectionViewer, DataSource} from '@angular/cdk/collections';
|
||||
import {CdkCellOutlet, CdkCellOutletRowContext, CdkHeaderRowDef, CdkRowDef} from './row';
|
||||
import {takeUntil} from 'rxjs/operator/takeUntil';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
|
||||
@@ -30,6 +30,7 @@ System.config({
|
||||
'@angular/cdk/a11y': 'dist/bundles/cdk-a11y.umd.js',
|
||||
'@angular/cdk/bidi': 'dist/bundles/cdk-bidi.umd.js',
|
||||
'@angular/cdk/coercion': 'dist/bundles/cdk-coercion.umd.js',
|
||||
'@angular/cdk/collections': 'dist/bundles/cdk-collections.umd.js',
|
||||
'@angular/cdk/keycodes': 'dist/bundles/cdk-keycodes.umd.js',
|
||||
'@angular/cdk/observers': 'dist/bundles/cdk-observers.umd.js',
|
||||
'@angular/cdk/overlay': 'dist/bundles/cdk-overlay.umd.js',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {MdPaginator, MdSort} from '@angular/material';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {PeopleDatabase, UserData} from './people-database';
|
||||
import 'rxjs/add/observable/merge';
|
||||
|
||||
@@ -30,6 +30,7 @@ System.config({
|
||||
'@angular/cdk/a11y': 'dist/bundles/cdk-a11y.umd.js',
|
||||
'@angular/cdk/bidi': 'dist/bundles/cdk-bidi.umd.js',
|
||||
'@angular/cdk/coercion': 'dist/bundles/cdk-coercion.umd.js',
|
||||
'@angular/cdk/collections': 'dist/bundles/cdk-collections.umd.js',
|
||||
'@angular/cdk/keycodes': 'dist/bundles/cdk-keycodes.umd.js',
|
||||
'@angular/cdk/observers': 'dist/bundles/cdk-observers.umd.js',
|
||||
'@angular/cdk/overlay': 'dist/bundles/cdk-overlay.umd.js',
|
||||
|
||||
@@ -14,7 +14,7 @@ import {OverlayModule} from '@angular/cdk/overlay';
|
||||
import {PortalModule} from '@angular/cdk/portal';
|
||||
import {MdLineModule} from './line/line';
|
||||
import {MdOptionModule} from './option/index';
|
||||
import {MdSelectionModule} from './selection/index';
|
||||
import {MdPseudoCheckboxModule} from './selection/index';
|
||||
import {MdRippleModule} from './ripple/index';
|
||||
|
||||
// Re-exports of the CDK to avoid breaking changes.
|
||||
@@ -28,6 +28,10 @@ export {
|
||||
ObserveContent,
|
||||
} from '@angular/cdk/observers';
|
||||
|
||||
export {
|
||||
SelectionModel
|
||||
} from '@angular/cdk/collections';
|
||||
|
||||
// RTL
|
||||
export {Dir, Direction, Directionality, BidiModule} from './bidi/index';
|
||||
|
||||
@@ -63,9 +67,6 @@ export {HammerInput, HammerManager} from './gestures/gesture-annotations';
|
||||
// Ripple
|
||||
export * from './ripple/index';
|
||||
|
||||
// Selection
|
||||
export * from './selection/selection';
|
||||
|
||||
// a11y
|
||||
export {
|
||||
AriaLivePoliteness,
|
||||
@@ -138,7 +139,7 @@ export {
|
||||
OverlayModule,
|
||||
A11yModule,
|
||||
MdOptionModule,
|
||||
MdSelectionModule,
|
||||
MdPseudoCheckboxModule,
|
||||
],
|
||||
exports: [
|
||||
MdLineModule,
|
||||
@@ -149,7 +150,7 @@ export {
|
||||
OverlayModule,
|
||||
A11yModule,
|
||||
MdOptionModule,
|
||||
MdSelectionModule,
|
||||
MdPseudoCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class MdCoreModule {}
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {MdRippleModule} from '../ripple/index';
|
||||
import {MdSelectionModule} from '../selection/index';
|
||||
import {MdPseudoCheckboxModule} from '../selection/index';
|
||||
import {MdOption} from './option';
|
||||
import {MdOptgroup} from './optgroup';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [MdRippleModule, CommonModule, MdSelectionModule],
|
||||
imports: [MdRippleModule, CommonModule, MdPseudoCheckboxModule],
|
||||
exports: [MdOption, MdOptgroup],
|
||||
declarations: [MdOption, MdOptgroup]
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@ import {MdPseudoCheckbox} from './pseudo-checkbox/pseudo-checkbox';
|
||||
exports: [MdPseudoCheckbox],
|
||||
declarations: [MdPseudoCheckbox]
|
||||
})
|
||||
export class MdSelectionModule { }
|
||||
export class MdPseudoCheckboxModule { }
|
||||
|
||||
|
||||
export * from './pseudo-checkbox/pseudo-checkbox';
|
||||
|
||||
+12
-13
@@ -7,24 +7,23 @@
|
||||
*/
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
import {MdLineModule, MdRippleModule, MdCommonModule, MdSelectionModule} from '../core';
|
||||
import {MdCommonModule, MdLineModule, MdPseudoCheckboxModule, MdRippleModule} from '../core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {
|
||||
MdList,
|
||||
MdListItem,
|
||||
MdListDivider,
|
||||
MdListAvatarCssMatStyler,
|
||||
MdListIconCssMatStyler,
|
||||
MdListCssMatStyler,
|
||||
MdNavListCssMatStyler,
|
||||
MdDividerCssMatStyler,
|
||||
MdListSubheaderCssMatStyler
|
||||
MdList,
|
||||
MdListAvatarCssMatStyler,
|
||||
MdListCssMatStyler,
|
||||
MdListDivider,
|
||||
MdListIconCssMatStyler,
|
||||
MdListItem,
|
||||
MdListSubheaderCssMatStyler,
|
||||
MdNavListCssMatStyler
|
||||
} from './list';
|
||||
import {MdSelectionList, MdListOption} from './selection-list';
|
||||
|
||||
import {MdListOption, MdSelectionList} from './selection-list';
|
||||
|
||||
@NgModule({
|
||||
imports: [MdLineModule, MdRippleModule, MdCommonModule, MdSelectionModule, CommonModule],
|
||||
imports: [MdLineModule, MdRippleModule, MdCommonModule, MdPseudoCheckboxModule, CommonModule],
|
||||
exports: [
|
||||
MdList,
|
||||
MdListItem,
|
||||
@@ -37,7 +36,7 @@ import {MdSelectionList, MdListOption} from './selection-list';
|
||||
MdNavListCssMatStyler,
|
||||
MdDividerCssMatStyler,
|
||||
MdListSubheaderCssMatStyler,
|
||||
MdSelectionModule,
|
||||
MdPseudoCheckboxModule,
|
||||
MdSelectionList,
|
||||
MdListOption
|
||||
],
|
||||
|
||||
@@ -51,7 +51,7 @@ import {merge} from 'rxjs/observable/merge';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
import {fadeInContent, transformPanel, transformPlaceholder} from './select-animations';
|
||||
import {SelectionModel} from '../core/selection/selection';
|
||||
import {SelectionModel} from '@angular/cdk/collections';
|
||||
import {
|
||||
getMdSelectDynamicMultipleError,
|
||||
getMdSelectNonArrayValueError,
|
||||
|
||||
@@ -2,7 +2,8 @@ import {async, ComponentFixture, TestBed, inject} from '@angular/core/testing';
|
||||
import {Component, ElementRef, ViewChild} from '@angular/core';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {MdSort, MdSortHeader, Sort, SortDirection, MdSortModule, MdSortHeaderIntl} from './index';
|
||||
import {CdkTableModule, DataSource, CollectionViewer} from '@angular/cdk/table';
|
||||
import {DataSource, CollectionViewer} from '@angular/cdk/collections';
|
||||
import {CdkTableModule} from '@angular/cdk/table';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {
|
||||
getMdSortDuplicateMdSortableIdError,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {MdTableModule} from './index';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/operator/startWith';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/of';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, ElementRef, ViewChild} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/operator/startWith';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {Http} from '@angular/http';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {MdPaginator, MdSort} from '@angular/material';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/merge';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {Component, ElementRef, ViewChild} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {MdPaginator, MdSort, SelectionModel} from '@angular/material';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {MdPaginator, MdSort} from '@angular/material';
|
||||
import {SelectionModel} from '@angular/cdk/collections';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/operator/startWith';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {MdPaginator} from '@angular/material';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {DataSource} from '@angular/cdk/table';
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import {MdSort} from '@angular/material';
|
||||
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
@@ -52,6 +52,7 @@ System.config({
|
||||
'@angular/cdk/a11y': 'dist/packages/cdk/a11y/index.js',
|
||||
'@angular/cdk/bidi': 'dist/packages/cdk/bidi/index.js',
|
||||
'@angular/cdk/coercion': 'dist/packages/cdk/coercion/index.js',
|
||||
'@angular/cdk/collections': 'dist/packages/cdk/collections/index.js',
|
||||
'@angular/cdk/keycodes': 'dist/packages/cdk/keycodes/index.js',
|
||||
'@angular/cdk/observers': 'dist/packages/cdk/observers/index.js',
|
||||
'@angular/cdk/overlay': 'dist/packages/cdk/overlay/index.js',
|
||||
|
||||
Reference in New Issue
Block a user