diff --git a/packages/components/table/index.ts b/packages/components/table/index.ts index a0177662e..99964acb5 100644 --- a/packages/components/table/index.ts +++ b/packages/components/table/index.ts @@ -42,4 +42,5 @@ export type { } from './src/types' // private +export { tableProps as ɵTableProps } from './src/types' export { getColumnKey as ɵGetColumnKey } from './src/utils' diff --git a/packages/pro/table/src/ProTable.tsx b/packages/pro/table/src/ProTable.tsx index 8de29b618..5c5c95dbb 100644 --- a/packages/pro/table/src/ProTable.tsx +++ b/packages/pro/table/src/ProTable.tsx @@ -95,7 +95,7 @@ export default defineComponent({ } return () => { - const { editable, customAdditional, customTag, layoutTool, toolbar, tableLayout, ...restProps } = props + const { customAdditional, customTag, layoutTool, toolbar, tableLayout, ...restProps } = props const resizable = hasResizable.value const mergedTableLayout = tableLayout ? tableLayout : resizable ? 'fixed' : undefined diff --git a/packages/pro/table/src/types.ts b/packages/pro/table/src/types.ts index 8e58f4c53..1eed0f1ee 100644 --- a/packages/pro/table/src/types.ts +++ b/packages/pro/table/src/types.ts @@ -9,61 +9,25 @@ import type { VirtualScrollToFn } from '@idux/cdk/scroll' import type { ExtractInnerPropTypes, ExtractPublicPropTypes, MaybeArray, VKey } from '@idux/cdk/utils' -import type { EmptyProps } from '@idux/components/empty' -import type { HeaderProps } from '@idux/components/header' -import type { SpinProps } from '@idux/components/spin' -import type { - TableColumnBase, - TableColumnExpandable, - TableColumnIndexable, - TableColumnSelectable, - TableCustomAdditional, - TableCustomTag, - TablePagination, - TableScroll, - TableSize, - TableSticky, -} from '@idux/components/table' import type { TooltipProps } from '@idux/components/tooltip' import type { DefineComponent, HTMLAttributes, PropType, VNodeChild } from 'vue' -export const proTableProps = { - expandedRowKeys: { type: Array as PropType, default: undefined }, - selectedRowKeys: { type: Array as PropType, default: undefined }, +import { + type TableColumnBase, + type TableColumnExpandable, + type TableColumnIndexable, + type TableColumnSelectable, + ɵTableProps, +} from '@idux/components/table' - autoHeight: { type: Boolean, default: undefined }, - borderless: { type: Boolean, default: undefined }, - childrenKey: { type: String, default: undefined }, +export const proTableProps = { + ...ɵTableProps, columns: { type: Array as PropType, default: () => [] }, - customAdditional: { type: Object as PropType, default: undefined }, - customTag: { type: Object as PropType, default: undefined }, - dataSource: { type: Array as PropType, default: () => [] }, - editable: { type: Boolean, default: false }, - ellipsis: { type: [Boolean, Object] as PropType, default: false }, - empty: { type: [String, Object] as PropType<'default' | 'simple' | EmptyProps>, default: 'default' }, - getKey: { type: [String, Function] as PropType any)>, default: undefined }, - header: { type: [String, Object] as PropType, default: undefined }, - headless: { type: Boolean, default: undefined }, layoutTool: { type: [Boolean, Object] as PropType, default: true }, - pagination: { type: [Boolean, Object] as PropType, default: undefined }, - scroll: { type: Object as PropType, default: undefined }, - scrollToTopOnChange: { type: Boolean, default: undefined }, - size: { type: String as PropType, default: undefined }, - spin: { type: [Boolean, Object] as PropType, default: undefined }, - sticky: { type: [Boolean, Object] as PropType, default: undefined }, - tableLayout: { type: String as PropType<'auto' | 'fixed'>, default: undefined }, toolbar: { type: Array as PropType>, default: undefined }, - virtual: { type: Boolean, default: false }, // events - 'onUpdate:expandedRowKeys': [Function, Array] as PropType void>>, - 'onUpdate:selectedRowKeys': [Function, Array] as PropType void>>, onColumnsChange: [Function, Array] as PropType void>>, - onScroll: [Function, Array] as PropType void>>, - onScrolledChange: [Function, Array] as PropType< - MaybeArray<(startIndex: number, endIndex: number, visibleData: any[]) => void> - >, - onScrolledBottom: [Function, Array] as PropType void>>, } as const export type ProTableProps = ExtractInnerPropTypes