File tree 3 files changed +47
-1
lines changed
3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const gridInstance = (
8
8
< Row className = "show-grid" >
9
9
< Col xs = { 6 } md = { 4 } > < code > <{ 'Col xs={6} md={4}' } /></ code > </ Col >
10
10
< Col xs = { 6 } md = { 4 } > < code > <{ 'Col xs={6} md={4}' } /></ code > </ Col >
11
- < Col xs = { 6 } md = { 4 } > < code > <{ 'Col xs={6} md={4}' } /></ code > </ Col >
11
+ < Col xsHidden md = { 4 } > < code > <{ 'Col xsHidden md={4}' } /></ code > </ Col >
12
12
</ Row >
13
13
14
14
< Row className = "show-grid" >
Original file line number Diff line number Diff line change @@ -37,6 +37,38 @@ const Col = React.createClass({
37
37
* class-prefix `col-lg-`
38
38
*/
39
39
lg : React . PropTypes . number ,
40
+ /**
41
+ * Hide column
42
+ *
43
+ * on Extra small devices Phones
44
+ *
45
+ * adds class `hidden-xs`
46
+ */
47
+ xsHidden : React . PropTypes . bool ,
48
+ /**
49
+ * Hide column
50
+ *
51
+ * on Small devices Tablets
52
+ *
53
+ * adds class `hidden-sm`
54
+ */
55
+ smHidden : React . PropTypes . bool ,
56
+ /**
57
+ * Hide column
58
+ *
59
+ * on Medium devices Desktops
60
+ *
61
+ * adds class `hidden-md`
62
+ */
63
+ mdHidden : React . PropTypes . bool ,
64
+ /**
65
+ * Hide column
66
+ *
67
+ * on Large devices Desktops
68
+ *
69
+ * adds class `hidden-lg`
70
+ */
71
+ lgHidden : React . PropTypes . bool ,
40
72
/**
41
73
* Move columns to the right
42
74
*
@@ -158,6 +190,8 @@ const Col = React.createClass({
158
190
classes [ 'col-' + classPart + this . props [ prop ] ] = true ;
159
191
}
160
192
193
+ classes [ 'hidden-' + size ] = this . props [ size + 'Hidden' ] ;
194
+
161
195
prop = size + 'Offset' ;
162
196
classPart = size + '-offset-' ;
163
197
if ( this . props [ prop ] >= 0 ) {
Original file line number Diff line number Diff line change @@ -40,4 +40,16 @@ describe('Col', () => {
40
40
assert . ok ( instanceClassName . match ( / \b c o l - m d - p u s h - 0 \b / ) ) ;
41
41
assert . ok ( instanceClassName . match ( / \b c o l - l g - p u s h - 0 \b / ) ) ;
42
42
} ) ;
43
+
44
+ it ( 'Should set Hidden to true' , ( ) => {
45
+ let instance = ReactTestUtils . renderIntoDocument (
46
+ < Col xsHidden smHidden mdHidden lgHidden />
47
+ ) ;
48
+
49
+ let instanceClassName = ReactDOM . findDOMNode ( instance ) . className ;
50
+ assert . ok ( instanceClassName . match ( / \b h i d d e n - x s \b / ) ) ;
51
+ assert . ok ( instanceClassName . match ( / \b h i d d e n - s m \b / ) ) ;
52
+ assert . ok ( instanceClassName . match ( / \b h i d d e n - m d \b / ) ) ;
53
+ assert . ok ( instanceClassName . match ( / \b h i d d e n - l g \b / ) ) ;
54
+ } ) ;
43
55
} ) ;
You can’t perform that action at this time.
0 commit comments