diff --git a/src/material/datepicker/date-selection-model.ts b/src/material/datepicker/date-selection-model.ts index 1c5e45ce3f57..4b4937b7fa42 100644 --- a/src/material/datepicker/date-selection-model.ts +++ b/src/material/datepicker/date-selection-model.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {FactoryProvider, Injectable, Optional, SkipSelf, OnDestroy, Directive} from '@angular/core'; +import {FactoryProvider, Injectable, Optional, SkipSelf, OnDestroy} from '@angular/core'; import {DateAdapter} from '@angular/material/core'; import {Observable, Subject} from 'rxjs'; @@ -32,7 +32,10 @@ export class DateRange { */ export type ExtractDateTypeFromSelection = T extends DateRange ? D : NonNullable; -/** Event emitted by the date selection model when its selection changes. */ +/** + * Event emitted by the date selection model when its selection changes. + * @docs-private + */ export interface DateSelectionModelChange { /** New value for the selection. */ selection: S; @@ -41,8 +44,11 @@ export interface DateSelectionModelChange { source: unknown; } -/** A selection model containing a date selection. */ -@Directive() +/** + * A selection model containing a date selection. + * @docs-private + */ +@Injectable() export abstract class MatDateSelectionModel> implements OnDestroy { private _selectionChanged = new Subject>(); @@ -88,7 +94,10 @@ export abstract class MatDateSelectionModel; } -/** A selection model that contains a single date. */ +/** + * A selection model that contains a single date. + * @docs-private + */ @Injectable() export class MatSingleDateSelectionModel extends MatDateSelectionModel { constructor(adapter: DateAdapter) { @@ -124,7 +133,10 @@ export class MatSingleDateSelectionModel extends MatDateSelectionModel extends MatDateSelectionModel, D> { constructor(adapter: DateAdapter) { @@ -193,7 +205,10 @@ export function MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY( return parent || new MatSingleDateSelectionModel(adapter); } -/** Used to provide a single selection model to a component. */ +/** + * Used to provide a single selection model to a component. + * @docs-private + */ export const MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER: FactoryProvider = { provide: MatDateSelectionModel, deps: [[new Optional(), new SkipSelf(), MatDateSelectionModel], DateAdapter], @@ -207,7 +222,10 @@ export function MAT_RANGE_DATE_SELECTION_MODEL_FACTORY( return parent || new MatRangeDateSelectionModel(adapter); } -/** Used to provide a range selection model to a component. */ +/** + * Used to provide a range selection model to a component. + * @docs-private + */ export const MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER: FactoryProvider = { provide: MatDateSelectionModel, deps: [[new Optional(), new SkipSelf(), MatDateSelectionModel], DateAdapter], diff --git a/tools/public_api_guard/material/datepicker.d.ts b/tools/public_api_guard/material/datepicker.d.ts index 2c6ed8e51450..f6d59fcdc3e3 100644 --- a/tools/public_api_guard/material/datepicker.d.ts +++ b/tools/public_api_guard/material/datepicker.d.ts @@ -394,8 +394,8 @@ export declare abstract class MatDateSelectionModel, never, never, {}, {}, never>; static ɵfac: i0.ɵɵFactoryDef, never>; + static ɵprov: i0.ɵɵInjectableDef>; } export declare class MatEndDate extends _MatDateRangeInputBase implements CanUpdateErrorState, DoCheck, OnInit {