@@ -12,9 +12,9 @@ import { FormCheckLabelDirective } from './form-check-label.directive';
12
12
export class FormCheckComponent implements AfterContentInit {
13
13
14
14
static ngAcceptInputType_inline : BooleanInput ;
15
+ static ngAcceptInputType_reverse : BooleanInput ;
15
16
static ngAcceptInputType_switch : BooleanInput ;
16
17
17
- private _inline = false ;
18
18
/**
19
19
* Group checkboxes or radios on the same horizontal row.
20
20
* @type boolean
@@ -24,17 +24,37 @@ export class FormCheckComponent implements AfterContentInit {
24
24
set inline ( value : boolean ) {
25
25
this . _inline = coerceBooleanProperty ( value ) ;
26
26
}
27
+
27
28
get inline ( ) : boolean {
28
29
return this . _inline ;
29
30
}
30
31
32
+ private _inline = false ;
33
+
34
+ /**
35
+ * Put checkboxes or radios on the opposite side.
36
+ * @type boolean
37
+ * @default false
38
+ * @since 4.4.7
39
+ */
40
+ @Input ( )
41
+ set reverse ( value : boolean ) {
42
+ this . _reverse = coerceBooleanProperty ( value ) ;
43
+ }
44
+
45
+ get reverse ( ) : boolean {
46
+ return this . _reverse ;
47
+ }
48
+
49
+ private _reverse : boolean = false ;
50
+
31
51
/**
32
52
* Size the component large or extra large. Works only with `[switch]="true"` [docs]
33
53
* @type {'lg' | 'xl' | '' }
34
54
*/
35
55
@Input ( ) sizing ?: 'lg' | 'xl' | '' = '' ;
36
56
37
- /**
57
+ /**
38
58
* Render a toggle switch on for checkbox.
39
59
* @type boolean
40
60
* @default false
@@ -43,9 +63,11 @@ export class FormCheckComponent implements AfterContentInit {
43
63
set switch ( value : boolean ) {
44
64
this . _switch = coerceBooleanProperty ( value ) ;
45
65
}
66
+
46
67
get switch ( ) : boolean {
47
68
return this . _switch ;
48
69
}
70
+
49
71
private _switch = false ;
50
72
51
73
@HostBinding ( 'class' )
@@ -55,11 +77,13 @@ export class FormCheckComponent implements AfterContentInit {
55
77
'form-check' : this . formCheckClass ,
56
78
'form-switch' : this . switch ,
57
79
[ `form-switch-${ this . sizing } ` ] : this . switch && ! ! this . sizing ,
58
- 'form-check-inline' : this . inline
80
+ 'form-check-inline' : this . inline ,
81
+ 'form-check-reverse' : this . reverse
59
82
} ;
60
83
}
61
84
62
85
@ContentChild ( FormCheckLabelDirective ) formCheckLabel ! : FormCheckLabelDirective ;
86
+
63
87
private _formCheckClass = true ;
64
88
get formCheckClass ( ) {
65
89
return this . _formCheckClass ;
0 commit comments