New Changes with Page Request
This commit is contained in:
+15
-19
@@ -38,15 +38,20 @@ export interface TableProps<T> {
|
|||||||
rowClick?: string;
|
rowClick?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ClientJoin = {
|
export type Sort = {
|
||||||
|
column: string;
|
||||||
|
direction: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Join = {
|
||||||
type?: "INNER" | "LEFT" | "RIGHT";
|
type?: "INNER" | "LEFT" | "RIGHT";
|
||||||
table: string;
|
table: string;
|
||||||
alias?: string;
|
alias?: string;
|
||||||
on: string;
|
on: string;
|
||||||
selectCols?: string[];
|
columns?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ClientFilter = {
|
export type Filter = {
|
||||||
column: string;
|
column: string;
|
||||||
operator:
|
operator:
|
||||||
| "=" | "!=" | ">" | "<" | ">=" | "<="
|
| "=" | "!=" | ">" | "<" | ">=" | "<="
|
||||||
@@ -55,35 +60,26 @@ export type ClientFilter = {
|
|||||||
| "@>"
|
| "@>"
|
||||||
| "IS NULL" | "IS NOT NULL";
|
| "IS NULL" | "IS NOT NULL";
|
||||||
value?: unknown;
|
value?: unknown;
|
||||||
logical?: "AND" | "OR";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ClientFetchOptions = {
|
export type TableFetchOptions = {
|
||||||
table: string;
|
table: string;
|
||||||
alias?: string;
|
alias?: string;
|
||||||
columns: string[];
|
columns: string[];
|
||||||
|
sort: Sort[]
|
||||||
joinSelectCols?: string[];
|
joinSelectCols?: string[];
|
||||||
joins?: ClientJoin[];
|
joins?: Join[];
|
||||||
sortable?: Record<string, string>;
|
filters?: Filter[];
|
||||||
searchColumns?: string[];
|
|
||||||
softDeleteCol?: string;
|
|
||||||
softDeleteOp?: "IS NULL" | "=" | "!=";
|
|
||||||
softDeleteValue?: unknown;
|
|
||||||
defaultFilters?: ClientFilter[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TableRequest = {
|
export type TablePageRequest = {
|
||||||
page: number;
|
page: number;
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
sortKey?: string;
|
|
||||||
sortOrder?: "ASC" | "DESC";
|
|
||||||
search?: string;
|
|
||||||
filters?: ClientFilter[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TableRequestBody = {
|
export type TableRequestBody = {
|
||||||
req: TableRequest;
|
page: TablePageRequest;
|
||||||
opts: ClientFetchOptions;
|
opts: TableFetchOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface TableResponse<T> {
|
export interface TableResponse<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user