UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2.58 kB
{"version":3,"file":"grid.mjs","names":[],"sources":["../../../../../../packages/components/table-v2/src/grid.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport {\n virtualizedGridProps,\n virtualizedListProps,\n} from '@element-plus/components/virtual-list'\nimport {\n classType,\n columns,\n dataType,\n fixedDataType,\n requiredNumber,\n styleType,\n} from './common'\nimport { tableV2HeaderProps } from './header'\nimport { tableV2RowProps } from './row'\n\nimport type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue'\nimport type { ItemSize } from '@element-plus/components/virtual-list'\n\nexport type onRowRenderedParams = {\n rowCacheStart: number\n rowCacheEnd: number\n rowVisibleStart: number\n rowVisibleEnd: number\n}\n\nexport const tableV2GridProps = buildProps({\n columns,\n data: dataType,\n fixedData: fixedDataType,\n estimatedRowHeight: tableV2RowProps.estimatedRowHeight,\n\n /**\n * Size related attributes\n */\n width: requiredNumber,\n height: requiredNumber,\n\n headerWidth: requiredNumber,\n headerHeight: tableV2HeaderProps.headerHeight,\n\n bodyWidth: requiredNumber,\n rowHeight: requiredNumber,\n\n /**\n * Special attributes\n */\n cache: virtualizedListProps.cache,\n useIsScrolling: Boolean,\n scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn,\n scrollbarStartGap: virtualizedGridProps.scrollbarStartGap,\n scrollbarEndGap: virtualizedGridProps.scrollbarEndGap,\n\n /**\n * CSS attributes\n */\n class: classType,\n style: styleType,\n containerStyle: styleType,\n\n getRowHeight: {\n type: definePropType<ItemSize>(Function),\n required: true,\n },\n rowKey: tableV2RowProps.rowKey,\n\n /**\n * Event handlers\n */\n onRowsRendered: {\n type: definePropType<(params: onRowRenderedParams) => void>(Function),\n },\n onScroll: {\n type: definePropType<(...args: any[]) => void>(Function),\n },\n} as const)\n\nexport type TableV2GridProps = ExtractPropTypes<typeof tableV2GridProps>\nexport type TableV2GridPropsPublic = ExtractPublicPropTypes<\n typeof tableV2GridProps\n>\n"],"mappings":";;;;;;;AA0BA,MAAa,mBAAmB,WAAW;CACzC;CACA,MAAM;CACN,WAAW;CACX,oBAAoB,gBAAgB;CAKpC,OAAO;CACP,QAAQ;CAER,aAAa;CACb,cAAc,mBAAmB;CAEjC,WAAW;CACX,WAAW;CAKX,OAAO,qBAAqB;CAC5B,gBAAgB;CAChB,mBAAmB,qBAAqB;CACxC,mBAAmB,qBAAqB;CACxC,iBAAiB,qBAAqB;CAKtC,OAAO;CACP,OAAO;CACP,gBAAgB;CAEhB,cAAc;EACZ,MAAM,eAAyB,SAAS;EACxC,UAAU;EACX;CACD,QAAQ,gBAAgB;CAKxB,gBAAgB,EACd,MAAM,eAAsD,SAAS,EACtE;CACD,UAAU,EACR,MAAM,eAAyC,SAAS,EACzD;CACF,CAAU"}