Skip to content

Commit

Permalink
fix(pro:table): emptyCell is not declared in props (#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzaijiang committed Dec 27, 2022
1 parent 30d1ab3 commit edb23d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 46 deletions.
1 change: 1 addition & 0 deletions packages/components/table/index.ts
Expand Up @@ -42,4 +42,5 @@ export type {
} from './src/types'

// private
export { tableProps as ɵTableProps } from './src/types'
export { getColumnKey as ɵGetColumnKey } from './src/utils'
2 changes: 1 addition & 1 deletion packages/pro/table/src/ProTable.tsx
Expand Up @@ -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

Expand Down
54 changes: 9 additions & 45 deletions packages/pro/table/src/types.ts
Expand Up @@ -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<VKey[]>, default: undefined },
selectedRowKeys: { type: Array as PropType<VKey[]>, 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<ProTableColumn[]>, default: () => [] },
customAdditional: { type: Object as PropType<TableCustomAdditional>, default: undefined },
customTag: { type: Object as PropType<TableCustomTag>, default: undefined },
dataSource: { type: Array as PropType<any[]>, default: () => [] },
editable: { type: Boolean, default: false },
ellipsis: { type: [Boolean, Object] as PropType<boolean | { title?: boolean; head?: boolean }>, default: false },
empty: { type: [String, Object] as PropType<'default' | 'simple' | EmptyProps>, default: 'default' },
getKey: { type: [String, Function] as PropType<string | ((record: any) => any)>, default: undefined },
header: { type: [String, Object] as PropType<string | HeaderProps>, default: undefined },
headless: { type: Boolean, default: undefined },
layoutTool: { type: [Boolean, Object] as PropType<boolean | ProTableLayoutToolPublicProps>, default: true },
pagination: { type: [Boolean, Object] as PropType<boolean | TablePagination>, default: undefined },
scroll: { type: Object as PropType<TableScroll>, default: undefined },
scrollToTopOnChange: { type: Boolean, default: undefined },
size: { type: String as PropType<TableSize>, default: undefined },
spin: { type: [Boolean, Object] as PropType<boolean | SpinProps>, default: undefined },
sticky: { type: [Boolean, Object] as PropType<boolean | TableSticky>, default: undefined },
tableLayout: { type: String as PropType<'auto' | 'fixed'>, default: undefined },
toolbar: { type: Array as PropType<Array<VNodeChild>>, default: undefined },
virtual: { type: Boolean, default: false },

// events
'onUpdate:expandedRowKeys': [Function, Array] as PropType<MaybeArray<(keys: any[]) => void>>,
'onUpdate:selectedRowKeys': [Function, Array] as PropType<MaybeArray<(keys: any[]) => void>>,
onColumnsChange: [Function, Array] as PropType<MaybeArray<(columns: ProTableColumn[]) => void>>,
onScroll: [Function, Array] as PropType<MaybeArray<(evt: Event) => void>>,
onScrolledChange: [Function, Array] as PropType<
MaybeArray<(startIndex: number, endIndex: number, visibleData: any[]) => void>
>,
onScrolledBottom: [Function, Array] as PropType<MaybeArray<() => void>>,
} as const

export type ProTableProps = ExtractInnerPropTypes<typeof proTableProps>
Expand Down

0 comments on commit edb23d4

Please sign in to comment.