element-plus
Version:
A Component Library for Vue 3
1 lines • 3.44 kB
Source Map (JSON)
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/table-v2/src/row.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { virtualizedGridProps } from '@element-plus/components/virtual-list'\nimport { columns, expandColumnKey, rowKey } from './common'\n\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type { FixedDirection, KeyType, RowCommonParams } from './types'\n\nexport type RowExpandParams = {\n expanded: boolean\n rowKey: KeyType\n} & RowCommonParams\n\nexport type RowHoverParams = {\n event?: MouseEvent\n hovered: boolean\n rowKey: KeyType\n} & Partial<RowCommonParams>\n\nexport type RowEventHandlerParams = {\n rowKey: KeyType\n event: Event\n} & RowCommonParams\n\nexport type RowHeightChangedParams = {\n rowKey: KeyType\n height: number\n rowIndex: number\n}\n\nexport type RowExpandHandler = (params: RowExpandParams) => void\nexport type RowHoverHandler = (params: RowHoverParams) => void\nexport type RowEventHandler = (params: RowEventHandlerParams) => void\nexport type RowHeightChangeHandler = (\n row: RowHeightChangedParams,\n fixedDirection: boolean | FixedDirection | undefined\n) => void\n\nexport type RowEventHandlers = {\n onClick?: RowEventHandler\n onContextmenu?: RowEventHandler\n onDblclick?: RowEventHandler\n onMouseenter?: RowEventHandler\n onMouseleave?: RowEventHandler\n}\n\nexport const tableV2RowProps = buildProps({\n class: String,\n columns,\n columnsStyles: {\n type: definePropType<Record<KeyType, CSSProperties>>(Object),\n required: true,\n },\n depth: Number,\n expandColumnKey,\n estimatedRowHeight: {\n ...virtualizedGridProps.estimatedRowHeight,\n default: undefined,\n },\n isScrolling: Boolean,\n onRowExpand: {\n type: definePropType<RowExpandHandler>(Function),\n },\n onRowHover: {\n type: definePropType<RowHoverHandler>(Function),\n },\n onRowHeightChange: {\n type: definePropType<RowHeightChangeHandler>(Function),\n },\n rowData: {\n type: definePropType<any>(Object),\n required: true,\n },\n rowEventHandlers: {\n type: definePropType<RowEventHandlers>(Object),\n },\n rowIndex: {\n type: Number,\n required: true,\n },\n /**\n * Unique item key\n */\n rowKey,\n style: {\n type: definePropType<CSSProperties>(Object),\n },\n} as const)\n\nexport type TableV2RowProps = ExtractPropTypes<typeof tableV2RowProps>\nexport type TableV2RowPropsPublic = ExtractPublicPropTypes<\n typeof tableV2RowProps\n>\n"],"names":[],"mappings":";;;;AAiDO,MAAM,kBAAkB,UAAA,CAAW;AAAA,EACxC,KAAA,EAAO,MAAA;AAAA,EACP,OAAA;AAAA,EACA,aAAA,EAAe;AAAA,IACb,IAAA,EAAM,eAA+C,MAAM,CAAA;AAAA,IAC3D,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,KAAA,EAAO,MAAA;AAAA,EACP,eAAA;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,GAAG,oBAAA,CAAqB,kBAAA;AAAA,IACxB,OAAA,EAAS;AAAA,GACX;AAAA,EACA,WAAA,EAAa,OAAA;AAAA,EACb,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,eAAiC,QAAQ;AAAA,GACjD;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAgC,QAAQ;AAAA,GAChD;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,IAAA,EAAM,eAAuC,QAAQ;AAAA,GACvD;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,eAAoB,MAAM,CAAA;AAAA,IAChC,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,IAAA,EAAM,eAAiC,MAAM;AAAA,GAC/C;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,QAAA,EAAU;AAAA,GACZ;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,eAA8B,MAAM;AAAA;AAE9C,CAAU;;;;"}