@@ -63,8 +63,8 @@ function flatColumns<RecordType>(
63
63
. filter ( column => column && typeof column === 'object' )
64
64
. reduce ( ( list , column , index ) => {
65
65
const { fixed } = column ;
66
- // Convert `fixed='true'` to `fixed='left'` instead
67
- const parsedFixed = fixed === true ? 'left ' : fixed ;
66
+ const parsedFixed =
67
+ fixed === true || fixed === 'left' ? 'start' : fixed === 'right' ? 'end ' : fixed ;
68
68
const mergedKey = `${ parentKey } -${ index } ` ;
69
69
70
70
const subColumns = ( column as ColumnGroupType < RecordType > ) . children ;
@@ -88,24 +88,6 @@ function flatColumns<RecordType>(
88
88
} , [ ] ) ;
89
89
}
90
90
91
- function revertForRtl < RecordType > ( columns : ColumnsType < RecordType > ) : ColumnsType < RecordType > {
92
- return columns . map ( column => {
93
- const { fixed, ...restProps } = column ;
94
-
95
- // Convert `fixed='left'` to `fixed='right'` instead
96
- let parsedFixed = fixed ;
97
- if ( fixed === 'left' ) {
98
- parsedFixed = 'right' ;
99
- } else if ( fixed === 'right' ) {
100
- parsedFixed = 'left' ;
101
- }
102
- return {
103
- fixed : parsedFixed ,
104
- ...restProps ,
105
- } ;
106
- } ) ;
107
- }
108
-
109
91
/**
110
92
* Parse `columns` & `children` into `columns`.
111
93
*/
@@ -175,10 +157,13 @@ function useColumns<RecordType>(
175
157
// >>> Insert expand column if not exist
176
158
if ( ! cloneColumns . includes ( EXPAND_COLUMN ) ) {
177
159
const expandColIndex = expandIconColumnIndex || 0 ;
178
- if ( expandColIndex >= 0 && ( expandColIndex || fixed === 'left' || ! fixed ) ) {
160
+ if (
161
+ expandColIndex >= 0 &&
162
+ ( expandColIndex || fixed === 'left' || fixed === 'start' || ! fixed )
163
+ ) {
179
164
cloneColumns . splice ( expandColIndex , 0 , EXPAND_COLUMN ) ;
180
165
}
181
- if ( fixed === 'right' ) {
166
+ if ( fixed === 'right' || fixed === 'end' ) {
182
167
cloneColumns . splice ( baseColumns . length , 0 , EXPAND_COLUMN ) ;
183
168
}
184
169
}
@@ -266,13 +251,11 @@ function useColumns<RecordType>(
266
251
} , [ transformColumns , withExpandColumns , direction ] ) ;
267
252
268
253
// ========================== Flatten =========================
269
- const flattenColumns = React . useMemo ( ( ) => {
270
- if ( direction === 'rtl' ) {
271
- return revertForRtl ( flatColumns ( mergedColumns ) ) ;
272
- }
273
- return flatColumns ( mergedColumns ) ;
254
+ const flattenColumns = React . useMemo (
255
+ ( ) => flatColumns ( mergedColumns ) ,
274
256
// eslint-disable-next-line react-hooks/exhaustive-deps
275
- } , [ mergedColumns , direction , scrollWidth ] ) ;
257
+ [ mergedColumns , direction , scrollWidth ] ,
258
+ ) ;
276
259
277
260
// ========================= FillWidth ========================
278
261
const [ filledColumns , realScrollWidth ] = useWidthColumns (
0 commit comments