forked from ddrilling/asb_cloud_front
Remove padding from EditableCell.
Add types into otherColumsParams.
This commit is contained in:
parent
4118319b97
commit
7a7a4663c5
@ -28,7 +28,11 @@ export const EditableCell = ({
|
||||
{inputNode}
|
||||
</Form.Item>
|
||||
|
||||
return (<td>
|
||||
const tdStyle = editing
|
||||
? { padding:0 }
|
||||
: null
|
||||
|
||||
return (<td style={tdStyle}>
|
||||
{editing ? editor: children}
|
||||
</td>)
|
||||
}
|
@ -30,7 +30,7 @@ export const EditableTable = ({
|
||||
setData(tryAddKeys(dataSource))
|
||||
},[dataSource])
|
||||
|
||||
const isEditing = (record) => record.key === editingKey
|
||||
const isEditing = (record) => record?.key === editingKey
|
||||
|
||||
const edit = (record) => {
|
||||
form.setFieldsValue({...record})
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { ReactNode } from 'react'
|
||||
export { Table } from 'antd'
|
||||
export { EditableTable } from './EditableTable'
|
||||
export { DatePickerWrapper } from './DatePickerWrapper'
|
||||
@ -27,7 +28,7 @@ interface columnPropsOther {
|
||||
// редактируемая колонка
|
||||
editable?: boolean
|
||||
// react компонента редактора
|
||||
input?: any
|
||||
input?: ReactNode
|
||||
// значение может быть пустым
|
||||
isRequired?: boolean
|
||||
// css класс для <FormItem/>, если требуется
|
||||
@ -38,14 +39,14 @@ interface columnPropsOther {
|
||||
initialValue?: string|number
|
||||
}
|
||||
|
||||
export const makeColumn = (title:string, key:string, other?:columnPropsOther) => ({
|
||||
export const makeColumn = (title:string | ReactNode, key:string, other?:columnPropsOther) => ({
|
||||
title: title,
|
||||
key: key,
|
||||
dataIndex: key,
|
||||
...other,
|
||||
})
|
||||
|
||||
export const makeColumnsPlanFact = (title:string, key:string|string[], columsOther?:any|any[], gruopOther?:any) =>
|
||||
export const makeColumnsPlanFact = (title:string | ReactNode, key:string|string[], columsOther?:any|any[], gruopOther?:any) =>
|
||||
{
|
||||
let keyPlanLocal = key
|
||||
let keyFactLocal = key
|
||||
|
Loading…
Reference in New Issue
Block a user