refactor(client): allow fixed layout table and action link class (#3246)
This commit is contained in:
		
							parent
							
								
									d570a2c704
								
							
						
					
					
						commit
						3e99ad1483
					
				@ -1,11 +1,14 @@
 | 
				
			|||||||
import { observer } from '@formily/react';
 | 
					import { observer } from '@formily/react';
 | 
				
			||||||
import React from 'react';
 | 
					import React from 'react';
 | 
				
			||||||
 | 
					import classnames from 'classnames';
 | 
				
			||||||
import Action from './Action';
 | 
					import Action from './Action';
 | 
				
			||||||
import { ComposedAction } from './types';
 | 
					import { ComposedAction } from './types';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const ActionLink: ComposedAction = observer(
 | 
					export const ActionLink: ComposedAction = observer(
 | 
				
			||||||
  (props: any) => {
 | 
					  (props: any) => {
 | 
				
			||||||
    return <Action {...props} component={props.component || 'a'} className={'nb-action-link'} />;
 | 
					    return (
 | 
				
			||||||
 | 
					      <Action {...props} component={props.component || 'a'} className={classnames('nb-action-link', props.className)} />
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  { displayName: 'ActionLink' },
 | 
					  { displayName: 'ActionLink' },
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
				
			|||||||
@ -538,6 +538,7 @@ export const Table: any = observer(
 | 
				
			|||||||
            ref={tableSizeRefCallback}
 | 
					            ref={tableSizeRefCallback}
 | 
				
			||||||
            rowKey={rowKey ?? defaultRowKey}
 | 
					            rowKey={rowKey ?? defaultRowKey}
 | 
				
			||||||
            dataSource={dataSource}
 | 
					            dataSource={dataSource}
 | 
				
			||||||
 | 
					            tableLayout="auto"
 | 
				
			||||||
            {...others}
 | 
					            {...others}
 | 
				
			||||||
            {...restProps}
 | 
					            {...restProps}
 | 
				
			||||||
            pagination={paginationProps}
 | 
					            pagination={paginationProps}
 | 
				
			||||||
@ -547,7 +548,6 @@ export const Table: any = observer(
 | 
				
			|||||||
            }}
 | 
					            }}
 | 
				
			||||||
            onRow={onRow}
 | 
					            onRow={onRow}
 | 
				
			||||||
            rowClassName={(record) => (selectedRow.includes(record[rowKey]) ? highlightRow : '')}
 | 
					            rowClassName={(record) => (selectedRow.includes(record[rowKey]) ? highlightRow : '')}
 | 
				
			||||||
            tableLayout={'auto'}
 | 
					 | 
				
			||||||
            scroll={scroll}
 | 
					            scroll={scroll}
 | 
				
			||||||
            columns={columns}
 | 
					            columns={columns}
 | 
				
			||||||
            expandable={{
 | 
					            expandable={{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user