diff --git a/components/table/demo/base.tsx b/components/table/demo/base.tsx index 58b1b0d..c92c5f1 100644 --- a/components/table/demo/base.tsx +++ b/components/table/demo/base.tsx @@ -1,10 +1,10 @@ -/* eslint-disable no-console */ -import React, { useRef } from 'react' -import { Table } from 'at-console-components' +import { TableColumnsType, TableRef } from '..' import { DatePicker } from 'antd' -import { mock } from 'mockjs' import { Store } from 'antd/lib/form/interface' -import { TableColumnsType, TableRef } from '..' +import { Table } from 'at-console-components' +import { mock } from 'mockjs' +import React, { useRef } from 'react' +/* eslint-disable no-console */ interface User { key: number diff --git a/components/table/index.tsx b/components/table/index.tsx index 55830cc..29e910d 100644 --- a/components/table/index.tsx +++ b/components/table/index.tsx @@ -1,3 +1,19 @@ +import DownOutlined from '@ant-design/icons/DownOutlined' +import RedoOutlined from '@ant-design/icons/RedoOutlined' +import SearchOutlined from '@ant-design/icons/SearchOutlined' +import { Store } from 'antd/lib/form/interface' +import { TableProps as AntdTableProps } from 'antd/lib/table' +import cloneDeep from 'lodash/cloneDeep' +import get from 'lodash/get' +import mapValues from 'lodash/mapValues' +import pickBy from 'lodash/pickBy' +import AsyncButton from '../async-button' +import Form, { FormProps } from '../form' +import useStates from '../hooks/useStates' +import { isFunc } from '../utils/is' +import showPlaceHolder from '../utils/showPlaceholder' +import { getHistoryState, setHistoryState } from './historyState' +import useWindowSize from './useWindowSize' import React, { useEffect, forwardRef, @@ -16,15 +32,6 @@ import { Tooltip, Button, } from 'antd' -import { TableProps as AntdTableProps } from 'antd/lib/table' -import SearchOutlined from '@ant-design/icons/SearchOutlined' -import DownOutlined from '@ant-design/icons/DownOutlined' -import RedoOutlined from '@ant-design/icons/RedoOutlined' -import get from 'lodash/get' -import pickBy from 'lodash/pickBy' -import cloneDeep from 'lodash/cloneDeep' -import mapValues from 'lodash/mapValues' -import { Store } from 'antd/lib/form/interface' import { SorterResult, TableCurrentDataSource, @@ -34,13 +41,6 @@ import { ColumnType, TablePaginationConfig, } from 'antd/lib/table/interface' -import Form, { FormProps } from '../form' -import AsyncButton from '../async-button' -import { isFunc } from '../utils/is' -import showPlaceHolder from '../utils/showPlaceholder' -import useWindowSize from './useWindowSize' -import useStates from '../hooks/useStates' -import { getHistoryState, setHistoryState } from './historyState' const { useForm } = AntdForm diff --git a/components/table/style/css.ts b/components/table/style/css.ts index 88dd446..eafdad6 100644 --- a/components/table/style/css.ts +++ b/components/table/style/css.ts @@ -1,13 +1,13 @@ import 'antd/lib/button/style/css' -import 'antd/lib/empty/style/css' -import 'antd/lib/radio/style/css' import 'antd/lib/checkbox/style/css' +import 'antd/lib/divider/style/css' import 'antd/lib/dropdown/style/css' -import 'antd/lib/spin/style/css' -import 'antd/lib/pagination/style/css' -import 'antd/lib/tooltip/style/css' -import 'antd/lib/table/style/css' +import 'antd/lib/empty/style/css' import 'antd/lib/grid/style/css' +import 'antd/lib/pagination/style/css' +import 'antd/lib/radio/style/css' import 'antd/lib/space/style/css' -import 'antd/lib/divider/style/css' +import 'antd/lib/spin/style/css' +import 'antd/lib/table/style/css' +import 'antd/lib/tooltip/style/css' import '../../form/style/css' diff --git a/components/wrapper/style/index.scss b/components/wrapper/style/index.scss index 60b4cb3..146602d 100644 --- a/components/wrapper/style/index.scss +++ b/components/wrapper/style/index.scss @@ -37,5 +37,11 @@ $contentBackground: #fff; margin: 0 12px; padding: 24px; border-radius: 4px; + + .ant-table-wrapper { + th, td { + white-space: nowrap; + } + } } }