feat: align number columns text to right
This commit is contained in:
parent
8c679b0938
commit
eac7734f07
@ -32,4 +32,9 @@
|
||||
> *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-cell.noco-field-percent,
|
||||
.ant-table-cell.noco-field-number {
|
||||
text-align: right;
|
||||
}
|
@ -7,6 +7,7 @@ import findIndex from 'lodash/findIndex';
|
||||
import get from 'lodash/get';
|
||||
import './style.less';
|
||||
import Field from '../Field';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
|
||||
export const SortableItem = sortableElement(props => <tr {...props} />);
|
||||
export const SortableContainer = sortableContainer(props => <tbody {...props} />);
|
||||
@ -57,8 +58,10 @@ export const components = ({data = {}, rowKey, mutate, onMoved}: Props) => {
|
||||
};
|
||||
|
||||
export function fields2columns(fields) {
|
||||
const columns: any[] = fields.map(field => {
|
||||
const columns: any[] = fields.map(item => {
|
||||
const field = cloneDeep(item);
|
||||
field.render = (value) => field.interface === 'sort' ? <DragHandle/> : <Field viewType={'table'} schema={field} value={value}/>;
|
||||
field.className = `${field.className||''} noco-field-${field.interface}`;
|
||||
return {
|
||||
...field,
|
||||
...(field.component||{}),
|
||||
|
Loading…
Reference in New Issue
Block a user