1
- import React from 'react ' ;
2
- import constants from './constants ' ;
1
+ import styleMaps from './styleMaps ' ;
2
+ import CustomPropTypes from './utils/CustomPropTypes ' ;
3
3
4
4
const BootstrapMixin = {
5
5
propTypes : {
6
- bsClass : React . PropTypes . oneOf ( Object . keys ( constants . CLASSES ) ) ,
7
- bsStyle : React . PropTypes . oneOf ( Object . keys ( constants . STYLES ) ) ,
8
- bsSize : React . PropTypes . oneOf ( Object . keys ( constants . SIZES ) )
6
+ bsClass : CustomPropTypes . keyOf ( styleMaps . CLASSES ) ,
7
+ bsStyle : CustomPropTypes . keyOf ( styleMaps . STYLES ) ,
8
+ bsSize : CustomPropTypes . keyOf ( styleMaps . SIZES )
9
9
} ,
10
10
11
11
getBsClassSet ( ) {
12
12
let classes = { } ;
13
13
14
- let bsClass = this . props . bsClass && constants . CLASSES [ this . props . bsClass ] ;
14
+ let bsClass = this . props . bsClass && styleMaps . CLASSES [ this . props . bsClass ] ;
15
15
if ( bsClass ) {
16
16
classes [ bsClass ] = true ;
17
17
18
18
let prefix = bsClass + '-' ;
19
19
20
- let bsSize = this . props . bsSize && constants . SIZES [ this . props . bsSize ] ;
20
+ let bsSize = this . props . bsSize && styleMaps . SIZES [ this . props . bsSize ] ;
21
21
if ( bsSize ) {
22
22
classes [ prefix + bsSize ] = true ;
23
23
}
24
24
25
- let bsStyle = this . props . bsStyle && constants . STYLES [ this . props . bsStyle ] ;
25
+ let bsStyle = this . props . bsStyle && styleMaps . STYLES [ this . props . bsStyle ] ;
26
26
if ( this . props . bsStyle ) {
27
27
classes [ prefix + bsStyle ] = true ;
28
28
}
@@ -32,7 +32,7 @@ const BootstrapMixin = {
32
32
} ,
33
33
34
34
prefixClass ( subClass ) {
35
- return constants . CLASSES [ this . props . bsClass ] + '-' + subClass ;
35
+ return styleMaps . CLASSES [ this . props . bsClass ] + '-' + subClass ;
36
36
}
37
37
} ;
38
38
0 commit comments