@@ -63,8 +63,8 @@ function flatColumns<RecordType>(
6363 . filter ( column => column && typeof column === 'object' )
6464 . reduce ( ( list , column , index ) => {
6565 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 ;
6868 const mergedKey = `${ parentKey } -${ index } ` ;
6969
7070 const subColumns = ( column as ColumnGroupType < RecordType > ) . children ;
@@ -88,24 +88,6 @@ function flatColumns<RecordType>(
8888 } , [ ] ) ;
8989}
9090
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-
10991/**
11092 * Parse `columns` & `children` into `columns`.
11193 */
@@ -175,10 +157,13 @@ function useColumns<RecordType>(
175157 // >>> Insert expand column if not exist
176158 if ( ! cloneColumns . includes ( EXPAND_COLUMN ) ) {
177159 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+ ) {
179164 cloneColumns . splice ( expandColIndex , 0 , EXPAND_COLUMN ) ;
180165 }
181- if ( fixed === 'right' ) {
166+ if ( fixed === 'right' || fixed === 'end' ) {
182167 cloneColumns . splice ( baseColumns . length , 0 , EXPAND_COLUMN ) ;
183168 }
184169 }
@@ -266,13 +251,11 @@ function useColumns<RecordType>(
266251 } , [ transformColumns , withExpandColumns , direction ] ) ;
267252
268253 // ========================== 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 ) ,
274256 // eslint-disable-next-line react-hooks/exhaustive-deps
275- } , [ mergedColumns , direction , scrollWidth ] ) ;
257+ [ mergedColumns , direction , scrollWidth ] ,
258+ ) ;
276259
277260 // ========================= FillWidth ========================
278261 const [ filledColumns , realScrollWidth ] = useWidthColumns (
0 commit comments