@opensig/opendesign
Version:
340 lines (339 loc) • 11.7 kB
TypeScript
import { TableRowT } from '../table';
import { DataTableConditionUpdatePayload, DataTableSortUpdatePayload, DataTableSelectionPayload, DataTableSelectionChangePayload, DataTableRowKeyValue, EffectiveDataTableColumnT } from './types.ts';
import { DataTableLoadChildrenPayload } from './provide.ts';
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: Readonly<{
/**
* @zh-CN thead插槽
* @en-US Thead slot
*/
header?: (options: {
columns: EffectiveDataTableColumnT[];
groupColumns: EffectiveDataTableColumnT[][];
}) => any;
/**
* @zh-CN 加载状态插槽
* @en-US Loading state slot
*/
loading?: () => any;
/**
* @zh-CN 空状态插槽
* @en-US Empty state slot
*/
empty?: () => any;
} & {
expand?: (scope: {
row: TableRowT;
rowIndex: number;
}) => any;
} & Record<`td_${string}`, (options: {
column: EffectiveDataTableColumnT;
row: TableRowT;
cellValue: any;
index: number;
}) => any> & Record<`th_${string}`, (options: {
column: EffectiveDataTableColumnT;
}) => any>> & {
/**
* @zh-CN thead插槽
* @en-US Thead slot
*/
header?: (options: {
columns: EffectiveDataTableColumnT[];
groupColumns: EffectiveDataTableColumnT[][];
}) => any;
/**
* @zh-CN 加载状态插槽
* @en-US Loading state slot
*/
loading?: () => any;
/**
* @zh-CN 空状态插槽
* @en-US Empty state slot
*/
empty?: () => any;
} & {
expand?: (scope: {
row: TableRowT;
rowIndex: number;
}) => any;
} & Record<`td_${string}`, (options: {
column: EffectiveDataTableColumnT;
row: TableRowT;
cellValue: any;
index: number;
}) => any> & Record<`th_${string}`, (options: {
column: EffectiveDataTableColumnT;
}) => any>;
refs: {
rootRef: HTMLDivElement;
tableEl: HTMLTableElement;
headerRef: HTMLTableSectionElement;
};
rootEl: HTMLDivElement;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
data: {
readonly type: import('vue').PropType<TableRowT[]>;
readonly required: true;
};
columns: {
readonly type: import('vue').PropType<import('./types.ts').DataTableColumnT[]>;
readonly required: true;
};
size: {
readonly type: import('vue').PropType<import('./types.ts').DataTableSizeT>;
readonly default: "medium";
};
height: {
readonly type: import('vue').PropType<number | string>;
};
maxHeight: {
readonly type: import('vue').PropType<number | string>;
readonly default: "fit-content";
};
minTableWidth: {
readonly type: import('vue').PropType<number | string>;
};
rowKey: {
readonly type: import('vue').PropType<string | ((row: TableRowT) => string)>;
readonly default: "id";
};
spanMethod: {
readonly type: import('vue').PropType<import('./types.ts').DataTableSpanMethod>;
readonly default: () => () => undefined;
};
showHeader: {
readonly type: BooleanConstructor;
readonly default: true;
};
headerStyle: {
readonly type: import('vue').PropType<import('./types.ts').DataTableHeaderStyleT>;
readonly default: "fill";
};
sortMode: {
readonly type: import('vue').PropType<import('./types.ts').DataTableSortModeT>;
readonly default: "single";
};
expandMethod: {
readonly type: import('vue').PropType<import('./types.ts').DataTableExpandMethod>;
};
columnResizable: {
readonly type: BooleanConstructor;
readonly default: false;
};
selection: {
readonly type: BooleanConstructor;
readonly default: false;
};
disabledProp: {
readonly type: StringConstructor;
readonly default: "disabled";
};
checkStrictly: {
readonly type: BooleanConstructor;
readonly default: true;
};
stripe: {
readonly type: BooleanConstructor;
readonly default: false;
};
border: {
readonly type: import('vue').PropType<import('../table').TableBorderT>;
readonly default: "row";
};
defaultEmptyCellText: {
readonly type: StringConstructor;
readonly default: "--";
};
emptyLabel: {
readonly type: StringConstructor;
};
loading: {
readonly type: BooleanConstructor;
};
loadingLabel: {
readonly type: StringConstructor;
};
highlightCurrentRow: {
readonly type: BooleanConstructor;
readonly default: false;
};
'expanded-row-keys': {
type: import('vue').PropType<DataTableRowKeyValue[]>;
};
conditions: {
type: import('vue').PropType<Record<string, unknown>>;
};
sortSequence: {
type: import('vue').PropType<string[]>;
};
selectedKeys: {
type: import('vue').PropType<DataTableRowKeyValue[]>;
};
}>, {
getRowKey: (row: TableRowT, rowIndex: number) => DataTableRowKeyValue;
dataColumnMap: Map<string, EffectiveDataTableColumnT>;
dataColumns: import('vue').Ref<EffectiveDataTableColumnT[]>;
groupColumns: import('vue').Ref<EffectiveDataTableColumnT[][]>;
selectAll: () => void;
clearAll: () => void;
expandAll: () => void;
foldAll: () => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
"update:expanded-row-keys": (value: DataTableRowKeyValue[]) => any;
"update:conditions": (value: Record<string, unknown>) => any;
"update:sortSequence": (value: string[]) => any;
"update:selectedKeys": (value: DataTableRowKeyValue[]) => any;
} & {
selection: (payload: DataTableSelectionPayload) => any;
"condition-update": (payload?: DataTableConditionUpdatePayload | undefined) => any;
"sort-update": (payload: DataTableSortUpdatePayload) => any;
"update:selected-keys": (payload: DataTableRowKeyValue[]) => any;
"selection-change": (payload: DataTableSelectionChangePayload) => any;
"selection-all": (allSelected: boolean) => any;
"load-children": (payload: DataTableLoadChildrenPayload) => any;
"column-resize": (column: EffectiveDataTableColumnT, width: number) => any;
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
data: {
readonly type: import('vue').PropType<TableRowT[]>;
readonly required: true;
};
columns: {
readonly type: import('vue').PropType<import('./types.ts').DataTableColumnT[]>;
readonly required: true;
};
size: {
readonly type: import('vue').PropType<import('./types.ts').DataTableSizeT>;
readonly default: "medium";
};
height: {
readonly type: import('vue').PropType<number | string>;
};
maxHeight: {
readonly type: import('vue').PropType<number | string>;
readonly default: "fit-content";
};
minTableWidth: {
readonly type: import('vue').PropType<number | string>;
};
rowKey: {
readonly type: import('vue').PropType<string | ((row: TableRowT) => string)>;
readonly default: "id";
};
spanMethod: {
readonly type: import('vue').PropType<import('./types.ts').DataTableSpanMethod>;
readonly default: () => () => undefined;
};
showHeader: {
readonly type: BooleanConstructor;
readonly default: true;
};
headerStyle: {
readonly type: import('vue').PropType<import('./types.ts').DataTableHeaderStyleT>;
readonly default: "fill";
};
sortMode: {
readonly type: import('vue').PropType<import('./types.ts').DataTableSortModeT>;
readonly default: "single";
};
expandMethod: {
readonly type: import('vue').PropType<import('./types.ts').DataTableExpandMethod>;
};
columnResizable: {
readonly type: BooleanConstructor;
readonly default: false;
};
selection: {
readonly type: BooleanConstructor;
readonly default: false;
};
disabledProp: {
readonly type: StringConstructor;
readonly default: "disabled";
};
checkStrictly: {
readonly type: BooleanConstructor;
readonly default: true;
};
stripe: {
readonly type: BooleanConstructor;
readonly default: false;
};
border: {
readonly type: import('vue').PropType<import('../table').TableBorderT>;
readonly default: "row";
};
defaultEmptyCellText: {
readonly type: StringConstructor;
readonly default: "--";
};
emptyLabel: {
readonly type: StringConstructor;
};
loading: {
readonly type: BooleanConstructor;
};
loadingLabel: {
readonly type: StringConstructor;
};
highlightCurrentRow: {
readonly type: BooleanConstructor;
readonly default: false;
};
'expanded-row-keys': {
type: import('vue').PropType<DataTableRowKeyValue[]>;
};
conditions: {
type: import('vue').PropType<Record<string, unknown>>;
};
sortSequence: {
type: import('vue').PropType<string[]>;
};
selectedKeys: {
type: import('vue').PropType<DataTableRowKeyValue[]>;
};
}>> & Readonly<{
onSelection?: ((payload: DataTableSelectionPayload) => any) | undefined;
"onCondition-update"?: ((payload?: DataTableConditionUpdatePayload | undefined) => any) | undefined;
"onSort-update"?: ((payload: DataTableSortUpdatePayload) => any) | undefined;
"onUpdate:selected-keys"?: ((payload: DataTableRowKeyValue[]) => any) | undefined;
"onSelection-change"?: ((payload: DataTableSelectionChangePayload) => any) | undefined;
"onSelection-all"?: ((allSelected: boolean) => any) | undefined;
"onLoad-children"?: ((payload: DataTableLoadChildrenPayload) => any) | undefined;
"onColumn-resize"?: ((column: EffectiveDataTableColumnT, width: number) => any) | undefined;
"onUpdate:expanded-row-keys"?: ((value: DataTableRowKeyValue[]) => any) | undefined;
"onUpdate:conditions"?: ((value: Record<string, unknown>) => any) | undefined;
"onUpdate:sortSequence"?: ((value: string[]) => any) | undefined;
"onUpdate:selectedKeys"?: ((value: DataTableRowKeyValue[]) => any) | undefined;
}>, {
size: "medium" | "small";
maxHeight: string | number;
border: "none" | "frame" | "all" | "column" | "row" | "row-column" | "row-frame" | "column-frame";
loading: boolean;
stripe: boolean;
highlightCurrentRow: boolean;
rowKey: string | ((row: TableRowT) => string);
spanMethod: import('./types.ts').DataTableSpanMethod;
showHeader: boolean;
headerStyle: "fill" | "split-line";
sortMode: "multiple" | "single";
columnResizable: boolean;
selection: boolean;
disabledProp: string;
checkStrictly: boolean;
defaultEmptyCellText: string;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
rootRef: HTMLDivElement;
tableEl: HTMLTableElement;
headerRef: HTMLTableSectionElement;
}, HTMLDivElement>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};