{"version":3,"file":"table.mjs","sources":["../../../../../../packages/components/table-v2/src/table.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport {\n virtualizedGridProps,\n virtualizedScrollbarProps,\n} from '@element-plus/components/virtual-list'\nimport {\n classType,\n columns,\n dataType,\n expandKeys,\n fixedDataType,\n requiredNumber,\n rowKey,\n} from './common'\nimport { tableV2RowProps } from './row'\nimport { tableV2HeaderProps } from './header'\nimport { tableV2GridProps } from './grid'\n\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\nimport type { SortOrder } from './constants'\nimport type {\n Column,\n ColumnCommonParams,\n DataGetter,\n KeyType,\n RowCommonParams,\n SortBy,\n SortState,\n} from './types'\n\n/**\n * Param types\n */\nexport type ColumnSortParams = {\n column: Column\n key: KeyType\n order: SortOrder\n}\n\n/**\n * Renderer/Getter types\n */\n\nexport type ExtraCellPropGetter = (\n params: ColumnCommonParams &\n RowCommonParams & { cellData: T; rowData: any }\n) => any\n\nexport type ExtractHeaderPropGetter = (params: {\n columns: Column[]\n headerIndex: number\n}) => any\n\nexport type ExtractHeaderCellPropGetter = (\n params: ColumnCommonParams & { headerIndex: number }\n) => any\n\nexport type ExtractRowPropGetter = (\n params: { columns: Column[] } & RowCommonParams\n) => any\n\nexport type HeaderClassNameGetter = (params: {\n columns: Column[]\n headerIndex: number\n}) => string\n\nexport type RowClassNameGetter = (\n params: { columns: Column[] } & RowCommonParams\n) => string\n\n/**\n * Handler types\n */\nexport type ColumnSortHandler = (params: ColumnSortParams) => void\nexport type ColumnResizeHandler = (column: Column, width: number) => void\nexport type ExpandedRowsChangeHandler = (expandedRowKeys: KeyType[]) => void\n\nexport const tableV2Props = buildProps({\n cache: tableV2GridProps.cache,\n estimatedRowHeight: tableV2RowProps.estimatedRowHeight,\n rowKey,\n // Header attributes\n headerClass: {\n type: definePropType>([\n String,\n Function,\n ]),\n },\n headerProps: {\n type: definePropType>([\n Object,\n Function,\n ]),\n },\n headerCellProps: {\n type: definePropType>([\n Object,\n Function,\n ]),\n },\n headerHeight: tableV2HeaderProps.headerHeight,\n /**\n * Footer attributes\n */\n footerHeight: {\n type: Number,\n default: 0,\n },\n /**\n * Row attributes\n */\n rowClass: {\n type: definePropType>([String, Function]),\n },\n rowProps: {\n type: definePropType | any>([Object, Function]),\n },\n rowHeight: {\n type: Number,\n default: 50,\n },\n\n /**\n * Cell attributes\n */\n cellProps: {\n type: definePropType | ExtraCellPropGetter>([\n Object,\n Function,\n ]),\n },\n /**\n * Data models\n */\n columns,\n data: dataType,\n dataGetter: {\n type: definePropType>(Function),\n },\n fixedData: fixedDataType,\n /**\n * Expanded keys\n */\n expandColumnKey: tableV2RowProps.expandColumnKey,\n expandedRowKeys: expandKeys,\n defaultExpandedRowKeys: expandKeys,\n\n /**\n * Attributes\n */\n class: classType,\n // disabled: Boolean,\n fixed: Boolean,\n style: {\n type: definePropType(Object),\n },\n width: requiredNumber,\n height: requiredNumber,\n maxHeight: Number,\n useIsScrolling: Boolean,\n indentSize: {\n type: Number,\n default: 12,\n },\n iconSize: {\n type: Number,\n default: 12,\n },\n hScrollbarSize: virtualizedGridProps.hScrollbarSize,\n vScrollbarSize: virtualizedGridProps.vScrollbarSize,\n scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn,\n\n /**\n * Sorting\n */\n sortBy: {\n type: definePropType(Object),\n default: () => ({} as { key: KeyType; order: SortOrder }),\n },\n sortState: {\n type: definePropType(Object),\n default: undefined,\n },\n\n /**\n * Handlers\n */\n onColumnSort: {\n type: definePropType>(Function),\n },\n onExpandedRowsChange: {\n type: definePropType(Function),\n },\n onEndReached: {\n type: definePropType<(distance: number) => void>(Function),\n },\n onRowExpand: tableV2RowProps.onRowExpand,\n onScroll: tableV2GridProps.onScroll,\n onRowsRendered: tableV2GridProps.onRowsRendered,\n rowEventHandlers: tableV2RowProps.rowEventHandlers,\n} as const)\n\nexport type TableV2Props = ExtractPropTypes\n"],"names":[],"mappings":";;;;;;;;;AAiBY,MAAC,YAAY,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