mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore: move coercing to cdk package (#5025)
This commit is contained in:
committed by
Jeremy Elbourn
parent
fe3121024c
commit
17cc4a198f
+2
-1
@@ -1,7 +1,7 @@
|
||||
import {coerceBooleanProperty} from './boolean-property';
|
||||
|
||||
|
||||
describe('coerceBooleanProperty', () => {
|
||||
|
||||
it('should coerce undefined to false', () => {
|
||||
expect(coerceBooleanProperty(undefined)).toBe(false);
|
||||
});
|
||||
@@ -45,4 +45,5 @@ describe('coerceBooleanProperty', () => {
|
||||
it('should coerce an array to true', () => {
|
||||
expect(coerceBooleanProperty([])).toBe(true);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @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 './boolean-property';
|
||||
export * from './number-property';
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
import {coerceNumberProperty} from './number-property';
|
||||
|
||||
|
||||
describe('coerceNumberProperty', () => {
|
||||
|
||||
it('should coerce undefined to 0 or default', () => {
|
||||
expect(coerceNumberProperty(undefined)).toBe(0);
|
||||
expect(coerceNumberProperty(undefined, 111)).toBe(111);
|
||||
@@ -78,4 +78,5 @@ describe('coerceNumberProperty', () => {
|
||||
expect(coerceNumberProperty([])).toBe(0);
|
||||
expect(coerceNumberProperty([], 111)).toBe(111);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is not used to build this module. The real "index.js" file will be generated by the
|
||||
* Angular Compiler CLI. This file is used inside of Google and is also used to simplify the
|
||||
* SystemJS configuration
|
||||
*/
|
||||
export * from './public_api';
|
||||
@@ -6,4 +6,4 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export const __TEMP__ = -1;
|
||||
export * from './coercion/index';
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts"
|
||||
"**/*.spec.ts",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {FocusOrigin, FocusOriginMonitor, MdRipple, RippleRef} from '../core';
|
||||
import {mixinDisabled, CanDisable} from '../core/common-behaviors/disabled';
|
||||
import {CanColor, mixinColor} from '../core/common-behaviors/color';
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
|
||||
import {MdChip} from './chip';
|
||||
import {FocusKeyManager} from '../core/a11y/focus-key-manager';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {SPACE, LEFT_ARROW, RIGHT_ARROW, TAB} from '../core/keyboard/keycodes';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
import {Focusable} from '../core/a11y/focus-key-manager';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {CanColor, mixinColor} from '../core/common-behaviors/color';
|
||||
import {CanDisable, mixinDisabled} from '../core/common-behaviors/disabled';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import {InteractivityChecker} from './interactivity-checker';
|
||||
import {Platform} from '../platform/platform';
|
||||
import {coerceBooleanProperty} from '../coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
|
||||
import 'rxjs/add/operator/first';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {coerceBooleanProperty} from '../coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {Constructor} from './constructor';
|
||||
|
||||
/** @docs-private */
|
||||
|
||||
@@ -17,6 +17,8 @@ import {A11yModule} from './a11y/index';
|
||||
import {MdSelectionModule} from './selection/index';
|
||||
import {MdRippleModule} from './ripple/index';
|
||||
|
||||
// Re-exports of the CDK to avoid breaking changes.
|
||||
export {coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk';
|
||||
|
||||
// RTL
|
||||
export {Dir, Direction, Directionality, BidiModule} from './bidi/index';
|
||||
@@ -98,10 +100,6 @@ export * from './animation/animation';
|
||||
// Selection
|
||||
export * from './selection/index';
|
||||
|
||||
// Coercion
|
||||
export {coerceBooleanProperty} from './coercion/boolean-property';
|
||||
export {coerceNumberProperty} from './coercion/number-property';
|
||||
|
||||
// Compatibility
|
||||
export {CompatibilityModule, NoConflictStyleCompatibilityMode} from './compatibility/compatibility';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
Optional,
|
||||
} from '@angular/core';
|
||||
import {ENTER, SPACE} from '../keyboard/keycodes';
|
||||
import {coerceBooleanProperty} from '../coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {MATERIAL_COMPATIBILITY_MODE} from '../../core/compatibility/compatibility';
|
||||
import {MdOptgroup} from './optgroup';
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import {ConnectedPositionStrategy} from './position/connected-position-strategy'
|
||||
import {Directionality, Direction} from '../bidi/index';
|
||||
import {Scrollable} from './scroll/scrollable';
|
||||
import {ScrollStrategy} from './scroll/scroll-strategy';
|
||||
import {coerceBooleanProperty} from '../coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {ESCAPE} from '../keyboard/keycodes';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Directive, Input} from '@angular/core';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
|
||||
/** MdAccordion's display modes. */
|
||||
export type MdAccordionDisplayMode = 'default' | 'flat';
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/angular/material2#readme",
|
||||
"peerDependencies": {
|
||||
"@angular/cdk": "0.0.0-PLACEHOLDER",
|
||||
"@angular/core": "^4.0.0",
|
||||
"@angular/common": "^4.0.0"
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
FocusOriginMonitor,
|
||||
FocusOrigin,
|
||||
} from '../core';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {mixinDisabled, CanDisable} from '../core/common-behaviors/disabled';
|
||||
import {CanColor, mixinColor} from '../core/common-behaviors/color';
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
import {transformPlaceholder, transformPanel, fadeInContent} from './select-animations';
|
||||
import {ControlValueAccessor, NgControl} from '@angular/forms';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
import {ConnectedOverlayDirective} from '../core/overlay/overlay-directives';
|
||||
import {ViewportRuler} from '../core/overlay/position/viewport-ruler';
|
||||
import {SelectionModel} from '../core/selection/selection';
|
||||
|
||||
@@ -41,7 +41,7 @@ import {Directionality} from '../core/bidi/index';
|
||||
import {Platform} from '../core/platform/index';
|
||||
import 'rxjs/add/operator/first';
|
||||
import {ScrollDispatcher} from '../core/overlay/scroll/scroll-dispatcher';
|
||||
import {coerceBooleanProperty} from '../core/coercion/boolean-property';
|
||||
import {coerceBooleanProperty} from '@angular/cdk';
|
||||
|
||||
export type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after';
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts"
|
||||
"**/*.spec.ts",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ System.config({
|
||||
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
|
||||
// Path mappings for local packages that can be imported inside of tests.
|
||||
'@angular/material': 'dist/packages/material/index.js',
|
||||
// TODO(devversion): replace once the index.ts file for the Material package has been added.
|
||||
'@angular/material': 'dist/packages/material/public_api.js',
|
||||
'@angular/cdk': 'dist/packages/cdk/index.js',
|
||||
},
|
||||
packages: {
|
||||
|
||||
Reference in New Issue
Block a user