sti-antd-package 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classTransformer/TransformBoolean/function.d.ts +2 -0
- package/dist/classTransformer/TransformBoolean/index.d.ts +1 -0
- package/dist/classTransformer/TransformDayjs/function.d.ts +2 -0
- package/dist/classTransformer/TransformDayjs/index.d.ts +1 -0
- package/dist/classTransformer/TransformNumber/function.d.ts +2 -0
- package/dist/classTransformer/TransformNumber/index.d.ts +1 -0
- package/dist/classTransformer/index.d.ts +3 -0
- package/dist/components/NumberFormat/types.d.ts +12 -3
- package/dist/components/Select/Async/types.d.ts +2 -2
- package/dist/components/Table/Async/Component.d.ts +5 -0
- package/dist/components/Table/Async/Search/Component.d.ts +4 -0
- package/dist/components/Table/Async/Search/index.d.ts +2 -0
- package/dist/components/Table/Async/Search/types.d.ts +54 -0
- package/dist/components/Table/Async/index.d.ts +2 -0
- package/dist/components/Table/Async/types.d.ts +68 -0
- package/dist/components/Table/CellEditable/Component.d.ts +4 -0
- package/dist/components/Table/CellEditable/index.d.ts +2 -0
- package/dist/components/Table/CellEditable/types.d.ts +13 -0
- package/dist/components/Table/Component.d.ts +5 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/types.d.ts +54 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/context/Config/types.d.ts +3 -0
- package/dist/context/TableAsyncSearch/Context.d.ts +3 -0
- package/dist/context/TableAsyncSearch/Provider.d.ts +6 -0
- package/dist/context/TableAsyncSearch/index.d.ts +3 -0
- package/dist/context/TableAsyncSearch/types.d.ts +61 -0
- package/dist/context/TableRow/Context.d.ts +3 -0
- package/dist/context/TableRow/Provider.d.ts +4 -0
- package/dist/context/TableRow/index.d.ts +3 -0
- package/dist/context/TableRow/types.d.ts +10 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/enums/DateFormat.d.ts +7 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/helpers/colLayout/function.d.ts +11 -0
- package/dist/helpers/colLayout/index.d.ts +1 -0
- package/dist/helpers/color/function.d.ts +2 -0
- package/dist/helpers/getTableAsyncName/function.d.ts +2 -0
- package/dist/helpers/getTableAsyncName/index.d.ts +1 -0
- package/dist/helpers/getTableFilterStorage/function.d.ts +4 -0
- package/dist/helpers/getTableFilterStorage/index.d.ts +1 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/toCamel/function.d.ts +2 -0
- package/dist/helpers/toCamel/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useRemoveError/hook.d.ts +4 -0
- package/dist/hooks/useRemoveError/index.d.ts +1 -0
- package/dist/index.d.ts +350 -47
- package/dist/index.esm.js +2833 -248
- package/dist/index.js +2846 -245
- package/dist/models/BaseModel/Model.d.ts +10 -0
- package/dist/models/BaseModel/index.d.ts +1 -0
- package/dist/models/index.d.ts +1 -0
- package/package.json +11 -3
- package/dist/helpers/colLayout.d.ts +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { formColLayout } from "../../constants";
|
|
1
2
|
import { valueType } from "antd/es/statistic/utils";
|
|
3
|
+
import { Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
2
4
|
import { Ref } from "react";
|
|
3
5
|
import { SourceInfo } from "react-number-format";
|
|
4
6
|
export interface NumberFormatComponentRef {
|
|
@@ -6,6 +8,7 @@ export interface NumberFormatComponentRef {
|
|
|
6
8
|
setValue: React.Dispatch<React.SetStateAction<valueType>>;
|
|
7
9
|
}
|
|
8
10
|
export interface NumberFormatComponentProps {
|
|
11
|
+
noItem?: boolean;
|
|
9
12
|
text?: boolean;
|
|
10
13
|
size?: 'small';
|
|
11
14
|
align?: 'right';
|
|
@@ -17,10 +20,7 @@ export interface NumberFormatComponentProps {
|
|
|
17
20
|
placeholder?: string;
|
|
18
21
|
disabled?: boolean;
|
|
19
22
|
readOnly?: boolean;
|
|
20
|
-
required?: boolean;
|
|
21
23
|
allowNegative?: boolean;
|
|
22
|
-
min?: number;
|
|
23
|
-
max?: number;
|
|
24
24
|
value?: valueType;
|
|
25
25
|
defaultValue?: valueType;
|
|
26
26
|
onChange?: (name: string | undefined, info: SourceInfo) => void;
|
|
@@ -31,7 +31,16 @@ export interface NumberFormatComponentProps {
|
|
|
31
31
|
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
32
32
|
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
33
33
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
34
|
+
formColLayout?: typeof formColLayout;
|
|
34
35
|
name?: string;
|
|
36
|
+
label?: React.ReactNode;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
rules?: Rule[];
|
|
39
|
+
ruleType?: RuleObject['type'];
|
|
40
|
+
ruleMessage?: string;
|
|
41
|
+
ruleMin?: number;
|
|
42
|
+
ruleMax?: number;
|
|
35
43
|
validateStatus?: 'error';
|
|
44
|
+
help?: React.ReactNode;
|
|
36
45
|
ref?: Ref<NumberFormatComponentRef>;
|
|
37
46
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SelectComponentProps, SelectOption } from "../types";
|
|
2
2
|
import { valueType } from "antd/es/statistic/utils";
|
|
3
3
|
import { Ref } from "react";
|
|
4
|
-
export
|
|
4
|
+
export interface SelectAsyncComponentRef {
|
|
5
5
|
setIsInit: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
6
|
options: () => SelectOption[];
|
|
7
7
|
setOptions: React.Dispatch<React.SetStateAction<SelectOption[]>>;
|
|
8
8
|
value: () => string | number | undefined;
|
|
9
9
|
setValue: React.Dispatch<React.SetStateAction<string | number | undefined>>;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export type SelectAsyncComponentProps = SelectComponentProps & {
|
|
12
12
|
initOptions?: SelectOption[];
|
|
13
13
|
initValue?: valueType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TableAsyncSearchProviderProps } from "../../../context";
|
|
2
|
+
import { TableAsyncComponentProps } from "./types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare const TableAsyncComponent: React.FC<TableAsyncComponentProps & TableAsyncSearchProviderProps>;
|
|
5
|
+
export default TableAsyncComponent;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SelectOption } from "../../../Select";
|
|
2
|
+
import { DatePickerProps } from "antd";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export type TableAsyncSearchItemType = "text" | "select" | "select-multiple" | "switch" | "checkbox" | "date" | "date-range";
|
|
5
|
+
interface BaseAsyncSearchItem {
|
|
6
|
+
name: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
space?: 1 | 2;
|
|
9
|
+
initValue?: any;
|
|
10
|
+
type: TableAsyncSearchItemType;
|
|
11
|
+
}
|
|
12
|
+
export type TableAsyncSearchText = BaseAsyncSearchItem & {
|
|
13
|
+
type: "text";
|
|
14
|
+
};
|
|
15
|
+
export type TableAsyncSearchSelect = BaseAsyncSearchItem & {
|
|
16
|
+
type: "select";
|
|
17
|
+
options?: SelectOption[];
|
|
18
|
+
};
|
|
19
|
+
export type TableAsyncSearchLocalSelectMultiple = BaseAsyncSearchItem & {
|
|
20
|
+
type: "select-multiple";
|
|
21
|
+
static: true;
|
|
22
|
+
options: SelectOption[];
|
|
23
|
+
};
|
|
24
|
+
export type TableAsyncSearchFetchSelectMultiple = BaseAsyncSearchItem & {
|
|
25
|
+
type: "select-multiple";
|
|
26
|
+
static?: false;
|
|
27
|
+
fetchOptions?: ((search: string) => Promise<any[]>);
|
|
28
|
+
};
|
|
29
|
+
export type TableAsyncSearchSelectMultiple = TableAsyncSearchLocalSelectMultiple | TableAsyncSearchFetchSelectMultiple;
|
|
30
|
+
export type TableAsyncSearchSwitch = BaseAsyncSearchItem & {
|
|
31
|
+
type: "switch";
|
|
32
|
+
};
|
|
33
|
+
export type TableAsyncSearchCheckbox = BaseAsyncSearchItem & {
|
|
34
|
+
type: "checkbox";
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
};
|
|
37
|
+
export type TableAsyncSearchDate = BaseAsyncSearchItem & {
|
|
38
|
+
type: "date";
|
|
39
|
+
picker?: DatePickerProps['picker'];
|
|
40
|
+
};
|
|
41
|
+
export type TableAsyncSearchDateRange = BaseAsyncSearchItem & {
|
|
42
|
+
type: "date-range";
|
|
43
|
+
picker?: DatePickerProps['picker'];
|
|
44
|
+
};
|
|
45
|
+
export type TableAsyncSearchItem = TableAsyncSearchText | TableAsyncSearchSelect | TableAsyncSearchSelectMultiple | TableAsyncSearchSwitch | TableAsyncSearchCheckbox | TableAsyncSearchDate | TableAsyncSearchDateRange;
|
|
46
|
+
export interface TableAsyncSearchComponentProps {
|
|
47
|
+
noInitSubmit?: boolean;
|
|
48
|
+
noButton?: boolean;
|
|
49
|
+
name?: string;
|
|
50
|
+
items?: TableAsyncSearchItem[];
|
|
51
|
+
header?: React.ReactNode;
|
|
52
|
+
style?: React.CSSProperties;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { TableComponentProps } from "../types";
|
|
2
|
+
import { TableAsyncSearchItem } from "./Search";
|
|
3
|
+
import { AnyObject } from "antd/es/_util/type";
|
|
4
|
+
import { ColumnGroupType, ColumnType, TableRowSelection } from "antd/es/table/interface";
|
|
5
|
+
import { Ref } from "react";
|
|
6
|
+
export type DefaultColumn = (ColumnType | ColumnGroupType);
|
|
7
|
+
export interface DefaultParams {
|
|
8
|
+
page?: number;
|
|
9
|
+
per_page?: number;
|
|
10
|
+
sort_field?: string;
|
|
11
|
+
sort_order?: 'asc' | 'desc';
|
|
12
|
+
q?: string;
|
|
13
|
+
}
|
|
14
|
+
export type YajraColumn = ColumnType & {
|
|
15
|
+
dataIndex?: string | string[];
|
|
16
|
+
dataIndexName?: string | string[];
|
|
17
|
+
searchable?: boolean;
|
|
18
|
+
orderable?: boolean;
|
|
19
|
+
children?: YajraColumn[];
|
|
20
|
+
};
|
|
21
|
+
export interface YajraSearchParams {
|
|
22
|
+
value: string;
|
|
23
|
+
regex: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface YajraColumnParams {
|
|
26
|
+
data: string;
|
|
27
|
+
name: string;
|
|
28
|
+
searchable: boolean;
|
|
29
|
+
orderable: boolean;
|
|
30
|
+
search: YajraSearchParams;
|
|
31
|
+
}
|
|
32
|
+
export interface YajraOrderParams {
|
|
33
|
+
column?: number;
|
|
34
|
+
dir?: 'asc' | 'desc';
|
|
35
|
+
}
|
|
36
|
+
export interface YajraParams {
|
|
37
|
+
columns: YajraColumnParams[];
|
|
38
|
+
order?: YajraOrderParams[];
|
|
39
|
+
start: number;
|
|
40
|
+
length: number;
|
|
41
|
+
search: YajraSearchParams;
|
|
42
|
+
}
|
|
43
|
+
export interface TableParams {
|
|
44
|
+
current?: number;
|
|
45
|
+
pageSize?: number;
|
|
46
|
+
search: string;
|
|
47
|
+
['yajra']?: {
|
|
48
|
+
order?: YajraOrderParams[];
|
|
49
|
+
start?: number;
|
|
50
|
+
length?: number;
|
|
51
|
+
search?: YajraSearchParams;
|
|
52
|
+
};
|
|
53
|
+
['default']?: DefaultParams;
|
|
54
|
+
}
|
|
55
|
+
export interface TableAsyncComponentRef {
|
|
56
|
+
reload: () => void;
|
|
57
|
+
}
|
|
58
|
+
export type TableAsyncComponentProps = TableComponentProps<AnyObject> & {
|
|
59
|
+
search?: boolean;
|
|
60
|
+
searchOnChange?: boolean;
|
|
61
|
+
noReload?: boolean;
|
|
62
|
+
rowSelect?: boolean | {
|
|
63
|
+
getCheckboxProps?: TableRowSelection['getCheckboxProps'];
|
|
64
|
+
};
|
|
65
|
+
name?: string;
|
|
66
|
+
filterFields?: TableAsyncSearchItem[];
|
|
67
|
+
ref?: Ref<TableAsyncComponentRef>;
|
|
68
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BaseModel } from "../../../models";
|
|
2
|
+
import { TableCellEditableProps } from "./types";
|
|
3
|
+
declare const TableCellEditableComponent: <T extends BaseModel<T>>({ title, editable, children, dataIndex, record, handleSave, ...props }: TableCellEditableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default TableCellEditableComponent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from "../../../models";
|
|
2
|
+
export interface TableCellEditableProps<T> {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
editable: boolean;
|
|
5
|
+
dataIndex: string;
|
|
6
|
+
record: BaseModel<T> & {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
handleSave: (record: BaseModel<T> & {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseModel } from "../../models";
|
|
2
|
+
import { TableComponentProps } from "./types";
|
|
3
|
+
import { AnyObject } from "antd/es/_util/type";
|
|
4
|
+
declare const TableComponent: <T extends (BaseModel<T> | AnyObject)>({ noPagination, buttonReload, buttonAdd, buttonMiddle, buttonDelete, search, buttonFilter, size, rowClassName, rowKey, rowSelection, columns, data, expandable, pagination, loading, scroll, sticky, components, summary, onChange, style, }: TableComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default TableComponent;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BaseModel } from "../../models";
|
|
2
|
+
import { AnyObject } from "antd/es/_util/type";
|
|
3
|
+
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
|
+
import { ColumnsType, FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig, TableRowSelection } from "antd/es/table/interface";
|
|
5
|
+
import { TableProps } from "rc-table";
|
|
6
|
+
import { ExpandableConfig, GetRowKey } from "rc-table/lib/interface";
|
|
7
|
+
import { JSXElementConstructor } from "react";
|
|
8
|
+
export interface TableButtonMiddle {
|
|
9
|
+
component: React.ReactElement<any, string | JSXElementConstructor<any>>;
|
|
10
|
+
}
|
|
11
|
+
export interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
|
|
12
|
+
noPagination?: boolean;
|
|
13
|
+
buttonReload?: {
|
|
14
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
15
|
+
href?: string;
|
|
16
|
+
};
|
|
17
|
+
buttonAdd?: {
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
20
|
+
href?: string;
|
|
21
|
+
};
|
|
22
|
+
buttonMiddle?: TableButtonMiddle[];
|
|
23
|
+
buttonDelete?: {
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, selectedRowKeys: React.Key[] | undefined) => void;
|
|
26
|
+
};
|
|
27
|
+
search?: {
|
|
28
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
29
|
+
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
30
|
+
onSearch?: React.MouseEventHandler<HTMLSpanElement>;
|
|
31
|
+
onClear?: React.MouseEventHandler<HTMLSpanElement>;
|
|
32
|
+
};
|
|
33
|
+
buttonFilter?: React.ReactElement<any, string | JSXElementConstructor<any>>;
|
|
34
|
+
size?: SizeType;
|
|
35
|
+
rowClassName?: TableProps<T>['rowClassName'];
|
|
36
|
+
rowKey?: string | GetRowKey<T>;
|
|
37
|
+
rowSelection?: TableRowSelection<T>;
|
|
38
|
+
columns?: ColumnsType<T>;
|
|
39
|
+
data?: T[];
|
|
40
|
+
expandable?: ExpandableConfig<T>;
|
|
41
|
+
pagination?: false | TablePaginationConfig;
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
scroll?: ({
|
|
44
|
+
x?: number | true | string;
|
|
45
|
+
y?: number | string;
|
|
46
|
+
} & {
|
|
47
|
+
scrollToFirstRowOnChange?: boolean;
|
|
48
|
+
});
|
|
49
|
+
sticky?: TableProps['sticky'];
|
|
50
|
+
components?: TableProps<T>['components'];
|
|
51
|
+
summary?: (data: readonly T[]) => React.ReactNode;
|
|
52
|
+
onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<T> | SorterResult<T>[], extra: TableCurrentDataSource<T>) => void;
|
|
53
|
+
style?: React.CSSProperties;
|
|
54
|
+
}
|
|
@@ -32,6 +32,14 @@ export { default as SelectAsyncComponent } from "./Select/Async";
|
|
|
32
32
|
export type { SelectAsyncComponentProps, SelectAsyncComponentRef } from "./Select/Async";
|
|
33
33
|
export { default as SwitchComponent } from "./Switch";
|
|
34
34
|
export type { SwitchComponentProps } from "./Switch";
|
|
35
|
+
export { default as TableComponent } from "./Table";
|
|
36
|
+
export type { TableButtonMiddle, TableComponentProps } from "./Table";
|
|
37
|
+
export { default as TableAsyncComponent } from "./Table/Async";
|
|
38
|
+
export type { DefaultColumn, DefaultParams, TableAsyncComponentProps, TableAsyncComponentRef, TableParams, YajraColumn, YajraColumnParams, YajraOrderParams, YajraParams, YajraSearchParams } from "./Table/Async";
|
|
39
|
+
export { default as TableAsyncSearchComponent } from "./Table/Async/Search";
|
|
40
|
+
export type { TableAsyncSearchCheckbox, TableAsyncSearchComponentProps, TableAsyncSearchDate, TableAsyncSearchDateRange, TableAsyncSearchFetchSelectMultiple, TableAsyncSearchItem, TableAsyncSearchItemType, TableAsyncSearchLocalSelectMultiple, TableAsyncSearchSelect, TableAsyncSearchSelectMultiple, TableAsyncSearchSwitch, TableAsyncSearchText } from "./Table/Async/Search";
|
|
41
|
+
export { default as TableCellEditableComponent } from "./Table/CellEditable";
|
|
42
|
+
export type { TableCellEditableProps } from "./Table/CellEditable";
|
|
35
43
|
export { default as TabsComponent } from "./Tabs";
|
|
36
44
|
export type { TabsComponentProps } from "./Tabs";
|
|
37
45
|
export { default as TagComponent } from "./Tag";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { ThemeConfig } from "antd";
|
|
1
2
|
export type LinkType = "inertia" | "react-router";
|
|
2
3
|
export interface ConfigContextType {
|
|
3
4
|
linkType?: LinkType;
|
|
4
5
|
trailing?: number;
|
|
6
|
+
theme?: ThemeConfig;
|
|
5
7
|
}
|
|
6
8
|
export interface ConfigProviderProps {
|
|
7
9
|
linkType?: LinkType;
|
|
8
10
|
trailing?: number;
|
|
11
|
+
theme?: ThemeConfig;
|
|
9
12
|
children?: React.ReactNode;
|
|
10
13
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DefaultColumn, TableParams, YajraColumn } from "../../components/Table/Async";
|
|
2
|
+
import { TableAsyncSearchItem } from "../../components/Table/Async/Search";
|
|
3
|
+
import { TablePaginationConfig } from "antd";
|
|
4
|
+
import { AnyObject } from "antd/es/_util/type";
|
|
5
|
+
import { SorterResult } from "antd/es/table/interface";
|
|
6
|
+
import { AxiosResponse } from "axios";
|
|
7
|
+
export interface TableAsyncSearchContextType {
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
filters?: AnyObject;
|
|
11
|
+
setFilters?: React.Dispatch<React.SetStateAction<AnyObject>>;
|
|
12
|
+
filterReady?: boolean;
|
|
13
|
+
setFilterReady?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
|
+
tableData?: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
setTableData?: React.Dispatch<React.SetStateAction<{
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>>;
|
|
20
|
+
tableParams?: TableParams;
|
|
21
|
+
setTableParams?: React.Dispatch<React.SetStateAction<TableParams>>;
|
|
22
|
+
tableSearch?: string;
|
|
23
|
+
setTableSearch?: React.Dispatch<React.SetStateAction<string>>;
|
|
24
|
+
selectedRowKeys?: React.Key[];
|
|
25
|
+
setSelectedRowKeys?: React.Dispatch<React.SetStateAction<React.Key[]>>;
|
|
26
|
+
tableParamsFormatter?: (prevState?: TableParams, params?: TableParamsFormatter) => TableParams;
|
|
27
|
+
pagination?: TablePaginationConfig;
|
|
28
|
+
fetchData?: () => void;
|
|
29
|
+
drawerOpen?: boolean;
|
|
30
|
+
setDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
31
|
+
multiSelectedOptions?: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
setMultiSelectedOptions?: React.Dispatch<React.SetStateAction<{
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}>>;
|
|
37
|
+
}
|
|
38
|
+
export type TableAsyncType = "default" | "yajra";
|
|
39
|
+
interface YajraTableProps {
|
|
40
|
+
type: "yajra";
|
|
41
|
+
columns: YajraColumn[];
|
|
42
|
+
}
|
|
43
|
+
interface DefaultTableProps {
|
|
44
|
+
type: "default";
|
|
45
|
+
columns: DefaultColumn[];
|
|
46
|
+
}
|
|
47
|
+
export interface TableParamsFormatter {
|
|
48
|
+
current?: number;
|
|
49
|
+
pageSize?: number;
|
|
50
|
+
sorter?: SorterResult<AnyObject> | SorterResult<AnyObject>[];
|
|
51
|
+
search?: string;
|
|
52
|
+
}
|
|
53
|
+
export type TableAsyncSearchProviderProps = (YajraTableProps | DefaultTableProps) & {
|
|
54
|
+
type: TableAsyncType;
|
|
55
|
+
noPagination?: boolean;
|
|
56
|
+
name?: string;
|
|
57
|
+
defaultPageSize?: number;
|
|
58
|
+
request: (data: {}) => Promise<AxiosResponse>;
|
|
59
|
+
filterFields?: TableAsyncSearchItem[];
|
|
60
|
+
};
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SyntheticListenerMap } from "@dnd-kit/core/dist/hooks/utilities";
|
|
2
|
+
import { FormInstance } from "antd";
|
|
3
|
+
export interface TableRowContextType {
|
|
4
|
+
setActivatorNodeRef?: (element: HTMLElement | null) => void;
|
|
5
|
+
listeners?: SyntheticListenerMap;
|
|
6
|
+
form?: FormInstance<any>;
|
|
7
|
+
}
|
|
8
|
+
export interface TableRowProviderProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
9
|
+
'data-row-key': string;
|
|
10
|
+
}
|
package/dist/context/index.d.ts
CHANGED
|
@@ -2,3 +2,7 @@ export { default as ConfigProvider, useConfig } from "./Config";
|
|
|
2
2
|
export type { ConfigContextType, ConfigProviderProps, LinkType } from "./Config";
|
|
3
3
|
export { default as FeedbackProvider, useFeedback } from "./Feedback";
|
|
4
4
|
export type { FeedbackContextType } from "./Feedback";
|
|
5
|
+
export { useTableAsyncSearch } from "./TableAsyncSearch";
|
|
6
|
+
export type { TableAsyncSearchContextType, TableAsyncSearchProviderProps, TableParamsFormatter, TableAsyncType } from "./TableAsyncSearch";
|
|
7
|
+
export { default as TableRowProvider, useTableRow } from "./TableRow";
|
|
8
|
+
export type { TableRowContextType, TableRowProviderProps } from "./TableRow";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DateFormat } from "./DateFormat";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormColLayout } from "../../constants/formColLayout";
|
|
2
|
+
import { ColSize } from "antd/es/grid";
|
|
3
|
+
declare const colLayout: ({ labelCol, wrapperCol }: FormColLayout) => {
|
|
4
|
+
xs?: ColSize;
|
|
5
|
+
sm?: ColSize;
|
|
6
|
+
md?: ColSize;
|
|
7
|
+
lg?: ColSize;
|
|
8
|
+
xl?: ColSize;
|
|
9
|
+
xxl?: ColSize;
|
|
10
|
+
};
|
|
11
|
+
export default colLayout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { default as colLayout } from "./colLayout";
|
|
2
|
+
export { default as getTableAsyncName } from "./getTableAsyncName";
|
|
3
|
+
export { default as getTableFilterStorage } from "./getTableFilterStorage";
|
|
2
4
|
export { default as selectAsync } from "./selectAsync";
|
|
3
5
|
export type { SelectAsyncFormat, SelectAsyncProps } from "./selectAsync";
|
|
6
|
+
export { default as toCamel } from "./toCamel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useRemoveError } from "./useRemoveError";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./hook";
|