6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { FactoryProvider , Injectable , Optional , SkipSelf , OnDestroy , Directive } from '@angular/core' ;
9
+ import { FactoryProvider , Injectable , Optional , SkipSelf , OnDestroy } from '@angular/core' ;
10
10
import { DateAdapter } from '@angular/material/core' ;
11
11
import { Observable , Subject } from 'rxjs' ;
12
12
@@ -32,7 +32,10 @@ export class DateRange<D> {
32
32
*/
33
33
export type ExtractDateTypeFromSelection < T > = T extends DateRange < infer D > ? D : NonNullable < T > ;
34
34
35
- /** Event emitted by the date selection model when its selection changes. */
35
+ /**
36
+ * Event emitted by the date selection model when its selection changes.
37
+ * @docs -private
38
+ */
36
39
export interface DateSelectionModelChange < S > {
37
40
/** New value for the selection. */
38
41
selection : S ;
@@ -41,8 +44,11 @@ export interface DateSelectionModelChange<S> {
41
44
source : unknown ;
42
45
}
43
46
44
- /** A selection model containing a date selection. */
45
- @Directive ( )
47
+ /**
48
+ * A selection model containing a date selection.
49
+ * @docs -private
50
+ */
51
+ @Injectable ( )
46
52
export abstract class MatDateSelectionModel < S , D = ExtractDateTypeFromSelection < S > >
47
53
implements OnDestroy {
48
54
private _selectionChanged = new Subject < DateSelectionModelChange < S > > ( ) ;
@@ -88,7 +94,10 @@ export abstract class MatDateSelectionModel<S, D = ExtractDateTypeFromSelection<
88
94
abstract clone ( ) : MatDateSelectionModel < S , D > ;
89
95
}
90
96
91
- /** A selection model that contains a single date. */
97
+ /**
98
+ * A selection model that contains a single date.
99
+ * @docs -private
100
+ */
92
101
@Injectable ( )
93
102
export class MatSingleDateSelectionModel < D > extends MatDateSelectionModel < D | null , D > {
94
103
constructor ( adapter : DateAdapter < D > ) {
@@ -124,7 +133,10 @@ export class MatSingleDateSelectionModel<D> extends MatDateSelectionModel<D | nu
124
133
}
125
134
}
126
135
127
- /** A selection model that contains a date range. */
136
+ /**
137
+ * A selection model that contains a date range.
138
+ * @docs -private
139
+ */
128
140
@Injectable ( )
129
141
export class MatRangeDateSelectionModel < D > extends MatDateSelectionModel < DateRange < D > , D > {
130
142
constructor ( adapter : DateAdapter < D > ) {
@@ -193,7 +205,10 @@ export function MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY(
193
205
return parent || new MatSingleDateSelectionModel ( adapter ) ;
194
206
}
195
207
196
- /** Used to provide a single selection model to a component. */
208
+ /**
209
+ * Used to provide a single selection model to a component.
210
+ * @docs -private
211
+ */
197
212
export const MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER : FactoryProvider = {
198
213
provide : MatDateSelectionModel ,
199
214
deps : [ [ new Optional ( ) , new SkipSelf ( ) , MatDateSelectionModel ] , DateAdapter ] ,
@@ -207,7 +222,10 @@ export function MAT_RANGE_DATE_SELECTION_MODEL_FACTORY(
207
222
return parent || new MatRangeDateSelectionModel ( adapter ) ;
208
223
}
209
224
210
- /** Used to provide a range selection model to a component. */
225
+ /**
226
+ * Used to provide a range selection model to a component.
227
+ * @docs -private
228
+ */
211
229
export const MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER : FactoryProvider = {
212
230
provide : MatDateSelectionModel ,
213
231
deps : [ [ new Optional ( ) , new SkipSelf ( ) , MatDateSelectionModel ] , DateAdapter ] ,
0 commit comments