@@ -12,26 +12,31 @@ import { MDCLinearProgressAdapter } from './linear-progress-adapter';
1212const { MDCLinearProgressFoundation } = require ( '@material/linear-progress' ) ;
1313const MDC_PROGRESS_STYLES = require ( '@material/linear-progress/mdc-linear-progress.scss' ) ;
1414
15- type UnlistenerMap = WeakMap < EventListener , Function > ;
16-
1715@Component ( {
1816 selector : 'mdc-linear-progress' ,
1917 templateUrl : './linear-progress.component.html' ,
2018 styles : [ String ( MDC_PROGRESS_STYLES ) ] ,
2119 encapsulation : ViewEncapsulation . None
2220} )
2321export class LinearProgressComponent implements AfterViewInit {
24- @Input ( ) indeterminate : boolean ;
25- @Input ( ) reversed : boolean ;
22+ private _indeterminate : boolean = true ;
23+ private _reversed : boolean ;
24+
25+ @Input ( )
26+ get indeterminate ( ) { return this . _indeterminate ; }
27+ set indeterminate ( value ) {
28+ this . _foundation . setDeterminate ( ! value ) ;
29+ this . _indeterminate = ! value ;
30+ }
31+ @Input ( )
32+ get reversed ( ) { return this . _reversed ; }
33+ set reversed ( value ) {
34+ this . _foundation . setReverse ( value ) ;
35+ this . _reversed = value ;
36+ }
2637 @Input ( ) accent : boolean ;
2738 @HostBinding ( 'attr.role' ) role : string = 'progressbar' ;
2839 @HostBinding ( 'class.mdc-linear-progress' ) className : string = 'mdc-linear-progress' ;
29- @HostBinding ( 'class.mdc-linear-progress--indeterminate' ) get classIndeterminate ( ) : string {
30- return this . indeterminate ? 'mdc-linear-progress--indeterminate' : '' ;
31- }
32- @HostBinding ( 'class.mdc-linear-progress--reversed' ) get classReversed ( ) : string {
33- return this . reversed ? 'mdc-linear-progress--reversed' : '' ;
34- }
3540 @HostBinding ( 'class.mdc-linear-progress--accent' ) get classAccent ( ) : string {
3641 return this . accent ? 'mdc-linear-progress--accent' : '' ;
3742 }
@@ -67,6 +72,8 @@ export class LinearProgressComponent implements AfterViewInit {
6772 init : Function ,
6873 setProgress : Function ,
6974 setBuffer : Function ,
75+ setReverse : Function ,
76+ setDeterminate : Function ,
7077 open : Function ,
7178 close : Function
7279 } = new MDCLinearProgressFoundation ( this . _mdcAdapter ) ;
0 commit comments