mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
- Add column-resizer for resizing column - Add sort and column resizer to row header renderer
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import { definePropType, mutable } from '@element-plus/utils'
|
|
|
|
import type { CSSProperties } from 'vue'
|
|
import type { Column, KeyType } from './types'
|
|
|
|
export type AnyColumn = Column<any>
|
|
|
|
/**
|
|
* @Note even though we can use `string[] | string` as the type but for
|
|
* convenience here we only use `string` as the acceptable value here.
|
|
*/
|
|
export const classType = String
|
|
|
|
export const columns = {
|
|
type: definePropType<AnyColumn[]>(Array),
|
|
required: true,
|
|
} as const
|
|
|
|
export const column = {
|
|
type: definePropType<AnyColumn>(Object),
|
|
} as const
|
|
|
|
export const fixedDataType = {
|
|
type: definePropType<any[]>(Array),
|
|
} as const
|
|
|
|
export const dataType = {
|
|
...fixedDataType,
|
|
required: true,
|
|
} as const
|
|
|
|
export const expandColumnKey = String
|
|
|
|
export const expandKeys = {
|
|
type: definePropType<KeyType[]>(Array),
|
|
default: () => mutable([]),
|
|
} as const
|
|
|
|
export const requiredNumber = {
|
|
type: Number,
|
|
required: true,
|
|
} as const
|
|
|
|
export const rowKey = {
|
|
type: definePropType<KeyType>([String, Number, Symbol]),
|
|
default: 'id',
|
|
} as const
|
|
|
|
/**
|
|
* @note even though we can use `StyleValue` but that would be difficult for us to mapping them,
|
|
* so we only use `CSSProperties` as the acceptable value here.
|
|
*/
|
|
export const styleType = {
|
|
type: definePropType<CSSProperties>(Object),
|
|
}
|