@pdg/react-table 1.0.103 → 1.0.104
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/@types/index.d.ts +1 -1
- package/dist/@types/types.d.ts +11 -11
- package/dist/InfoTable/InfoTable.d.ts +7 -7
- package/dist/InfoTable/InfoTable.types.d.ts +78 -79
- package/dist/InfoTable/index.d.ts +4 -4
- package/dist/SearchTable/SearchTable.d.ts +8 -8
- package/dist/SearchTable/SearchTable.types.d.ts +33 -34
- package/dist/SearchTable/index.d.ts +4 -4
- package/dist/Table/Table.d.ts +8 -8
- package/dist/Table/Table.types.d.ts +129 -130
- package/dist/Table/index.d.ts +4 -4
- package/dist/TableBodyCell/TableBodyCell.d.ts +4 -4
- package/dist/TableBodyCell/TableBodyCell.types.d.ts +18 -18
- package/dist/TableBodyCell/index.d.ts +4 -4
- package/dist/TableBodyRow/TableBodyRow.d.ts +7 -7
- package/dist/TableBodyRow/TableBodyRow.types.d.ts +18 -19
- package/dist/TableBodyRow/index.d.ts +4 -4
- package/dist/TableButton/TableButton.d.ts +4 -4
- package/dist/TableButton/TableButton.types.d.ts +3 -4
- package/dist/TableButton/index.d.ts +4 -4
- package/dist/TableCommonCell/TableCommonCell.d.ts +4 -4
- package/dist/TableCommonCell/TableCommonCell.types.d.ts +11 -11
- package/dist/TableCommonCell/index.d.ts +4 -4
- package/dist/TableContext/TableContext.d.ts +4 -4
- package/dist/TableContext/TableContext.types.d.ts +14 -14
- package/dist/TableContext/index.d.ts +5 -5
- package/dist/TableContext/useTableState.d.ts +2 -2
- package/dist/TableContextProvider/TableContextProvider.d.ts +4 -4
- package/dist/TableContextProvider/TableContextProvider.types.d.ts +6 -6
- package/dist/TableContextProvider/index.d.ts +4 -4
- package/dist/TableFooterCell/TableFooterCell.d.ts +4 -4
- package/dist/TableFooterCell/TableFooterCell.types.d.ts +5 -5
- package/dist/TableFooterCell/index.d.ts +4 -4
- package/dist/TableHeadCell/TableHeadCell.d.ts +4 -4
- package/dist/TableHeadCell/TableHeadCell.types.d.ts +11 -11
- package/dist/TableHeadCell/index.d.ts +4 -4
- package/dist/TableMenuButton/TableMenuButton.d.ts +4 -4
- package/dist/TableMenuButton/TableMenuButton.types.d.ts +9 -10
- package/dist/TableMenuButton/index.d.ts +4 -4
- package/dist/TablePagination/TablePagination.d.ts +4 -4
- package/dist/TablePagination/TablePagination.types.d.ts +13 -13
- package/dist/TablePagination/index.d.ts +4 -4
- package/dist/TableTopHead/TableTopHead.d.ts +4 -4
- package/dist/TableTopHead/TableTopHead.types.d.ts +17 -18
- package/dist/TableTopHead/index.d.ts +4 -4
- package/dist/index.d.ts +7 -7
- package/dist/index.esm.js +1974 -2006
- package/dist/index.js +1974 -2006
- package/package.json +18 -18
- package/dist/@util/index.d.ts +0 -1
- package/dist/@util/table.d.ts +0 -8
- package/dist/InfoTable/InfoTable.style.d.ts +0 -14
- package/dist/Table/Table.styles.d.ts +0 -5
- package/dist/TableTopHead/TableTopHead.style.d.ts +0 -4
package/dist/@types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export * from './types';
|
package/dist/@types/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { SxProps } from '@mui/system';
|
|
3
|
-
import { Theme } from '@mui/material/styles';
|
|
4
|
-
export interface CommonProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
style?: CSSProperties;
|
|
8
|
-
}
|
|
9
|
-
export interface CommonSxProps extends CommonProps {
|
|
10
|
-
sx?: SxProps<Theme>;
|
|
11
|
-
}
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { SxProps } from '@mui/system';
|
|
3
|
+
import { Theme } from '@mui/material/styles';
|
|
4
|
+
export interface CommonProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export interface CommonSxProps extends CommonProps {
|
|
10
|
+
sx?: SxProps<Theme>;
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InfoTableProps as Props, InfoTableInfo } from './InfoTable.types';
|
|
3
|
-
interface WithType<T = InfoTableInfo> extends React.FC<Props<T>> {
|
|
4
|
-
<T = InfoTableInfo>(props: Props<T>): ReturnType<React.FC<Props<T>>>;
|
|
5
|
-
}
|
|
6
|
-
declare const InfoTable: WithType;
|
|
7
|
-
export default InfoTable;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InfoTableProps as Props, InfoTableInfo } from './InfoTable.types';
|
|
3
|
+
interface WithType<T = InfoTableInfo> extends React.FC<Props<T>> {
|
|
4
|
+
<T = InfoTableInfo>(props: Props<T>): ReturnType<React.FC<Props<T>>>;
|
|
5
|
+
}
|
|
6
|
+
declare const InfoTable: WithType;
|
|
7
|
+
export default InfoTable;
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BoxProps, GridProps, IconButtonProps, TypographyProps } from '@mui/material';
|
|
3
|
-
import { CommonSxProps } from '../@types';
|
|
4
|
-
import { PdgIconProps } from '@pdg/react-component';
|
|
5
|
-
export interface InfoTableInfo {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}
|
|
8
|
-
export type InfoTableItemType = 'text' | 'number' | 'tel' | 'url' | 'email' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'divider';
|
|
9
|
-
export interface InfoTableItem<T = InfoTableInfo> {
|
|
10
|
-
icon?: PdgIconProps['children'];
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
name?: keyof T;
|
|
13
|
-
type?: InfoTableItemType;
|
|
14
|
-
ellipsis?: boolean;
|
|
15
|
-
className?: string;
|
|
16
|
-
dateFormat?: string;
|
|
17
|
-
dateTwoLine?: boolean;
|
|
18
|
-
numberPrefix?: string;
|
|
19
|
-
numberSuffix?: string;
|
|
20
|
-
dividerColor?: TypographyProps['color'];
|
|
21
|
-
dividerLine?: boolean;
|
|
22
|
-
style?: CommonSxProps['style'];
|
|
23
|
-
sx?: BoxProps['sx'];
|
|
24
|
-
labelClassName?: string;
|
|
25
|
-
labelColor?: TypographyProps['color'];
|
|
26
|
-
labelStyle?: CommonSxProps['style'];
|
|
27
|
-
labelSx?: BoxProps['sx'];
|
|
28
|
-
valueClassName?: string;
|
|
29
|
-
valueStyle?: CommonSxProps['style'];
|
|
30
|
-
valueSx?: CommonSxProps['sx'];
|
|
31
|
-
xs?: number;
|
|
32
|
-
sm?: number;
|
|
33
|
-
md?: number;
|
|
34
|
-
lg?: number;
|
|
35
|
-
xl?: number;
|
|
36
|
-
clipboard?: boolean;
|
|
37
|
-
clipboardIcon?: string;
|
|
38
|
-
clipboardText?: string;
|
|
39
|
-
clipboardProps?: Omit<IconButtonProps, 'children'>;
|
|
40
|
-
onRender?(info: T): ReactNode;
|
|
41
|
-
onRenderEmpty?(info: T): ReactNode;
|
|
42
|
-
onHide?(info: T): boolean;
|
|
43
|
-
onXs?(info: T): number;
|
|
44
|
-
onSm?(info: T): number;
|
|
45
|
-
onMd?(info: T): number;
|
|
46
|
-
onLg?(info: T): number;
|
|
47
|
-
onXl?(info: T): number;
|
|
48
|
-
}
|
|
49
|
-
export type InfoTableItems<T = InfoTableInfo> = (InfoTableItem<T> | false | undefined | null)[];
|
|
50
|
-
export type InfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
|
|
51
|
-
export interface InfoTableProps<T = InfoTableInfo> {
|
|
52
|
-
cols: InfoTableCols | {
|
|
53
|
-
xs?: InfoTableCols;
|
|
54
|
-
sm?: InfoTableCols;
|
|
55
|
-
md?: InfoTableCols;
|
|
56
|
-
lg?: InfoTableCols;
|
|
57
|
-
xl?: InfoTableCols;
|
|
58
|
-
};
|
|
59
|
-
spacing?: GridProps['spacing'];
|
|
60
|
-
columnSpacing?: GridProps['spacing'];
|
|
61
|
-
rowSpacing?: GridProps['spacing'];
|
|
62
|
-
className?: string;
|
|
63
|
-
style?: CommonSxProps['style'];
|
|
64
|
-
sx?: CommonSxProps['sx'];
|
|
65
|
-
labelClassName?: string;
|
|
66
|
-
labelColor?: TypographyProps['color'];
|
|
67
|
-
labelStyle?: CommonSxProps['style'];
|
|
68
|
-
labelSx?: BoxProps['sx'];
|
|
69
|
-
dividerColor?: TypographyProps['color'];
|
|
70
|
-
valueClassName?: string;
|
|
71
|
-
valueStyle?: CommonSxProps['style'];
|
|
72
|
-
valueSx?: CommonSxProps['sx'];
|
|
73
|
-
ellipsis?: boolean;
|
|
74
|
-
valueUnderline?: boolean;
|
|
75
|
-
info: T;
|
|
76
|
-
items: InfoTableItems<T>;
|
|
77
|
-
onCopyToClipboard?(item: InfoTableItem<T>, text: string): void;
|
|
78
|
-
}
|
|
79
|
-
export declare const InfoTableDefaultProps: Pick<InfoTableProps, 'spacing' | 'columnSpacing' | 'rowSpacing' | 'labelColor' | 'dividerColor'>;
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxProps, GridProps, IconButtonProps, TypographyProps } from '@mui/material';
|
|
3
|
+
import { CommonSxProps } from '../@types';
|
|
4
|
+
import { PdgIconProps } from '@pdg/react-component';
|
|
5
|
+
export interface InfoTableInfo {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export type InfoTableItemType = 'text' | 'number' | 'tel' | 'url' | 'email' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'divider';
|
|
9
|
+
export interface InfoTableItem<T = InfoTableInfo> {
|
|
10
|
+
icon?: PdgIconProps['children'];
|
|
11
|
+
label?: ReactNode;
|
|
12
|
+
name?: keyof T;
|
|
13
|
+
type?: InfoTableItemType;
|
|
14
|
+
ellipsis?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
dateFormat?: string;
|
|
17
|
+
dateTwoLine?: boolean;
|
|
18
|
+
numberPrefix?: string;
|
|
19
|
+
numberSuffix?: string;
|
|
20
|
+
dividerColor?: TypographyProps['color'];
|
|
21
|
+
dividerLine?: boolean;
|
|
22
|
+
style?: CommonSxProps['style'];
|
|
23
|
+
sx?: BoxProps['sx'];
|
|
24
|
+
labelClassName?: string;
|
|
25
|
+
labelColor?: TypographyProps['color'];
|
|
26
|
+
labelStyle?: CommonSxProps['style'];
|
|
27
|
+
labelSx?: BoxProps['sx'];
|
|
28
|
+
valueClassName?: string;
|
|
29
|
+
valueStyle?: CommonSxProps['style'];
|
|
30
|
+
valueSx?: CommonSxProps['sx'];
|
|
31
|
+
xs?: number;
|
|
32
|
+
sm?: number;
|
|
33
|
+
md?: number;
|
|
34
|
+
lg?: number;
|
|
35
|
+
xl?: number;
|
|
36
|
+
clipboard?: boolean;
|
|
37
|
+
clipboardIcon?: string;
|
|
38
|
+
clipboardText?: string;
|
|
39
|
+
clipboardProps?: Omit<IconButtonProps, 'children'>;
|
|
40
|
+
onRender?(info: T): ReactNode;
|
|
41
|
+
onRenderEmpty?(info: T): ReactNode;
|
|
42
|
+
onHide?(info: T): boolean;
|
|
43
|
+
onXs?(info: T): number;
|
|
44
|
+
onSm?(info: T): number;
|
|
45
|
+
onMd?(info: T): number;
|
|
46
|
+
onLg?(info: T): number;
|
|
47
|
+
onXl?(info: T): number;
|
|
48
|
+
}
|
|
49
|
+
export type InfoTableItems<T = InfoTableInfo> = (InfoTableItem<T> | false | undefined | null)[];
|
|
50
|
+
export type InfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
|
|
51
|
+
export interface InfoTableProps<T = InfoTableInfo> {
|
|
52
|
+
cols: InfoTableCols | {
|
|
53
|
+
xs?: InfoTableCols;
|
|
54
|
+
sm?: InfoTableCols;
|
|
55
|
+
md?: InfoTableCols;
|
|
56
|
+
lg?: InfoTableCols;
|
|
57
|
+
xl?: InfoTableCols;
|
|
58
|
+
};
|
|
59
|
+
spacing?: GridProps['spacing'];
|
|
60
|
+
columnSpacing?: GridProps['spacing'];
|
|
61
|
+
rowSpacing?: GridProps['spacing'];
|
|
62
|
+
className?: string;
|
|
63
|
+
style?: CommonSxProps['style'];
|
|
64
|
+
sx?: CommonSxProps['sx'];
|
|
65
|
+
labelClassName?: string;
|
|
66
|
+
labelColor?: TypographyProps['color'];
|
|
67
|
+
labelStyle?: CommonSxProps['style'];
|
|
68
|
+
labelSx?: BoxProps['sx'];
|
|
69
|
+
dividerColor?: TypographyProps['color'];
|
|
70
|
+
valueClassName?: string;
|
|
71
|
+
valueStyle?: CommonSxProps['style'];
|
|
72
|
+
valueSx?: CommonSxProps['sx'];
|
|
73
|
+
ellipsis?: boolean;
|
|
74
|
+
valueUnderline?: boolean;
|
|
75
|
+
info: T;
|
|
76
|
+
items: InfoTableItems<T>;
|
|
77
|
+
onCopyToClipboard?(item: InfoTableItem<T>, text: string): void;
|
|
78
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import InfoTable from './InfoTable';
|
|
2
|
-
export default InfoTable;
|
|
3
|
-
export { InfoTable };
|
|
4
|
-
export * from './InfoTable.types';
|
|
1
|
+
import InfoTable from './InfoTable';
|
|
2
|
+
export default InfoTable;
|
|
3
|
+
export { InfoTable };
|
|
4
|
+
export * from './InfoTable.types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SearchTableProps, SearchTableCommands } from './SearchTable.types';
|
|
3
|
-
import { TableItem } from '../Table';
|
|
4
|
-
interface WithForwardRefType<T = TableItem> extends React.FC<SearchTableProps<T>> {
|
|
5
|
-
<T = TableItem>(props: SearchTableProps<T> & React.RefAttributes<SearchTableCommands<T>>): ReturnType<React.FC<SearchTableProps<T>>>;
|
|
6
|
-
}
|
|
7
|
-
declare const SearchTable: WithForwardRefType;
|
|
8
|
-
export default SearchTable;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SearchTableProps, SearchTableCommands } from './SearchTable.types';
|
|
3
|
+
import { TableItem } from '../Table';
|
|
4
|
+
interface WithForwardRefType<T = TableItem> extends React.FC<SearchTableProps<T>> {
|
|
5
|
+
<T = TableItem>(props: SearchTableProps<T> & React.RefAttributes<SearchTableCommands<T>>): ReturnType<React.FC<SearchTableProps<T>>>;
|
|
6
|
+
}
|
|
7
|
+
declare const SearchTable: WithForwardRefType;
|
|
8
|
+
export default SearchTable;
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableProps, TableCommands, TableItem } from '../Table';
|
|
3
|
-
import { FormValueMap, SearchCommands, SearchProps } from '@pdg/react-form';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
import { CommonSxProps } from '../@types';
|
|
6
|
-
export interface SearchTableData<T = TableItem> {
|
|
7
|
-
items: TableProps<T>['items'];
|
|
8
|
-
paging?: TableProps<T>['paging'];
|
|
9
|
-
}
|
|
10
|
-
export interface SearchTableSearchProps extends Omit<SearchProps, 'ref' | 'color' | 'autoSubmit' | 'onSubmit'> {
|
|
11
|
-
ref?: React.ForwardedRef<SearchCommands>;
|
|
12
|
-
searchGroups?: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
export interface SearchTableTableProps<T = TableItem> extends Omit<TableProps<T>, 'ref' | 'items' | 'paging' | 'onPageChange'> {
|
|
15
|
-
ref?: React.ForwardedRef<TableCommands<T>>;
|
|
16
|
-
}
|
|
17
|
-
export interface SearchTableProps<T = TableItem> extends CommonSxProps {
|
|
18
|
-
color?: SearchProps['color'];
|
|
19
|
-
hash?: boolean;
|
|
20
|
-
stickyHeader?: boolean;
|
|
21
|
-
fullHeight?: boolean;
|
|
22
|
-
search?: SearchTableSearchProps;
|
|
23
|
-
table: SearchTableTableProps<T>;
|
|
24
|
-
betweenSearchTableComponent?: ReactNode;
|
|
25
|
-
onGetData?(data: FormValueMap): Promise<SearchTableData<T>>;
|
|
26
|
-
onRequestHashChange?(hash: string): void;
|
|
27
|
-
}
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableProps, TableCommands, TableItem } from '../Table';
|
|
3
|
+
import { FormValueMap, SearchCommands, SearchProps } from '@pdg/react-form';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { CommonSxProps } from '../@types';
|
|
6
|
+
export interface SearchTableData<T = TableItem> {
|
|
7
|
+
items: TableProps<T>['items'];
|
|
8
|
+
paging?: TableProps<T>['paging'];
|
|
9
|
+
}
|
|
10
|
+
export interface SearchTableSearchProps extends Omit<SearchProps, 'ref' | 'color' | 'autoSubmit' | 'onSubmit'> {
|
|
11
|
+
ref?: React.ForwardedRef<SearchCommands>;
|
|
12
|
+
searchGroups?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface SearchTableTableProps<T = TableItem> extends Omit<TableProps<T>, 'ref' | 'items' | 'paging' | 'onPageChange'> {
|
|
15
|
+
ref?: React.ForwardedRef<TableCommands<T>>;
|
|
16
|
+
}
|
|
17
|
+
export interface SearchTableProps<T = TableItem> extends CommonSxProps {
|
|
18
|
+
color?: SearchProps['color'];
|
|
19
|
+
hash?: boolean;
|
|
20
|
+
stickyHeader?: boolean;
|
|
21
|
+
fullHeight?: boolean;
|
|
22
|
+
search?: SearchTableSearchProps;
|
|
23
|
+
table: SearchTableTableProps<T>;
|
|
24
|
+
betweenSearchTableComponent?: ReactNode;
|
|
25
|
+
onGetData?(data: FormValueMap): Promise<SearchTableData<T>>;
|
|
26
|
+
onRequestHashChange?(hash: string): void;
|
|
27
|
+
}
|
|
28
|
+
export interface SearchTableCommands<T = TableItem> {
|
|
29
|
+
reload(page?: number): void;
|
|
30
|
+
getLastLoadData(): FormValueMap;
|
|
31
|
+
getSearch(): SearchCommands | undefined;
|
|
32
|
+
getTable(): TableCommands<T> | undefined;
|
|
33
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import SearchTable from './SearchTable';
|
|
2
|
-
export default SearchTable;
|
|
3
|
-
export { SearchTable };
|
|
4
|
-
export * from './SearchTable.types';
|
|
1
|
+
import SearchTable from './SearchTable';
|
|
2
|
+
export default SearchTable;
|
|
3
|
+
export { SearchTable };
|
|
4
|
+
export * from './SearchTable.types';
|
package/dist/Table/Table.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableProps, TableCommands, TableItem } from './Table.types';
|
|
3
|
-
import 'simplebar-react/dist/simplebar.min.css';
|
|
4
|
-
interface WithForwardRefType<T = TableItem> extends React.FC<TableProps<T>> {
|
|
5
|
-
<T = TableItem>(props: TableProps<T> & React.RefAttributes<TableCommands<T>>): ReturnType<React.FC<TableProps<T>>>;
|
|
6
|
-
}
|
|
7
|
-
declare const Table: WithForwardRefType;
|
|
8
|
-
export default Table;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableProps, TableCommands, TableItem } from './Table.types';
|
|
3
|
+
import 'simplebar-react/dist/simplebar.min.css';
|
|
4
|
+
interface WithForwardRefType<T = TableItem> extends React.FC<TableProps<T>> {
|
|
5
|
+
<T = TableItem>(props: TableProps<T> & React.RefAttributes<TableCommands<T>>): ReturnType<React.FC<TableProps<T>>>;
|
|
6
|
+
}
|
|
7
|
+
declare const Table: WithForwardRefType;
|
|
8
|
+
export default Table;
|
|
@@ -1,130 +1,129 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { TableCellProps, TooltipProps } from '@mui/material';
|
|
3
|
-
import { TablePaginationProps } from '../TablePagination/TablePagination.types';
|
|
4
|
-
import { CommonSxProps } from '../@types';
|
|
5
|
-
import { TableTopHeadProps } from '../TableTopHead';
|
|
6
|
-
/********************************************************************************************************************
|
|
7
|
-
* TableItem
|
|
8
|
-
* ******************************************************************************************************************/
|
|
9
|
-
export interface TableItem {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
}
|
|
12
|
-
/********************************************************************************************************************
|
|
13
|
-
* TableColumn
|
|
14
|
-
* ******************************************************************************************************************/
|
|
15
|
-
export interface TableColumn<T = TableItem> {
|
|
16
|
-
id?: string;
|
|
17
|
-
type?: 'text' | 'number' | 'tel' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'img' | 'button' | 'buttons' | 'check';
|
|
18
|
-
label?: ReactNode;
|
|
19
|
-
name?: keyof T;
|
|
20
|
-
align?: TableCellProps['align'];
|
|
21
|
-
width?: string | number;
|
|
22
|
-
minWidth?: string | number;
|
|
23
|
-
ellipsis?: boolean;
|
|
24
|
-
dateFormat?: string;
|
|
25
|
-
dateTwoLine?: boolean;
|
|
26
|
-
hideAllCheck?: boolean;
|
|
27
|
-
numberPrefix?: string;
|
|
28
|
-
numberSuffix?: string;
|
|
29
|
-
tooltipProps?: Omit<TooltipProps, 'children' | 'title'>;
|
|
30
|
-
display?: {
|
|
31
|
-
xs?: boolean;
|
|
32
|
-
sm?: boolean;
|
|
33
|
-
md?: boolean;
|
|
34
|
-
lg?: boolean;
|
|
35
|
-
xl?: boolean;
|
|
36
|
-
};
|
|
37
|
-
paddingLeft?: number;
|
|
38
|
-
paddingRight?: number;
|
|
39
|
-
head?: {
|
|
40
|
-
className?: CommonSxProps['className'];
|
|
41
|
-
style?: CommonSxProps['style'];
|
|
42
|
-
backgroundColor?: CSSProperties['backgroundColor'];
|
|
43
|
-
sx?: CommonSxProps['sx'];
|
|
44
|
-
onGetClassName?(): CommonSxProps['className'];
|
|
45
|
-
onGetStyle?(): CommonSxProps['style'];
|
|
46
|
-
onGetSx?(): CommonSxProps['sx'];
|
|
47
|
-
onRender?(): ReactNode;
|
|
48
|
-
};
|
|
49
|
-
footer?: {
|
|
50
|
-
value?: ReactNode;
|
|
51
|
-
className?: CommonSxProps['className'];
|
|
52
|
-
style?: CommonSxProps['style'];
|
|
53
|
-
backgroundColor?: CSSProperties['backgroundColor'];
|
|
54
|
-
sx?: CommonSxProps['sx'];
|
|
55
|
-
onGetClassName?(): CommonSxProps['className'];
|
|
56
|
-
onGetStyle?(): CommonSxProps['style'];
|
|
57
|
-
onGetSx?(): CommonSxProps['sx'];
|
|
58
|
-
onRender?(): ReactNode;
|
|
59
|
-
};
|
|
60
|
-
className?: CommonSxProps['className'];
|
|
61
|
-
style?: CommonSxProps['style'];
|
|
62
|
-
backgroundColor?: CSSProperties['backgroundColor'];
|
|
63
|
-
sx?: CommonSxProps['sx'];
|
|
64
|
-
onGetClassName?(item: T, index: number): CommonSxProps['className'];
|
|
65
|
-
onGetStyle?(item: T, index: number): CommonSxProps['style'];
|
|
66
|
-
onGetSx?(item: T, index: number): CommonSxProps['sx'];
|
|
67
|
-
onHide?(item: T, index: number): boolean;
|
|
68
|
-
onGetTooltip?(item: T, index: number): ReactNode;
|
|
69
|
-
onRender?(item: T, index: number): ReactNode;
|
|
70
|
-
onClick?(item: T, index: number): void;
|
|
71
|
-
onInitChecked?(item: T): boolean;
|
|
72
|
-
onCheckDisabled?(item: T): boolean;
|
|
73
|
-
onCheckChange?(item: T, checked: boolean): void;
|
|
74
|
-
onCheckDisabledChange?(item: T, checkDisabled: boolean): void;
|
|
75
|
-
}
|
|
76
|
-
export type TableColumns<T = TableItem> = (TableColumn<T> | false | undefined | null)[];
|
|
77
|
-
/********************************************************************************************************************
|
|
78
|
-
* TableProps
|
|
79
|
-
* ******************************************************************************************************************/
|
|
80
|
-
export interface TableProps<T = TableItem> extends CommonSxProps {
|
|
81
|
-
caption?: ReactNode;
|
|
82
|
-
topHeadRows?: TableTopHeadProps['rows'];
|
|
83
|
-
columns?: TableColumns<T>;
|
|
84
|
-
defaultAlign?: TableCellProps['align'];
|
|
85
|
-
defaultEllipsis?: boolean;
|
|
86
|
-
stickyHeader?: boolean;
|
|
87
|
-
items?: T[];
|
|
88
|
-
paging?: TablePaginationProps['paging'];
|
|
89
|
-
pagingAlign?: TablePaginationProps['align'];
|
|
90
|
-
height?: string | number;
|
|
91
|
-
maxHeight?: string | number;
|
|
92
|
-
minHeight?: string | number;
|
|
93
|
-
fullHeight?: boolean;
|
|
94
|
-
showOddColor?: boolean;
|
|
95
|
-
showEvenColor?: boolean;
|
|
96
|
-
cellPadding?: string | number;
|
|
97
|
-
footer?: boolean;
|
|
98
|
-
noData?: ReactNode;
|
|
99
|
-
pagination?: {
|
|
100
|
-
className?: CommonSxProps['className'];
|
|
101
|
-
style?: CommonSxProps['style'];
|
|
102
|
-
sx?: CommonSxProps['sx'];
|
|
103
|
-
};
|
|
104
|
-
sortable?: boolean;
|
|
105
|
-
onClick?(item: T, index: number): void;
|
|
106
|
-
onGetBodyRowClassName?(item: T, index: number): CommonSxProps['className'] | undefined;
|
|
107
|
-
onGetBodyRowStyle?(item: T, index: number): CommonSxProps['style'] | undefined;
|
|
108
|
-
onGetBodyRowSx?(item: T, index: number): CommonSxProps['sx'] | undefined;
|
|
109
|
-
onGetBodyColumnClassName?(column: TableColumn<T>, item: T, index: number): CommonSxProps['className'] | undefined;
|
|
110
|
-
onGetBodyColumnStyle?(column: TableColumn<T>, item: T, index: number): CommonSxProps['style'] | undefined;
|
|
111
|
-
onGetBodyColumnSx?(column: TableColumn<T>, item: T, index: number): CommonSxProps['sx'] | undefined;
|
|
112
|
-
onPageChange?(page: number): void;
|
|
113
|
-
onSortChange?(items: T[]): void;
|
|
114
|
-
onCheckChange?(columnId: string, items: T[]): void;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { TableCellProps, TooltipProps } from '@mui/material';
|
|
3
|
+
import { TablePaginationProps } from '../TablePagination/TablePagination.types';
|
|
4
|
+
import { CommonSxProps } from '../@types';
|
|
5
|
+
import { TableTopHeadProps } from '../TableTopHead';
|
|
6
|
+
/********************************************************************************************************************
|
|
7
|
+
* TableItem
|
|
8
|
+
* ******************************************************************************************************************/
|
|
9
|
+
export interface TableItem {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
/********************************************************************************************************************
|
|
13
|
+
* TableColumn
|
|
14
|
+
* ******************************************************************************************************************/
|
|
15
|
+
export interface TableColumn<T = TableItem> {
|
|
16
|
+
id?: string;
|
|
17
|
+
type?: 'text' | 'number' | 'tel' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'img' | 'button' | 'buttons' | 'check';
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
name?: keyof T;
|
|
20
|
+
align?: TableCellProps['align'];
|
|
21
|
+
width?: string | number;
|
|
22
|
+
minWidth?: string | number;
|
|
23
|
+
ellipsis?: boolean;
|
|
24
|
+
dateFormat?: string;
|
|
25
|
+
dateTwoLine?: boolean;
|
|
26
|
+
hideAllCheck?: boolean;
|
|
27
|
+
numberPrefix?: string;
|
|
28
|
+
numberSuffix?: string;
|
|
29
|
+
tooltipProps?: Omit<TooltipProps, 'children' | 'title'>;
|
|
30
|
+
display?: {
|
|
31
|
+
xs?: boolean;
|
|
32
|
+
sm?: boolean;
|
|
33
|
+
md?: boolean;
|
|
34
|
+
lg?: boolean;
|
|
35
|
+
xl?: boolean;
|
|
36
|
+
};
|
|
37
|
+
paddingLeft?: number;
|
|
38
|
+
paddingRight?: number;
|
|
39
|
+
head?: {
|
|
40
|
+
className?: CommonSxProps['className'];
|
|
41
|
+
style?: CommonSxProps['style'];
|
|
42
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
43
|
+
sx?: CommonSxProps['sx'];
|
|
44
|
+
onGetClassName?(): CommonSxProps['className'];
|
|
45
|
+
onGetStyle?(): CommonSxProps['style'];
|
|
46
|
+
onGetSx?(): CommonSxProps['sx'];
|
|
47
|
+
onRender?(): ReactNode;
|
|
48
|
+
};
|
|
49
|
+
footer?: {
|
|
50
|
+
value?: ReactNode;
|
|
51
|
+
className?: CommonSxProps['className'];
|
|
52
|
+
style?: CommonSxProps['style'];
|
|
53
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
54
|
+
sx?: CommonSxProps['sx'];
|
|
55
|
+
onGetClassName?(): CommonSxProps['className'];
|
|
56
|
+
onGetStyle?(): CommonSxProps['style'];
|
|
57
|
+
onGetSx?(): CommonSxProps['sx'];
|
|
58
|
+
onRender?(): ReactNode;
|
|
59
|
+
};
|
|
60
|
+
className?: CommonSxProps['className'];
|
|
61
|
+
style?: CommonSxProps['style'];
|
|
62
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
63
|
+
sx?: CommonSxProps['sx'];
|
|
64
|
+
onGetClassName?(item: T, index: number): CommonSxProps['className'];
|
|
65
|
+
onGetStyle?(item: T, index: number): CommonSxProps['style'];
|
|
66
|
+
onGetSx?(item: T, index: number): CommonSxProps['sx'];
|
|
67
|
+
onHide?(item: T, index: number): boolean;
|
|
68
|
+
onGetTooltip?(item: T, index: number): ReactNode;
|
|
69
|
+
onRender?(item: T, index: number): ReactNode;
|
|
70
|
+
onClick?(item: T, index: number): void;
|
|
71
|
+
onInitChecked?(item: T): boolean;
|
|
72
|
+
onCheckDisabled?(item: T): boolean;
|
|
73
|
+
onCheckChange?(item: T, checked: boolean): void;
|
|
74
|
+
onCheckDisabledChange?(item: T, checkDisabled: boolean): void;
|
|
75
|
+
}
|
|
76
|
+
export type TableColumns<T = TableItem> = (TableColumn<T> | false | undefined | null)[];
|
|
77
|
+
/********************************************************************************************************************
|
|
78
|
+
* TableProps
|
|
79
|
+
* ******************************************************************************************************************/
|
|
80
|
+
export interface TableProps<T = TableItem> extends CommonSxProps {
|
|
81
|
+
caption?: ReactNode;
|
|
82
|
+
topHeadRows?: TableTopHeadProps['rows'];
|
|
83
|
+
columns?: TableColumns<T>;
|
|
84
|
+
defaultAlign?: TableCellProps['align'];
|
|
85
|
+
defaultEllipsis?: boolean;
|
|
86
|
+
stickyHeader?: boolean;
|
|
87
|
+
items?: T[];
|
|
88
|
+
paging?: TablePaginationProps['paging'];
|
|
89
|
+
pagingAlign?: TablePaginationProps['align'];
|
|
90
|
+
height?: string | number;
|
|
91
|
+
maxHeight?: string | number;
|
|
92
|
+
minHeight?: string | number;
|
|
93
|
+
fullHeight?: boolean;
|
|
94
|
+
showOddColor?: boolean;
|
|
95
|
+
showEvenColor?: boolean;
|
|
96
|
+
cellPadding?: string | number;
|
|
97
|
+
footer?: boolean;
|
|
98
|
+
noData?: ReactNode;
|
|
99
|
+
pagination?: {
|
|
100
|
+
className?: CommonSxProps['className'];
|
|
101
|
+
style?: CommonSxProps['style'];
|
|
102
|
+
sx?: CommonSxProps['sx'];
|
|
103
|
+
};
|
|
104
|
+
sortable?: boolean;
|
|
105
|
+
onClick?(item: T, index: number): void;
|
|
106
|
+
onGetBodyRowClassName?(item: T, index: number): CommonSxProps['className'] | undefined;
|
|
107
|
+
onGetBodyRowStyle?(item: T, index: number): CommonSxProps['style'] | undefined;
|
|
108
|
+
onGetBodyRowSx?(item: T, index: number): CommonSxProps['sx'] | undefined;
|
|
109
|
+
onGetBodyColumnClassName?(column: TableColumn<T>, item: T, index: number): CommonSxProps['className'] | undefined;
|
|
110
|
+
onGetBodyColumnStyle?(column: TableColumn<T>, item: T, index: number): CommonSxProps['style'] | undefined;
|
|
111
|
+
onGetBodyColumnSx?(column: TableColumn<T>, item: T, index: number): CommonSxProps['sx'] | undefined;
|
|
112
|
+
onPageChange?(page: number): void;
|
|
113
|
+
onSortChange?(items: T[]): void;
|
|
114
|
+
onCheckChange?(columnId: string, items: T[]): void;
|
|
115
|
+
}
|
|
116
|
+
/********************************************************************************************************************
|
|
117
|
+
* TableCommands
|
|
118
|
+
* ******************************************************************************************************************/
|
|
119
|
+
export interface TableCommands<T = TableItem> {
|
|
120
|
+
getColumns(): TableProps<T>['columns'];
|
|
121
|
+
setColumns(columns: TableProps<T>['columns']): void;
|
|
122
|
+
getItems(): TableProps<T>['items'];
|
|
123
|
+
setItems(items: TableProps<T>['items']): void;
|
|
124
|
+
getPaging(): TableProps<T>['paging'];
|
|
125
|
+
setItemsPaging(items: TableProps<T>['items'], paging: TableProps<T>['paging']): void;
|
|
126
|
+
resetSort(): void;
|
|
127
|
+
getCheckedItems(columnId: string): T[];
|
|
128
|
+
scrollToTop(): void;
|
|
129
|
+
}
|
package/dist/Table/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Table from './Table';
|
|
2
|
-
export default Table;
|
|
3
|
-
export { Table };
|
|
4
|
-
export * from './Table.types';
|
|
1
|
+
import Table from './Table';
|
|
2
|
+
export default Table;
|
|
3
|
+
export { Table };
|
|
4
|
+
export * from './Table.types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableBodyCellProps as Props } from './TableBodyCell.types';
|
|
3
|
-
declare const TableBodyCell: React.FC<Props>;
|
|
4
|
-
export default TableBodyCell;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableBodyCellProps as Props } from './TableBodyCell.types';
|
|
3
|
+
declare const TableBodyCell: React.FC<Props>;
|
|
4
|
+
export default TableBodyCell;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { TableColumn, TableItem, TableProps } from '../Table/Table.types';
|
|
2
|
-
import { CommonSxProps } from '../@types';
|
|
3
|
-
export interface TableBodyCellCommands {
|
|
4
|
-
setChecked(checked: boolean): void;
|
|
5
|
-
setCheckDisabled(disabled: boolean): void;
|
|
6
|
-
}
|
|
7
|
-
export interface TableBodyCellProps {
|
|
8
|
-
className?: CommonSxProps['className'];
|
|
9
|
-
style?: CommonSxProps['style'];
|
|
10
|
-
sx?: CommonSxProps['sx'];
|
|
11
|
-
index: number;
|
|
12
|
-
item: TableItem;
|
|
13
|
-
column: TableColumn;
|
|
14
|
-
defaultAlign?: TableProps['defaultAlign'];
|
|
15
|
-
defaultEllipsis?: boolean;
|
|
16
|
-
onClick: TableProps['onClick'];
|
|
17
|
-
onCheckChange(item: TableItem, column: TableColumn, checked: boolean): void;
|
|
18
|
-
}
|
|
1
|
+
import { TableColumn, TableItem, TableProps } from '../Table/Table.types';
|
|
2
|
+
import { CommonSxProps } from '../@types';
|
|
3
|
+
export interface TableBodyCellCommands {
|
|
4
|
+
setChecked(checked: boolean): void;
|
|
5
|
+
setCheckDisabled(disabled: boolean): void;
|
|
6
|
+
}
|
|
7
|
+
export interface TableBodyCellProps {
|
|
8
|
+
className?: CommonSxProps['className'];
|
|
9
|
+
style?: CommonSxProps['style'];
|
|
10
|
+
sx?: CommonSxProps['sx'];
|
|
11
|
+
index: number;
|
|
12
|
+
item: TableItem;
|
|
13
|
+
column: TableColumn;
|
|
14
|
+
defaultAlign?: TableProps['defaultAlign'];
|
|
15
|
+
defaultEllipsis?: boolean;
|
|
16
|
+
onClick: TableProps['onClick'];
|
|
17
|
+
onCheckChange(item: TableItem, column: TableColumn, checked: boolean): void;
|
|
18
|
+
}
|