@@ -328,38 +328,13 @@ const _MatRadioButtonMixinBase:
328328 mixinDisableRipple ( mixinTabIndex ( MatRadioButtonBase ) ) ;
329329
330330/**
331- * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.
331+ * Base class with all of the `MatRadioButton` functionality.
332+ * @docs -private
332333 */
333- @Component ( {
334- selector : 'mat-radio-button' ,
335- templateUrl : 'radio.html' ,
336- styleUrls : [ 'radio.css' ] ,
337- inputs : [ 'disableRipple' , 'tabIndex' ] ,
338- encapsulation : ViewEncapsulation . None ,
339- exportAs : 'matRadioButton' ,
340- host : {
341- 'class' : 'mat-radio-button' ,
342- '[class.mat-radio-checked]' : 'checked' ,
343- '[class.mat-radio-disabled]' : 'disabled' ,
344- '[class._mat-animation-noopable]' : '_animationMode === "NoopAnimations"' ,
345- '[class.mat-primary]' : 'color === "primary"' ,
346- '[class.mat-accent]' : 'color === "accent"' ,
347- '[class.mat-warn]' : 'color === "warn"' ,
348- // Needs to be -1 so the `focus` event still fires.
349- '[attr.tabindex]' : '-1' ,
350- '[attr.id]' : 'id' ,
351- '[attr.aria-label]' : 'null' ,
352- '[attr.aria-labelledby]' : 'null' ,
353- '[attr.aria-describedby]' : 'null' ,
354- // Note: under normal conditions focus shouldn't land on this element, however it may be
355- // programmatically set, for example inside of a focus trap, in this case we want to forward
356- // the focus to the native element.
357- '(focus)' : '_inputElement.nativeElement.focus()' ,
358- } ,
359- changeDetection : ChangeDetectionStrategy . OnPush ,
360- } )
361- export class MatRadioButton extends _MatRadioButtonMixinBase
362- implements OnInit , AfterViewInit , OnDestroy , CanDisableRipple , HasTabIndex {
334+ @Directive ( )
335+ // tslint:disable-next-line:class-name
336+ export abstract class _MatRadioButtonBase extends _MatRadioButtonMixinBase implements OnInit ,
337+ AfterViewInit , OnDestroy , CanDisableRipple , HasTabIndex {
363338
364339 private _uniqueId : string = `mat-radio-${ ++ nextUniqueId } ` ;
365340
@@ -606,3 +581,38 @@ export class MatRadioButton extends _MatRadioButtonMixinBase
606581 static ngAcceptInputType_required : BooleanInput ;
607582 static ngAcceptInputType_disableRipple : BooleanInput ;
608583}
584+
585+
586+ /**
587+ * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.
588+ */
589+ @Component ( {
590+ selector : 'mat-radio-button' ,
591+ templateUrl : 'radio.html' ,
592+ styleUrls : [ 'radio.css' ] ,
593+ inputs : [ 'disableRipple' , 'tabIndex' ] ,
594+ encapsulation : ViewEncapsulation . None ,
595+ exportAs : 'matRadioButton' ,
596+ host : {
597+ 'class' : 'mat-radio-button' ,
598+ '[class.mat-radio-checked]' : 'checked' ,
599+ '[class.mat-radio-disabled]' : 'disabled' ,
600+ '[class._mat-animation-noopable]' : '_animationMode === "NoopAnimations"' ,
601+ '[class.mat-primary]' : 'color === "primary"' ,
602+ '[class.mat-accent]' : 'color === "accent"' ,
603+ '[class.mat-warn]' : 'color === "warn"' ,
604+ // Needs to be -1 so the `focus` event still fires.
605+ '[attr.tabindex]' : '-1' ,
606+ '[attr.id]' : 'id' ,
607+ '[attr.aria-label]' : 'null' ,
608+ '[attr.aria-labelledby]' : 'null' ,
609+ '[attr.aria-describedby]' : 'null' ,
610+ // Note: under normal conditions focus shouldn't land on this element, however it may be
611+ // programmatically set, for example inside of a focus trap, in this case we want to forward
612+ // the focus to the native element.
613+ '(focus)' : '_inputElement.nativeElement.focus()' ,
614+ } ,
615+ changeDetection : ChangeDetectionStrategy . OnPush ,
616+ } )
617+ export class MatRadioButton extends _MatRadioButtonBase {
618+ }
0 commit comments