@@ -124,12 +124,7 @@ export class CdkStep implements OnChanges {
124
124
@ViewChild ( TemplateRef ) content : TemplateRef < any > ;
125
125
126
126
/** The top level abstract control of the step. */
127
- @Input ( ) stepControl : {
128
- valid : boolean ;
129
- invalid : boolean ;
130
- pending : boolean ;
131
- reset : ( ) => void ;
132
- } ;
127
+ @Input ( ) stepControl : FormControlLike ;
133
128
134
129
/** Whether user has seen the expanded step content or not. */
135
130
interacted = false ;
@@ -516,3 +511,57 @@ export class CdkStepper implements AfterViewInit, OnDestroy {
516
511
return stepperElement === focusedElement || stepperElement . contains ( focusedElement ) ;
517
512
}
518
513
}
514
+
515
+
516
+ /**
517
+ * Simplified representation of a FormControl from @angular/forms.
518
+ * Used to avoid having to bring in @angular/forms for a single optional interface.
519
+ * @docs -private
520
+ */
521
+ interface FormControlLike {
522
+ asyncValidator : ( ) => any | null ;
523
+ dirty : boolean ;
524
+ disabled : boolean ;
525
+ enabled : boolean ;
526
+ errors : { [ key : string ] : any } | null ;
527
+ invalid : boolean ;
528
+ parent : any ;
529
+ pending : boolean ;
530
+ pristine : boolean ;
531
+ root : FormControlLike ;
532
+ status : string ;
533
+ statusChanges : Observable < any > ;
534
+ touched : boolean ;
535
+ untouched : boolean ;
536
+ updateOn : any ;
537
+ valid : boolean ;
538
+ validator : ( ) => any | null ;
539
+ value : any ;
540
+ valueChanges : Observable < any > ;
541
+ clearAsyncValidators ( ) : void ;
542
+ clearValidators ( ) : void ;
543
+ disable ( opts ?: any ) : void ;
544
+ enable ( opts ?: any ) : void ;
545
+ get ( path : ( string | number ) [ ] | string ) : FormControlLike | null ;
546
+ getError ( errorCode : string , path ?: ( string | number ) [ ] | string ) : any ;
547
+ hasError ( errorCode : string , path ?: ( string | number ) [ ] | string ) : boolean ;
548
+ markAllAsTouched ( ) : void ;
549
+ markAsDirty ( opts ?: any ) : void ;
550
+ markAsPending ( opts ?: any ) : void ;
551
+ markAsPristine ( opts ?: any ) : void ;
552
+ markAsTouched ( opts ?: any ) : void ;
553
+ markAsUntouched ( opts ?: any ) : void ;
554
+ patchValue ( value : any , options ?: Object ) : void ;
555
+ reset ( value ?: any , options ?: Object ) : void ;
556
+ setAsyncValidators ( newValidator : ( ) => any | ( ( ) => any ) [ ] | null ) : void ;
557
+ setErrors ( errors : { [ key : string ] : any } | null , opts ?: any ) : void ;
558
+ setParent ( parent : any ) : void ;
559
+ setValidators ( newValidator : ( ) => any | ( ( ) => any ) [ ] | null ) : void ;
560
+ setValue ( value : any , options ?: Object ) : void ;
561
+ updateValueAndValidity ( opts ?: any ) : void ;
562
+ patchValue ( value : any , options ?: any ) : void ;
563
+ registerOnChange ( fn : Function ) : void ;
564
+ registerOnDisabledChange ( fn : ( isDisabled : boolean ) => void ) : void ;
565
+ reset ( formState ?: any , options ?: any ) : void ;
566
+ setValue ( value : any , options ?: any ) : void ;
567
+ }
0 commit comments