1- import React from 'react ' ;
2- import constants from './constants ' ;
1+ import styleMaps from './styleMaps ' ;
2+ import CustomPropTypes from './utils/CustomPropTypes ' ;
33
44const BootstrapMixin = {
55 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 )
99 } ,
1010
1111 getBsClassSet ( ) {
1212 let classes = { } ;
1313
14- let bsClass = this . props . bsClass && constants . CLASSES [ this . props . bsClass ] ;
14+ let bsClass = this . props . bsClass && styleMaps . CLASSES [ this . props . bsClass ] ;
1515 if ( bsClass ) {
1616 classes [ bsClass ] = true ;
1717
1818 let prefix = bsClass + '-' ;
1919
20- let bsSize = this . props . bsSize && constants . SIZES [ this . props . bsSize ] ;
20+ let bsSize = this . props . bsSize && styleMaps . SIZES [ this . props . bsSize ] ;
2121 if ( bsSize ) {
2222 classes [ prefix + bsSize ] = true ;
2323 }
2424
25- let bsStyle = this . props . bsStyle && constants . STYLES [ this . props . bsStyle ] ;
25+ let bsStyle = this . props . bsStyle && styleMaps . STYLES [ this . props . bsStyle ] ;
2626 if ( this . props . bsStyle ) {
2727 classes [ prefix + bsStyle ] = true ;
2828 }
@@ -32,7 +32,7 @@ const BootstrapMixin = {
3232 } ,
3333
3434 prefixClass ( subClass ) {
35- return constants . CLASSES [ this . props . bsClass ] + '-' + subClass ;
35+ return styleMaps . CLASSES [ this . props . bsClass ] + '-' + subClass ;
3636 }
3737} ;
3838
0 commit comments