diff --git a/src/components/Table/EditableCell.jsx b/src/components/Table/EditableCell.jsx
index d953678..84dae08 100644
--- a/src/components/Table/EditableCell.jsx
+++ b/src/components/Table/EditableCell.jsx
@@ -28,7 +28,11 @@ export const EditableCell = ({
{inputNode}
- return (
+ const tdStyle = editing
+ ? { padding:0 }
+ : null
+
+ return ( |
{editing ? editor: children}
| )
}
\ No newline at end of file
diff --git a/src/components/Table/EditableTable.jsx b/src/components/Table/EditableTable.jsx
index 8e18eea..d363c28 100644
--- a/src/components/Table/EditableTable.jsx
+++ b/src/components/Table/EditableTable.jsx
@@ -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})
diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts
index bf62c31..fe5fe21 100644
--- a/src/components/Table/index.ts
+++ b/src/components/Table/index.ts
@@ -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 класс для , если требуется
@@ -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