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