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 > > ( ) ;
@@ -98,7 +104,10 @@ export abstract class MatDateSelectionModel<S, D = ExtractDateTypeFromSelection<
98
104
}
99
105
}
100
106
101
- /** A selection model that contains a single date. */
107
+ /**
108
+ * A selection model that contains a single date.
109
+ * @docs -private
110
+ */
102
111
@Injectable ( )
103
112
export class MatSingleDateSelectionModel < D > extends MatDateSelectionModel < D | null , D > {
104
113
constructor ( adapter : DateAdapter < D > ) {
@@ -134,7 +143,10 @@ export class MatSingleDateSelectionModel<D> extends MatDateSelectionModel<D | nu
134
143
}
135
144
}
136
145
137
- /** A selection model that contains a date range. */
146
+ /**
147
+ * A selection model that contains a date range.
148
+ * @docs -private
149
+ */
138
150
@Injectable ( )
139
151
export class MatRangeDateSelectionModel < D > extends MatDateSelectionModel < DateRange < D > , D > {
140
152
constructor ( adapter : DateAdapter < D > ) {
@@ -203,7 +215,10 @@ export function MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY(
203
215
return parent || new MatSingleDateSelectionModel ( adapter ) ;
204
216
}
205
217
206
- /** Used to provide a single selection model to a component. */
218
+ /**
219
+ * Used to provide a single selection model to a component.
220
+ * @docs -private
221
+ */
207
222
export const MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER : FactoryProvider = {
208
223
provide : MatDateSelectionModel ,
209
224
deps : [ [ new Optional ( ) , new SkipSelf ( ) , MatDateSelectionModel ] , DateAdapter ] ,
@@ -217,7 +232,10 @@ export function MAT_RANGE_DATE_SELECTION_MODEL_FACTORY(
217
232
return parent || new MatRangeDateSelectionModel ( adapter ) ;
218
233
}
219
234
220
- /** Used to provide a range selection model to a component. */
235
+ /**
236
+ * Used to provide a range selection model to a component.
237
+ * @docs -private
238
+ */
221
239
export const MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER : FactoryProvider = {
222
240
provide : MatDateSelectionModel ,
223
241
deps : [ [ new Optional ( ) , new SkipSelf ( ) , MatDateSelectionModel ] , DateAdapter ] ,
0 commit comments