File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
packages/react-bootstrap-table2/src Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,8 @@ BootstrapTable.propTypes = {
166166 style : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . func ] ) ,
167167 classes : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . func ] ) ,
168168 nonSelectable : PropTypes . array ,
169+ nonSelectableStyle : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . func ] ) ,
170+ nonSelectableClasses : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . func ] ) ,
169171 bgColor : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . func ] ) ,
170172 hideSelectColumn : PropTypes . bool ,
171173 selectionRenderer : PropTypes . func ,
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export default (Component) => {
99 const key = props . value ;
1010 const selected = _ . contains ( selectRow . selected , key ) ;
1111 const selectable = ! selectRow . nonSelectable || ! _ . contains ( selectRow . nonSelectable , key ) ;
12+ const notSelectable = _ . contains ( selectRow . nonSelectable , key ) ;
1213
1314 let {
1415 style,
@@ -38,6 +39,22 @@ export default (Component) => {
3839 }
3940 }
4041
42+ if ( notSelectable ) {
43+ const notSelectableStyle = _ . isFunction ( selectRow . nonSelectableStyle )
44+ ? selectRow . nonSelectableStyle ( props . row , props . rowIndex )
45+ : selectRow . nonSelectableStyle ;
46+
47+ const notSelectableClasses = _ . isFunction ( selectRow . nonSelectableClasses )
48+ ? selectRow . nonSelectableClasses ( props . row , props . rowIndex )
49+ : selectRow . nonSelectableClasses ;
50+
51+ style = {
52+ ...style ,
53+ ...notSelectableStyle
54+ } ;
55+ className = cs ( className , notSelectableClasses ) || undefined ;
56+ }
57+
4158 return (
4259 < Component
4360 { ...props }
You can’t perform that action at this time.
0 commit comments