@seemusic/ui-components
Version:
A Vue 3 UI Library. Uses Composable.
66 lines (65 loc) • 2.26 kB
TypeScript
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType, VNode } from 'vue';
import type { Column, PaginationProps } from 'element-plus';
import type { Recordable } from '../../shims';
export type Mutable<Type> = {
-readonly [Key in keyof Type]: Type[Key];
};
export type ComponentsType = 'ElInput' | 'ElInputNumber' | 'ElSelect' | 'ElSwitch' | 'ElTimeSelect' | 'ElTimePicker' | 'ElSelectV2' | 'ElDatePicker' | 'ElCascader';
export interface TableColumn extends Omit<Column, 'width'> {
prop?: string;
customRender?: string;
render?: (scope: Recordable) => VNode;
label?: string;
type?: 'index' | 'selection' | 'expand';
width?: string | number;
placeholder?: string;
editable?: boolean;
editRow?: boolean;
editColumn?: boolean;
editColumnScheduler?: () => Promise<boolean>;
editRule?: boolean;
editComponent?: ComponentsType;
editComponentProps?: Recordable;
}
export interface TableConfig {
isPagination?: boolean;
pagination: Partial<Mutable<PaginationProps>>;
}
declare const _default: DefineComponent<{
columns: {
type: PropType<TableColumn[]>;
required: true;
};
data: {
type: PropType<Recordable[]>;
required: true;
};
config: {
type: PropType<TableConfig>;
default: () => {
isPagination: boolean;
};
};
}, () => JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("current-change" | "edit-column-change" | "size-change")[], "current-change" | "edit-column-change" | "size-change", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
columns: {
type: PropType<TableColumn[]>;
required: true;
};
data: {
type: PropType<Recordable[]>;
required: true;
};
config: {
type: PropType<TableConfig>;
default: () => {
isPagination: boolean;
};
};
}>> & {
"onEdit-column-change"?: (...args: any[]) => any;
"onCurrent-change"?: (...args: any[]) => any;
"onSize-change"?: (...args: any[]) => any;
}, {
config: TableConfig;
}, {}>;
export default _default;