Skip to content

Commit

Permalink
bugfix: 解决大小写命名问题
Browse files Browse the repository at this point in the history
  • Loading branch information
WynterDing committed Jul 3, 2020
1 parent ebe12af commit 0e9ddf3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
59 changes: 30 additions & 29 deletions src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import useFetchData, { UseFetchDataAction, RequestData } from './useFetchData';
import Container from './container';
import Toolbar, { OptionConfig, ToolBarProps } from './component/toolBar';
import Alert from './component/alert';
import FormSearch, { SearchConfig, TableFormItem } from './Form';
import FormSearch, { SearchConfig, TableFormItem } from './form';
import { StatusType } from './component/status';
import get, {
parsingText,
Expand Down Expand Up @@ -53,25 +53,25 @@ export interface ColumnsState {

export type ValueEnumObj = {
[key: string]:
| {
text: ReactNode;
status: StatusType;
}
| ReactNode;
| {
text: ReactNode;
status: StatusType;
}
| ReactNode;
};

export type ValueEnumMap = Map<
React.ReactText,
| {
text: ReactNode;
status: StatusType;
}
text: ReactNode;
status: StatusType;
}
| ReactNode
>;

export interface ProColumnType<T = unknown>
extends Omit<ColumnType<T>, 'render' | 'children' | 'title' | 'filters'>,
Partial<Omit<FormItemProps, 'children'>> {
Partial<Omit<FormItemProps, 'children'>> {
index?: number;
title?: ReactNode | ((config: ProColumnType<T>, type: ProTableTypes) => ReactNode);
/**
Expand Down Expand Up @@ -280,19 +280,19 @@ export interface ProTableProps<T, U extends { [key: string]: any }>
* 设置或者返回false 即可关闭
*/
tableAlertRender?:
| ((props: {
intl: IntlType;
selectedRowKeys: (string | number)[];
selectedRows: T[];
}) => React.ReactNode)
| false;
| ((props: {
intl: IntlType;
selectedRowKeys: (string | number)[];
selectedRows: T[];
}) => React.ReactNode)
| false;
/**
* 自定义 table 的 alert 的操作
* 设置或者返回false 即可关闭
*/
tableAlertOptionRender?:
| ((props: { intl: IntlType; onCleanSelected: () => void }) => React.ReactNode)
| false;
| ((props: { intl: IntlType; onCleanSelected: () => void }) => React.ReactNode)
| false;

rowSelection?: TableProps<T>['rowSelection'] | false;

Expand Down Expand Up @@ -518,11 +518,12 @@ const genColumnList = <T, U = {}>(
},
index: columnsIndex,
...item,
filters: filters === true
? parsingValueEnumToArray(item.valueEnum).filter(
(valueItem) => valueItem && valueItem.value !== 'all',
)
: filters,
filters:
filters === true
? parsingValueEnumToArray(item.valueEnum).filter(
(valueItem) => valueItem && valueItem.value !== 'all',
)
: filters,
ellipsis: false,
fixed: config.fixed,
width: item.width || (item.fixed ? 200 : undefined),
Expand All @@ -543,9 +544,9 @@ const genColumnList = <T, U = {}>(
return tempColumns;
})
.filter((item) => !item.hideInTable) as unknown) as ColumnsType<T>[number] &
{
index?: number;
}[];
{
index?: number;
}[];

/**
* 🏆 Use Ant Design Table like a Pro!
Expand Down Expand Up @@ -583,7 +584,7 @@ const ProTable = <T extends {}, U extends object>(
defaultClassName,
formRef,
type = 'table',
onReset = () => { },
onReset = () => {},
columnEmptyText = '-',
...rest
} = props;
Expand Down Expand Up @@ -940,8 +941,8 @@ const ProTable = <T extends {}, U extends object>(
const { name = 'keyword' } =
options.search === true
? {
name: 'keyword',
}
name: 'keyword',
}
: options.search;
setFormSearch({
[name]: keyword,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
msMYIntl,
zhTWIntl,
} from './component/intlContext';
import Search from './Form';
import Search from './form';
import defaultRenderText, { ProColumnsValueType } from './defaultRender';

export type {
Expand Down

0 comments on commit 0e9ddf3

Please sign in to comment.