tdesign-vue
Version:
326 lines (325 loc) • 12.8 kB
TypeScript
import { PropType } from '@vue/composition-api';
import { TableRowData, PrimaryTableCol, PrimaryTableRowEditContext, PrimaryTableRowValidateContext, TdBaseTableProps } from './type';
import { TableClassName } from './hooks/useClassName';
import { AllValidateResult } from '../form/type';
export interface OnEditableChangeContext<T> extends PrimaryTableRowEditContext<T> {
isEdit: boolean;
validateEdit: (trigger: 'self' | 'parent') => Promise<true | AllValidateResult[]>;
}
export interface EditableCellProps {
rowKey: string;
row: TableRowData;
rowIndex: number;
col: PrimaryTableCol<TableRowData>;
colIndex: number;
oldCell: PrimaryTableCol<TableRowData>['cell'];
tableBaseClass?: TableClassName['tableBaseClass'];
editable?: boolean;
readonly?: boolean;
errors?: AllValidateResult[];
cellEmptyContent?: TdBaseTableProps['cellEmptyContent'];
onChange?: (context: PrimaryTableRowEditContext<TableRowData>) => void;
onValidate?: (context: PrimaryTableRowValidateContext<TableRowData>) => void;
onRuleChange?: (context: PrimaryTableRowEditContext<TableRowData>) => void;
onEditableChange?: (context: OnEditableChangeContext<TableRowData>) => void;
}
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
editValue: import("@vue/composition-api").Ref<any>;
isEdit: import("@vue/composition-api").Ref<boolean>;
cellNode: import("@vue/composition-api").ComputedRef<any>;
isAbortEditOnChange: import("@vue/composition-api").ComputedRef<boolean>;
listeners: import("@vue/composition-api").ComputedRef<{
[key: string]: Function;
}>;
componentProps: import("@vue/composition-api").ComputedRef<any>;
tableEditableCellRef: any;
errorList: import("@vue/composition-api").Ref<AllValidateResult[]>;
currentRow: import("@vue/composition-api").ComputedRef<{
[x: string]: any;
children?: TableRowData[];
}>;
editOnListeners: import("@vue/composition-api").ComputedRef<{
[eventName: string]: Function;
}>;
onEditChange: (val: any, ...args: any) => void;
Edit1Icon: import("tdesign-icons-vue").GlobalIconType;
validateEdit: (trigger: 'self' | 'parent') => Promise<true | AllValidateResult[]>;
onCellClick: (e: MouseEvent) => void;
cellParams: import("@vue/composition-api").ComputedRef<{
rowIndex: number;
colIndex: number;
col: PrimaryTableCol<TableRowData>;
row: TableRowData;
}>;
}> & import("@vue/composition-api").Data, {}, {}, {
rowKey: StringConstructor;
row: PropType<TableRowData>;
rowIndex: NumberConstructor;
col: PropType<PrimaryTableCol<TableRowData>>;
colIndex: NumberConstructor;
oldCell: PropType<string | ((h: import("vue").CreateElement, props: import("./type").PrimaryTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue)>;
tableBaseClass: PropType<{
table: (string | {
[x: string]: boolean;
})[];
columnResizableTable: string;
overflowVisible: string;
body: string;
content: string;
topContent: string;
bottomContent: string;
paginationWrap: string;
tdLastRow: string;
tdFirstCol: string;
thCellInner: string;
tableRowEdit: string;
cellEditable: string;
cellEditWrap: string;
bordered: string;
striped: string;
hover: string;
loading: string;
rowspanAndColspan: string;
empty: string;
emptyRow: string;
headerFixed: string;
columnFixed: string;
widthOverflow: string;
multipleHeader: string;
footerAffixed: string;
horizontalBarAffixed: string;
affixedHeader: string;
affixedHeaderElm: string;
affixedFooterElm: string;
affixedFooterWrap: string;
scrollbarDivider: string;
fullHeight: string;
resizeLine: string;
obviousScrollbar: string;
affixedHeaderWrap: string;
}>;
cellEmptyContent: PropType<string | ((h: import("vue").CreateElement, props: import("./type").BaseTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue)>;
editable: {
type: BooleanConstructor;
default: any;
};
readonly: {
type: BooleanConstructor;
};
errors: {
type: PropType<AllValidateResult[]>;
default: any;
};
onChange: PropType<(context: PrimaryTableRowEditContext<TableRowData>) => void>;
onValidate: PropType<(context: PrimaryTableRowValidateContext<TableRowData>) => void>;
onRuleChange: PropType<(context: PrimaryTableRowEditContext<TableRowData>) => void>;
onEditableChange: PropType<(context: OnEditableChangeContext<TableRowData>) => void>;
}, import("@vue/composition-api").ExtractPropTypes<{
rowKey: StringConstructor;
row: PropType<TableRowData>;
rowIndex: NumberConstructor;
col: PropType<PrimaryTableCol<TableRowData>>;
colIndex: NumberConstructor;
oldCell: PropType<string | ((h: import("vue").CreateElement, props: import("./type").PrimaryTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue)>;
tableBaseClass: PropType<{
table: (string | {
[x: string]: boolean;
})[];
columnResizableTable: string;
overflowVisible: string;
body: string;
content: string;
topContent: string;
bottomContent: string;
paginationWrap: string;
tdLastRow: string;
tdFirstCol: string;
thCellInner: string;
tableRowEdit: string;
cellEditable: string;
cellEditWrap: string;
bordered: string;
striped: string;
hover: string;
loading: string;
rowspanAndColspan: string;
empty: string;
emptyRow: string;
headerFixed: string;
columnFixed: string;
widthOverflow: string;
multipleHeader: string;
footerAffixed: string;
horizontalBarAffixed: string;
affixedHeader: string;
affixedHeaderElm: string;
affixedFooterElm: string;
affixedFooterWrap: string;
scrollbarDivider: string;
fullHeight: string;
resizeLine: string;
obviousScrollbar: string;
affixedHeaderWrap: string;
}>;
cellEmptyContent: PropType<string | ((h: import("vue").CreateElement, props: import("./type").BaseTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue)>;
editable: {
type: BooleanConstructor;
default: any;
};
readonly: {
type: BooleanConstructor;
};
errors: {
type: PropType<AllValidateResult[]>;
default: any;
};
onChange: PropType<(context: PrimaryTableRowEditContext<TableRowData>) => void>;
onValidate: PropType<(context: PrimaryTableRowValidateContext<TableRowData>) => void>;
onRuleChange: PropType<(context: PrimaryTableRowEditContext<TableRowData>) => void>;
onEditableChange: PropType<(context: OnEditableChangeContext<TableRowData>) => void>;
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
readonly: boolean;
editable: boolean;
errors: AllValidateResult[];
} & {
col?: unknown;
onChange?: (context: PrimaryTableRowEditContext<TableRowData>) => void;
onValidate?: (context: PrimaryTableRowValidateContext<TableRowData>) => void;
rowIndex?: number;
row?: unknown;
cellEmptyContent?: string | ((h: import("vue").CreateElement, props: import("./type").BaseTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue);
rowKey?: string;
colIndex?: number;
tableBaseClass?: {
table: (string | {
[x: string]: boolean;
})[];
columnResizableTable: string;
overflowVisible: string;
body: string;
content: string;
topContent: string;
bottomContent: string;
paginationWrap: string;
tdLastRow: string;
tdFirstCol: string;
thCellInner: string;
tableRowEdit: string;
cellEditable: string;
cellEditWrap: string;
bordered: string;
striped: string;
hover: string;
loading: string;
rowspanAndColspan: string;
empty: string;
emptyRow: string;
headerFixed: string;
columnFixed: string;
widthOverflow: string;
multipleHeader: string;
footerAffixed: string;
horizontalBarAffixed: string;
affixedHeader: string;
affixedHeaderElm: string;
affixedFooterElm: string;
affixedFooterWrap: string;
scrollbarDivider: string;
fullHeight: string;
resizeLine: string;
obviousScrollbar: string;
affixedHeaderWrap: string;
};
oldCell?: string | ((h: import("vue").CreateElement, props: import("./type").PrimaryTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue);
onRuleChange?: (context: PrimaryTableRowEditContext<TableRowData>) => void;
onEditableChange?: (context: OnEditableChangeContext<TableRowData>) => void;
}, import("@vue/composition-api").ShallowUnwrapRef<{
editValue: import("@vue/composition-api").Ref<any>;
isEdit: import("@vue/composition-api").Ref<boolean>;
cellNode: import("@vue/composition-api").ComputedRef<any>;
isAbortEditOnChange: import("@vue/composition-api").ComputedRef<boolean>;
listeners: import("@vue/composition-api").ComputedRef<{
[key: string]: Function;
}>;
componentProps: import("@vue/composition-api").ComputedRef<any>;
tableEditableCellRef: any;
errorList: import("@vue/composition-api").Ref<AllValidateResult[]>;
currentRow: import("@vue/composition-api").ComputedRef<{
[x: string]: any;
children?: TableRowData[];
}>;
editOnListeners: import("@vue/composition-api").ComputedRef<{
[eventName: string]: Function;
}>;
onEditChange: (val: any, ...args: any) => void;
Edit1Icon: import("tdesign-icons-vue").GlobalIconType;
validateEdit: (trigger: 'self' | 'parent') => Promise<true | AllValidateResult[]>;
onCellClick: (e: MouseEvent) => void;
cellParams: import("@vue/composition-api").ComputedRef<{
rowIndex: number;
colIndex: number;
col: PrimaryTableCol<TableRowData>;
row: TableRowData;
}>;
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
readonly: boolean;
editable: boolean;
errors: AllValidateResult[];
} & {
col?: unknown;
onChange?: (context: PrimaryTableRowEditContext<TableRowData>) => void;
onValidate?: (context: PrimaryTableRowValidateContext<TableRowData>) => void;
rowIndex?: number;
row?: unknown;
cellEmptyContent?: string | ((h: import("vue").CreateElement, props: import("./type").BaseTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue);
rowKey?: string;
colIndex?: number;
tableBaseClass?: {
table: (string | {
[x: string]: boolean;
})[];
columnResizableTable: string;
overflowVisible: string;
body: string;
content: string;
topContent: string;
bottomContent: string;
paginationWrap: string;
tdLastRow: string;
tdFirstCol: string;
thCellInner: string;
tableRowEdit: string;
cellEditable: string;
cellEditWrap: string;
bordered: string;
striped: string;
hover: string;
loading: string;
rowspanAndColspan: string;
empty: string;
emptyRow: string;
headerFixed: string;
columnFixed: string;
widthOverflow: string;
multipleHeader: string;
footerAffixed: string;
horizontalBarAffixed: string;
affixedHeader: string;
affixedHeaderElm: string;
affixedFooterElm: string;
affixedFooterWrap: string;
scrollbarDivider: string;
fullHeight: string;
resizeLine: string;
obviousScrollbar: string;
affixedHeaderWrap: string;
};
oldCell?: string | ((h: import("vue").CreateElement, props: import("./type").PrimaryTableCellParams<TableRowData>) => import("vue/types/vnode").ScopedSlotReturnValue);
onRuleChange?: (context: PrimaryTableRowEditContext<TableRowData>) => void;
onEditableChange?: (context: OnEditableChangeContext<TableRowData>) => void;
}, {
readonly: boolean;
editable: boolean;
errors: AllValidateResult[];
}, true>);
export default _default;