From 2e4703f116f09dd35be716a8fed4a66e6a2ca429 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 6 Jan 2020 14:01:57 +0100 Subject: [PATCH] refactor(material): remove month constants from core In the past, we accidentally published the month constants in `@angular/material/core`. These were never intended for public consumption but were only needed for testing. In v7, we deprecated the constants (with the assumption that consumers might have used constants). Now, we can remove the constants. There is no replacement for these variables. Instead, use the zero-based month index on your own. BREAKING CHANGE: Deprecated month constants from `@angular/material/core` have been removed. These have been accidentally published in the past while they were only intended for internal consumption in tests. --- src/material/core/month-constants.ts | 16 --------------- src/material/core/public-api.ts | 3 --- tools/public_api_guard/material/core.d.ts | 24 ----------------------- 3 files changed, 43 deletions(-) delete mode 100644 src/material/core/month-constants.ts diff --git a/src/material/core/month-constants.ts b/src/material/core/month-constants.ts deleted file mode 100644 index b94e8045b513..000000000000 --- a/src/material/core/month-constants.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright Google LLC 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 - */ - -/** - * When constructing a Date, the month is zero-based. This can be confusing, since people are - * used to seeing them one-based. So we create these aliases to make writing the tests easier. - * @docs-private - * @breaking-change 8.0.0 Remove this with V8 since it was only targeted for testing. - */ -export const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, - OCT = 9, NOV = 10, DEC = 11; diff --git a/src/material/core/public-api.ts b/src/material/core/public-api.ts index 1dd2d4932163..832eb91e02da 100644 --- a/src/material/core/public-api.ts +++ b/src/material/core/public-api.ts @@ -16,6 +16,3 @@ export * from './option/index'; export * from './label/label-options'; export * from './ripple/index'; export * from './selection/index'; - -// TODO(devversion): remove this with v8 -export * from './month-constants'; diff --git a/tools/public_api_guard/material/core.d.ts b/tools/public_api_guard/material/core.d.ts index b483226d9c91..df8b05739012 100644 --- a/tools/public_api_guard/material/core.d.ts +++ b/tools/public_api_guard/material/core.d.ts @@ -55,10 +55,6 @@ export declare class AnimationDurations { static EXITING: string; } -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export interface CanColor { color: ThemePalette; defaultColor: ThemePalette | undefined; @@ -121,8 +117,6 @@ export declare abstract class DateAdapter { abstract today(): D; } -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export declare const defaultRippleAnimationConfig: { enterDuration: number; exitDuration: number; @@ -134,8 +128,6 @@ export declare class ErrorStateMatcher { static ɵprov: i0.ɵɵInjectableDef; } -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export declare type FloatLabelType = 'always' | 'never' | 'auto'; export interface GranularSanityChecks { @@ -159,18 +151,10 @@ export interface HasTabIndex { export declare type HasTabIndexCtor = Constructor; -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export interface LabelOptions { float?: FloatLabelType; } -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export declare const MAT_DATE_FORMATS: InjectionToken; export declare const MAT_DATE_LOCALE: InjectionToken; @@ -305,8 +289,6 @@ export declare class MatRippleModule { static ɵmod: i0.ɵɵNgModuleDefWithMeta; } -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export declare function mixinColor>(base: T, defaultColor?: ThemePalette): CanColorCtor & T; export declare function mixinDisabled>(base: T): CanDisableCtor & T; @@ -354,10 +336,6 @@ export declare class NativeDateModule { static ɵmod: i0.ɵɵNgModuleDefWithMeta; } -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export interface RippleAnimationConfig { enterDuration?: number; exitDuration?: number; @@ -414,8 +392,6 @@ export interface RippleTarget { export declare type SanityChecks = boolean | GranularSanityChecks; -export declare const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; - export declare function setLines(lines: QueryList, element: ElementRef, prefix?: string): void; export declare class ShowOnDirtyErrorStateMatcher implements ErrorStateMatcher {