{"version":3,"file":"table.js","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":["buildProps","tableV2GridProps","tableV2RowProps","rowKey","definePropType","tableV2HeaderProps","columns","dataType","fixedDataType","expandKeys","classType","requiredNumber","virtualizedGridProps","virtualizedScrollbarProps"],"mappings":";;;;;;;;;;;;;AAiBY,MAAC,YAAY,GAAGA,kBAAU,CAAC;AACvC,EAAE,KAAK,EAAEC,qBAAgB,CAAC,KAAK;AAC/B,EAAE,kBAAkB,EAAEC,mBAAe,CAAC,kBAAkB;AACxD,UAAEC,aAAM;AACR,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEC,sBAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,KAAK,CAAC;AACN,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,sBAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,KAAK,CAAC;AACN,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAEA,sBAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,KAAK,CAAC;AACN,GAAG;AACH,EAAE,YAAY,EAAEC,yBAAkB,CAAC,YAAY;AAC/C,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAED,sBAAc,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC5C,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEA,sBAAc,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC5C,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEA,sBAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,KAAK,CAAC;AACN,GAAG;AACH,WAAEE,cAAO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