UNPKG

@tplc/wot

Version:

106 lines (105 loc) 2.64 kB
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue' import type { TableColumnProps } from '../wd-table-col/types' export declare const tableProps: { /** * 显示的数据 */ data: { type: { (arrayLength: number): Record<string, any>[] (...items: Record<string, any>[]): Record<string, any>[] new (arrayLength: number): Record<string, any>[] new (...items: Record<string, any>[]): Record<string, any>[] isArray(arg: any): arg is any[] readonly prototype: any[] from<T>(arrayLike: ArrayLike<T>): T[] from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[] from<T>(iterable: Iterable<T> | ArrayLike<T>): T[] from<T, U>( iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any, ): U[] of<T>(...items: T[]): T[] fromAsync<T>( iterableOrArrayLike: | AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>, ): Promise<T[]> fromAsync<T, U>( iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any, ): Promise<Awaited<U>[]> readonly [Symbol.species]: ArrayConstructor } required: true } /** * 是否带有边框 */ border: { type: BooleanConstructor default: boolean } /** * 是否为斑马纹 table */ stripe: { type: BooleanConstructor default: boolean } /** * Table 的高度 */ height: { type: PropType<string> default: string } /** * 行高 */ rowHeight: { type: NumberConstructor default: number } /** * 是否显示表头 */ showHeader: { type: BooleanConstructor default: boolean } /** * 是否超出2行隐藏 */ ellipsis: { type: BooleanConstructor default: boolean } /** * 是否显示索引列 */ index: { type: PropType<boolean | Omit<Partial<TableColumnProps>, 'prop'>> default: boolean } customStyle: { type: PropType<string> default: string } customClass: { type: PropType<string> default: string } } export type TableProps = ExtractPropTypes<typeof tableProps> export type TableProvide = { props: Omit<TableProps, 'index' | 'customStyle' | 'customClass'> scrollLeft: number rowClick: (index: number) => void getIsLastFixed: (column: { fixed: boolean; prop: string }) => boolean getFixedStyle: (index: number, style: CSSProperties) => CSSProperties } export declare const TABLE_KEY: symbol