File tree Expand file tree Collapse file tree 5 files changed +35
-9
lines changed Expand file tree Collapse file tree 5 files changed +35
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-data-table-component" ,
3
- "version" : " 6.11.0 " ,
3
+ "version" : " 6.11.1 " ,
4
4
"description" : " A declarative react based data table" ,
5
5
"main" : " dist/index.cjs.js" ,
6
6
"module" : " dist/index.es.js" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import TableCell from './TableCell';
5
5
import TableCellCheckbox from './TableCellCheckbox' ;
6
6
import TableCellExpander from './TableCellExpander' ;
7
7
import ExpanderRow from './ExpanderRow' ;
8
- import { getConditionalStyle } from './util' ;
8
+ import { getConditionalStyle , isOdd } from './util' ;
9
9
10
10
const STOP_PROP_TAG = '___react-data-table-allow-propagation___' ;
11
11
@@ -97,13 +97,14 @@ const TableRow = memo(({
97
97
const extendedRowStyle = getConditionalStyle ( row , conditionalRowStyles ) ;
98
98
const hightlightSelected = selectableRowsHighlight && selected ;
99
99
const inheritStyles = inheritConditionalStyles ? extendedRowStyle : null ;
100
+ const isStriped = striped && isOdd ( rowIndex ) ;
100
101
101
102
return (
102
103
< >
103
104
< TableRowStyle
104
105
id = { `row-${ id } ` }
105
106
role = "row"
106
- striped = { striped }
107
+ striped = { isStriped }
107
108
highlightOnHover = { highlightOnHover }
108
109
pointerOnHover = { ! defaultExpanderDisabled && showPointer }
109
110
dense = { dense }
Original file line number Diff line number Diff line change @@ -48593,11 +48593,34 @@ exports[`DataTable::striped should render correctly when striped 1`] = `
48593
48593
border-bottom-color: rgba(0,0,0,.12);
48594
48594
}
48595
48595
48596
- .c14:nth-of-type(odd) {
48596
+ .c16 {
48597
+ display: -webkit-box;
48598
+ display: -webkit-flex;
48599
+ display: -ms-flexbox;
48600
+ display: flex;
48601
+ -webkit-align-items: stretch;
48602
+ -webkit-box-align: stretch;
48603
+ -ms-flex-align: stretch;
48604
+ align-items: stretch;
48605
+ -webkit-align-content: stretch;
48606
+ -ms-flex-line-pack: stretch;
48607
+ align-content: stretch;
48608
+ width: 100%;
48609
+ box-sizing: border-box;
48610
+ font-size: 13px;
48611
+ color: rgba(0,0,0,0.87);
48612
+ background-color: #FFFFFF;
48613
+ min-height: 48px;
48597
48614
color: rgba(0,0,0,0.87);
48598
48615
background-color: #FAFAFA;
48599
48616
}
48600
48617
48618
+ .c16:not(:last-of-type) {
48619
+ border-bottom-style: solid;
48620
+ border-bottom-width: 1px;
48621
+ border-bottom-color: rgba(0,0,0,.12);
48622
+ }
48623
+
48601
48624
.c11 {
48602
48625
position: relative;
48603
48626
display: -webkit-box;
@@ -48915,7 +48938,7 @@ exports[`DataTable::striped should render correctly when striped 1`] = `
48915
48938
</div>
48916
48939
</div>
48917
48940
<div
48918
- class="c14 rdt_TableRow"
48941
+ class="c16 rdt_TableRow"
48919
48942
id="row-2"
48920
48943
role="row"
48921
48944
>
Original file line number Diff line number Diff line change @@ -129,10 +129,8 @@ export const defaultStyles = theme => ({
129
129
outlineColor : theme . background . default ,
130
130
} ,
131
131
stripedStyle : {
132
- '&:nth-of-type(odd)' : {
133
- color : theme . striped . text ,
134
- backgroundColor : theme . striped . default ,
135
- } ,
132
+ color : theme . striped . text ,
133
+ backgroundColor : theme . striped . default ,
136
134
} ,
137
135
} ,
138
136
expanderRow : {
Original file line number Diff line number Diff line change @@ -133,3 +133,7 @@ export const detectRTL = (direction = 'auto') => {
133
133
134
134
return direction === 'rtl' ;
135
135
} ;
136
+
137
+ export const isOdd = num => {
138
+ return num % 2 ;
139
+ } ;
You can’t perform that action at this time.
0 commit comments