File tree 2 files changed +33
-9
lines changed
packages/data-grid/src/table
2 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ const propTypes = {
71
71
horizontalScroll : bool ,
72
72
/** Optional boolean to cause the first column to be fixed when horizontalScrool is true */
73
73
fixedColumn : bool ,
74
+ /** Optional boolean to cause the first column to be fixed when horizontalScrool is true */
75
+ fixedLastColumn : bool ,
74
76
/** Optional string to provider header which is visable when no data is available */
75
77
emptyStateHeader : string ,
76
78
/** Optional string to provider descriptive message explaining the empty state of the table */
@@ -96,6 +98,7 @@ const defaultProps = {
96
98
sortedColumn : { direction : '' , sortDataKey : '' } ,
97
99
horizontalScroll : false ,
98
100
fixedColumn : false ,
101
+ fixedLastColumn : false ,
99
102
emptyStateHeader : 'No data available' ,
100
103
emptyStateMessage : 'Prompt to action or solution' ,
101
104
loading : false ,
@@ -158,6 +161,7 @@ class Table extends Component {
158
161
loading,
159
162
loadingMessage,
160
163
fixedColumn,
164
+ fixedLastColumn,
161
165
horizontalScroll,
162
166
emptyStateHeader,
163
167
emptyStateMessage,
@@ -181,6 +185,7 @@ class Table extends Component {
181
185
className = { classnames ( {
182
186
'dg-table-horizontal-scroll' : horizontalScroll ,
183
187
'dg-table-fixed-column' : fixedColumn ,
188
+ 'dg-table-fixed-last-column' : fixedLastColumn ,
184
189
} ) }
185
190
>
186
191
< table
Original file line number Diff line number Diff line change 93
93
border-collapse : separate ;
94
94
border-spacing : 0 ;
95
95
96
- th :first-child {
97
- position : -webkit-sticky ;
98
- position : sticky ;
99
- left : 0 ;
100
- z-index : 2 ;
96
+ th ,
97
+ td {
98
+ :first-child {
99
+ position : -webkit-sticky ;
100
+ position : sticky ;
101
+ left : 0 ;
102
+ z-index : 2 ;
103
+ }
101
104
}
102
105
103
106
td :first-child {
104
- position : -webkit-sticky ;
105
- position : sticky ;
106
- left : 0 ;
107
- z-index : 2 ;
108
107
background-color : $puppet-n200 ;
109
108
}
110
109
}
111
110
111
+ .dg-table-fixed-last-column {
112
+ width : 100% ;
113
+ border-collapse : separate ;
114
+ border-spacing : 0 ;
115
+
116
+ th ,
117
+ td {
118
+ :last-child {
119
+ position : -webkit-sticky ;
120
+ position : sticky ;
121
+ right : 0 ;
122
+ z-index : 2 ;
123
+ }
124
+ }
125
+
126
+ td :last-child {
127
+ background-color : $puppet-white ;
128
+ }
129
+ }
130
+
112
131
/* * Loading State **/
113
132
114
133
.dg-table-loading-container {
You can’t perform that action at this time.
0 commit comments