@pdg/react-table 1.0.78 → 1.0.80

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.
Files changed (62) hide show
  1. package/dist/@types/index.d.ts +1 -1
  2. package/dist/@types/types.d.ts +13 -13
  3. package/dist/@util/index.d.ts +1 -9
  4. package/dist/@util/table.d.ts +8 -8
  5. package/dist/InfoTable/InfoTable.d.ts +7 -7
  6. package/dist/InfoTable/InfoTable.style.d.ts +14 -14
  7. package/dist/InfoTable/InfoTable.types.d.ts +72 -72
  8. package/dist/InfoTable/index.d.ts +4 -4
  9. package/dist/SearchTable/SearchTable.d.ts +8 -8
  10. package/dist/SearchTable/SearchTable.types.d.ts +34 -34
  11. package/dist/SearchTable/index.d.ts +4 -4
  12. package/dist/Table/Table.d.ts +8 -8
  13. package/dist/Table/Table.styles.d.ts +5 -5
  14. package/dist/Table/Table.types.d.ts +115 -115
  15. package/dist/Table/index.d.ts +4 -4
  16. package/dist/TableBodyCell/TableBodyCell.d.ts +4 -4
  17. package/dist/TableBodyCell/TableBodyCell.types.d.ts +18 -18
  18. package/dist/TableBodyCell/index.d.ts +4 -4
  19. package/dist/TableBodyRow/TableBodyRow.d.ts +7 -7
  20. package/dist/TableBodyRow/TableBodyRow.types.d.ts +19 -19
  21. package/dist/TableBodyRow/index.d.ts +4 -4
  22. package/dist/TableButton/TableButton.d.ts +4 -4
  23. package/dist/TableButton/TableButton.types.d.ts +7 -7
  24. package/dist/TableButton/index.d.ts +4 -4
  25. package/dist/TableCommonCell/TableCommonCell.d.ts +4 -4
  26. package/dist/TableCommonCell/TableCommonCell.types.d.ts +11 -11
  27. package/dist/TableCommonCell/index.d.ts +4 -4
  28. package/dist/TableContext/TableContext.d.ts +4 -4
  29. package/dist/TableContext/TableContext.types.d.ts +14 -14
  30. package/dist/TableContext/index.d.ts +5 -5
  31. package/dist/TableContext/useTableState.d.ts +2 -2
  32. package/dist/TableContextProvider/TableContextProvider.d.ts +4 -4
  33. package/dist/TableContextProvider/TableContextProvider.types.d.ts +6 -6
  34. package/dist/TableContextProvider/index.d.ts +4 -4
  35. package/dist/TableFooterCell/TableFooterCell.d.ts +4 -4
  36. package/dist/TableFooterCell/TableFooterCell.types.d.ts +5 -5
  37. package/dist/TableFooterCell/index.d.ts +4 -4
  38. package/dist/TableHeadCell/TableHeadCell.d.ts +4 -4
  39. package/dist/TableHeadCell/TableHeadCell.types.d.ts +11 -11
  40. package/dist/TableHeadCell/index.d.ts +4 -4
  41. package/dist/TableMenuButton/TableMenuButton.d.ts +4 -4
  42. package/dist/TableMenuButton/TableMenuButton.types.d.ts +13 -13
  43. package/dist/TableMenuButton/index.d.ts +4 -4
  44. package/dist/TablePagination/TablePagination.d.ts +4 -4
  45. package/dist/TablePagination/TablePagination.types.d.ts +13 -13
  46. package/dist/TablePagination/index.d.ts +4 -4
  47. package/dist/TableTopHead/TableTopHead.d.ts +4 -4
  48. package/dist/TableTopHead/TableTopHead.style.d.ts +4 -4
  49. package/dist/TableTopHead/TableTopHead.types.d.ts +18 -18
  50. package/dist/TableTopHead/index.d.ts +4 -4
  51. package/dist/index.d.ts +6 -7
  52. package/dist/index.esm.js +1864 -2004
  53. package/dist/index.js +1864 -2004
  54. package/package.json +6 -5
  55. package/dist/@util/companyNo.d.ts +0 -6
  56. package/dist/@util/compare.d.ts +0 -4
  57. package/dist/@util/number.d.ts +0 -1
  58. package/dist/@util/personalNo.d.ts +0 -6
  59. package/dist/@util/tel.d.ts +0 -1
  60. package/dist/TableIcon/TableIcon.d.ts +0 -4
  61. package/dist/TableIcon/TableIcon.types.d.ts +0 -5
  62. package/dist/TableIcon/index.d.ts +0 -4
@@ -1 +1 @@
1
- export * from './types';
1
+ export * from './types';
@@ -1,13 +1,13 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- import { SxProps } from '@mui/system';
3
- import { Theme } from '@mui/material/styles';
4
- export type PartialPick<T, K extends keyof T> = Partial<Pick<T, K>>;
5
- export type PartialOmit<T, K extends keyof T> = Partial<Omit<T, K>>;
6
- export interface CommonProps {
7
- children?: ReactNode;
8
- className?: string;
9
- style?: CSSProperties;
10
- }
11
- export interface CommonSxProps extends CommonProps {
12
- sx?: SxProps<Theme>;
13
- }
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { SxProps } from '@mui/system';
3
+ import { Theme } from '@mui/material/styles';
4
+ export type PartialPick<T, K extends keyof T> = Partial<Pick<T, K>>;
5
+ export type PartialOmit<T, K extends keyof T> = Partial<Omit<T, K>>;
6
+ export interface CommonProps {
7
+ children?: ReactNode;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export interface CommonSxProps extends CommonProps {
12
+ sx?: SxProps<Theme>;
13
+ }
@@ -1,9 +1 @@
1
- declare const ll: (message?: any, ...optionalParams: any[]) => void;
2
- declare const nextTick: (callback: () => void) => void;
3
- export { ll, nextTick };
4
- export * from './compare';
5
- export * from './number';
6
- export * from './table';
7
- export * from './tel';
8
- export * from './companyNo';
9
- export * from './personalNo';
1
+ export * from './table';
@@ -1,8 +1,8 @@
1
- import { TableColumn } from '../Table/Table.types';
2
- import { CommonSxProps } from '../@types';
3
- import { TypographyProps } from '@mui/material';
4
- export declare function getTableColumnAlign(column: TableColumn, defaultAlign: TableColumn['align']): TableColumn['align'];
5
- export declare function combineSx(...sx: (boolean | CommonSxProps['sx'])[]): CommonSxProps['sx'];
6
- export declare function typographyColorToSxColor(color: TypographyProps['color']): string | readonly (readonly string[] | import("csstype").Property.Color | null | undefined)[] | {
7
- [key: string]: readonly string[] | import("csstype").Property.Color | null | undefined;
8
- } | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Color | undefined>) | undefined;
1
+ import { TableColumn } from '../Table/Table.types';
2
+ import { CommonSxProps } from '../@types';
3
+ import { TypographyProps } from '@mui/material';
4
+ export declare function getTableColumnAlign(column: TableColumn, defaultAlign: TableColumn['align']): TableColumn['align'];
5
+ export declare function combineSx(...sx: (boolean | CommonSxProps['sx'])[]): CommonSxProps['sx'];
6
+ export declare function typographyColorToSxColor(color: TypographyProps['color']): string | readonly (readonly string[] | import("csstype").Property.Color | null | undefined)[] | {
7
+ [key: string]: readonly string[] | import("csstype").Property.Color | null | undefined;
8
+ } | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Color | undefined>) | undefined;
@@ -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,14 +1,14 @@
1
- /// <reference types="react" />
2
- export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
- export declare const ValueWrap: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
- export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
- export declare const ValueEllipsis: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
- export declare const ValueClipboard: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
- export declare const ClipboardIconButton: import("@emotion/styled").StyledComponent<import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
12
- ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
13
- }, "style" | "className" | "tabIndex" | "color" | "children" | "sx" | "classes" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "size"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
14
- export declare const Line: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /// <reference types="react" />
2
+ export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const ValueWrap: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
+ export declare const ValueEllipsis: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const ValueClipboard: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const ClipboardIconButton: import("@emotion/styled").StyledComponent<import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
12
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
13
+ }, "style" | "className" | "tabIndex" | "color" | "children" | "sx" | "classes" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "size"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
14
+ export declare const Line: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,72 +1,72 @@
1
- import { ReactNode } from 'react';
2
- import { BoxProps, GridProps, IconButtonProps, TypographyProps } from '@mui/material';
3
- import { CommonSxProps } from '../@types';
4
- export interface InfoTableInfo {
5
- [key: string]: any;
6
- }
7
- export type InfoTableItemType = 'text' | 'number' | 'tel' | 'url' | 'email' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'divider';
8
- export interface InfoTableItem<T = InfoTableInfo> {
9
- icon?: string;
10
- label?: ReactNode;
11
- name?: keyof T;
12
- type?: InfoTableItemType;
13
- ellipsis?: boolean;
14
- className?: string;
15
- dateFormat?: string;
16
- dateTwoLine?: boolean;
17
- numberPrefix?: string;
18
- numberSuffix?: string;
19
- dividerColor?: TypographyProps['color'];
20
- dividerLine?: boolean;
21
- style?: CommonSxProps['style'];
22
- sx?: BoxProps['sx'];
23
- labelClassName?: string;
24
- labelColor?: TypographyProps['color'];
25
- labelStyle?: CommonSxProps['style'];
26
- labelSx?: BoxProps['sx'];
27
- valueClassName?: string;
28
- valueStyle?: CommonSxProps['style'];
29
- valueSx?: CommonSxProps['sx'];
30
- xs?: number;
31
- sm?: number;
32
- md?: number;
33
- lg?: number;
34
- xl?: number;
35
- clipboard?: boolean;
36
- clipboardIcon?: string;
37
- clipboardText?: string;
38
- clipboardProps?: Omit<IconButtonProps, 'children'>;
39
- onRender?(info: T): ReactNode;
40
- onRenderEmpty?(info: T): ReactNode;
41
- }
42
- export type InfoTableItems<T = InfoTableInfo> = (InfoTableItem<T> | false | undefined | null)[];
43
- export type InfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
44
- export interface InfoTableProps<T = InfoTableInfo> {
45
- cols: InfoTableCols | {
46
- xs?: InfoTableCols;
47
- sm?: InfoTableCols;
48
- md?: InfoTableCols;
49
- lg?: InfoTableCols;
50
- xl?: InfoTableCols;
51
- };
52
- spacing?: GridProps['spacing'];
53
- columnSpacing?: GridProps['spacing'];
54
- rowSpacing?: GridProps['spacing'];
55
- className?: string;
56
- style?: CommonSxProps['style'];
57
- sx?: CommonSxProps['sx'];
58
- labelClassName?: string;
59
- labelColor?: TypographyProps['color'];
60
- labelStyle?: CommonSxProps['style'];
61
- labelSx?: BoxProps['sx'];
62
- dividerColor?: TypographyProps['color'];
63
- valueClassName?: string;
64
- valueStyle?: CommonSxProps['style'];
65
- valueSx?: CommonSxProps['sx'];
66
- ellipsis?: boolean;
67
- valueUnderline?: boolean;
68
- info: T;
69
- items: InfoTableItems<T>;
70
- onCopyToClipboard?(item: InfoTableItem<T>, text: string): void;
71
- }
72
- 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
+ export interface InfoTableInfo {
5
+ [key: string]: any;
6
+ }
7
+ export type InfoTableItemType = 'text' | 'number' | 'tel' | 'url' | 'email' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'divider';
8
+ export interface InfoTableItem<T = InfoTableInfo> {
9
+ icon?: string;
10
+ label?: ReactNode;
11
+ name?: keyof T;
12
+ type?: InfoTableItemType;
13
+ ellipsis?: boolean;
14
+ className?: string;
15
+ dateFormat?: string;
16
+ dateTwoLine?: boolean;
17
+ numberPrefix?: string;
18
+ numberSuffix?: string;
19
+ dividerColor?: TypographyProps['color'];
20
+ dividerLine?: boolean;
21
+ style?: CommonSxProps['style'];
22
+ sx?: BoxProps['sx'];
23
+ labelClassName?: string;
24
+ labelColor?: TypographyProps['color'];
25
+ labelStyle?: CommonSxProps['style'];
26
+ labelSx?: BoxProps['sx'];
27
+ valueClassName?: string;
28
+ valueStyle?: CommonSxProps['style'];
29
+ valueSx?: CommonSxProps['sx'];
30
+ xs?: number;
31
+ sm?: number;
32
+ md?: number;
33
+ lg?: number;
34
+ xl?: number;
35
+ clipboard?: boolean;
36
+ clipboardIcon?: string;
37
+ clipboardText?: string;
38
+ clipboardProps?: Omit<IconButtonProps, 'children'>;
39
+ onRender?(info: T): ReactNode;
40
+ onRenderEmpty?(info: T): ReactNode;
41
+ }
42
+ export type InfoTableItems<T = InfoTableInfo> = (InfoTableItem<T> | false | undefined | null)[];
43
+ export type InfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
44
+ export interface InfoTableProps<T = InfoTableInfo> {
45
+ cols: InfoTableCols | {
46
+ xs?: InfoTableCols;
47
+ sm?: InfoTableCols;
48
+ md?: InfoTableCols;
49
+ lg?: InfoTableCols;
50
+ xl?: InfoTableCols;
51
+ };
52
+ spacing?: GridProps['spacing'];
53
+ columnSpacing?: GridProps['spacing'];
54
+ rowSpacing?: GridProps['spacing'];
55
+ className?: string;
56
+ style?: CommonSxProps['style'];
57
+ sx?: CommonSxProps['sx'];
58
+ labelClassName?: string;
59
+ labelColor?: TypographyProps['color'];
60
+ labelStyle?: CommonSxProps['style'];
61
+ labelSx?: BoxProps['sx'];
62
+ dividerColor?: TypographyProps['color'];
63
+ valueClassName?: string;
64
+ valueStyle?: CommonSxProps['style'];
65
+ valueSx?: CommonSxProps['sx'];
66
+ ellipsis?: boolean;
67
+ valueUnderline?: boolean;
68
+ info: T;
69
+ items: InfoTableItems<T>;
70
+ onCopyToClipboard?(item: InfoTableItem<T>, text: string): void;
71
+ }
72
+ export declare const InfoTableDefaultProps: Pick<InfoTableProps, 'spacing' | 'columnSpacing' | 'rowSpacing' | 'labelColor' | 'dividerColor'>;
@@ -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,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 declare const SearchTableDefaultProps: {};
29
- export interface SearchTableCommands<T = TableItem> {
30
- reload(page?: number): void;
31
- getLastLoadData(): FormValueMap;
32
- getSearch(): SearchCommands | undefined;
33
- getTable(): TableCommands<T> | undefined;
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 declare const SearchTableDefaultProps: {};
29
+ export interface SearchTableCommands<T = TableItem> {
30
+ reload(page?: number): void;
31
+ getLastLoadData(): FormValueMap;
32
+ getSearch(): SearchCommands | undefined;
33
+ getTable(): TableCommands<T> | undefined;
34
+ }
@@ -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';
@@ -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,5 +1,5 @@
1
- /// <reference types="react" />
2
- export declare const StyledBodyRow: import("@emotion/styled").StyledComponent<import("@mui/material").TableRowOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
3
- ref?: ((instance: HTMLTableRowElement | null) => void) | import("react").RefObject<HTMLTableRowElement> | null | undefined;
4
- }, "className" | "style" | "classes" | "children" | "hover" | "selected" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
- export declare const StyledNoDataDiv: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /// <reference types="react" />
2
+ export declare const StyledBodyRow: import("@emotion/styled").StyledComponent<import("@mui/material").TableRowOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
3
+ ref?: ((instance: HTMLTableRowElement | null) => void) | import("react").RefObject<HTMLTableRowElement> | null | undefined;
4
+ }, "className" | "style" | "classes" | "children" | "hover" | "selected" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const StyledNoDataDiv: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,115 +1,115 @@
1
- import { 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
- export interface TableItem {
7
- [key: string]: any;
8
- }
9
- export interface TableColumn<T = TableItem> {
10
- id?: string;
11
- type?: 'text' | 'number' | 'tel' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'img' | 'button' | 'buttons' | 'check';
12
- label?: ReactNode;
13
- name?: keyof T;
14
- align?: TableCellProps['align'];
15
- width?: string | number;
16
- minWidth?: string | number;
17
- ellipsis?: boolean;
18
- dateFormat?: string;
19
- dateTwoLine?: boolean;
20
- hideAllCheck?: boolean;
21
- numberPrefix?: string;
22
- numberSuffix?: string;
23
- tooltipProps?: Omit<TooltipProps, 'children' | 'title'>;
24
- display?: {
25
- xs?: boolean;
26
- sm?: boolean;
27
- md?: boolean;
28
- lg?: boolean;
29
- xl?: boolean;
30
- };
31
- paddingLeft?: number;
32
- paddingRight?: number;
33
- head?: {
34
- className?: CommonSxProps['className'];
35
- style?: CommonSxProps['style'];
36
- sx?: CommonSxProps['sx'];
37
- onGetClassName?(): CommonSxProps['className'];
38
- onGetStyle?(): CommonSxProps['style'];
39
- onGetSx?(): CommonSxProps['sx'];
40
- onRender?(): ReactNode;
41
- };
42
- footer?: {
43
- value?: ReactNode;
44
- className?: CommonSxProps['className'];
45
- style?: CommonSxProps['style'];
46
- sx?: CommonSxProps['sx'];
47
- onGetClassName?(): CommonSxProps['className'];
48
- onGetStyle?(): CommonSxProps['style'];
49
- onGetSx?(): CommonSxProps['sx'];
50
- onRender?(): ReactNode;
51
- };
52
- className?: CommonSxProps['className'];
53
- style?: CommonSxProps['style'];
54
- sx?: CommonSxProps['sx'];
55
- onGetClassName?(item: T, index: number): CommonSxProps['className'];
56
- onGetStyle?(item: T, index: number): CommonSxProps['style'];
57
- onGetSx?(item: T, index: number): CommonSxProps['sx'];
58
- onHide?(item: T, index: number): boolean;
59
- onGetTooltip?(item: T, index: number): ReactNode;
60
- onRender?(item: T, index: number): ReactNode;
61
- onClick?(item: T, index: number): void;
62
- onInitChecked?(item: T): boolean;
63
- onCheckDisabled?(item: T): boolean;
64
- onCheckChange?(item: T, checked: boolean): void;
65
- onCheckDisabledChange?(item: T, checkDisabled: boolean): void;
66
- }
67
- export type TableColumns<T = TableItem> = (TableColumn<T> | false | undefined | null)[];
68
- export interface TableProps<T = TableItem> extends CommonSxProps {
69
- caption?: ReactNode;
70
- topHeadRows?: TableTopHeadProps['rows'];
71
- columns?: TableColumns<T>;
72
- defaultAlign?: TableCellProps['align'];
73
- defaultEllipsis?: boolean;
74
- stickyHeader?: boolean;
75
- items?: T[];
76
- paging?: TablePaginationProps['paging'];
77
- pagingAlign?: TablePaginationProps['align'];
78
- height?: string | number;
79
- maxHeight?: string | number;
80
- minHeight?: string | number;
81
- fullHeight?: boolean;
82
- showOddColor?: boolean;
83
- showEvenColor?: boolean;
84
- cellPadding?: string | number;
85
- footer?: boolean;
86
- noData?: ReactNode;
87
- pagination?: {
88
- className?: CommonSxProps['className'];
89
- style?: CommonSxProps['style'];
90
- sx?: CommonSxProps['sx'];
91
- };
92
- sortable?: boolean;
93
- onClick?(item: T, index: number): void;
94
- onGetBodyRowClassName?(item: T, index: number): CommonSxProps['className'] | undefined;
95
- onGetBodyRowStyle?(item: T, index: number): CommonSxProps['style'] | undefined;
96
- onGetBodyRowSx?(item: T, index: number): CommonSxProps['sx'] | undefined;
97
- onGetBodyColumnClassName?(column: TableColumn<T>, item: T, index: number): CommonSxProps['className'] | undefined;
98
- onGetBodyColumnStyle?(column: TableColumn<T>, item: T, index: number): CommonSxProps['style'] | undefined;
99
- onGetBodyColumnSx?(column: TableColumn<T>, item: T, index: number): CommonSxProps['sx'] | undefined;
100
- onPageChange?(page: number): void;
101
- onSortChange?(items: T[]): void;
102
- onCheckChange?(columnId: string, items: T[]): void;
103
- }
104
- export declare const TableDefaultProps: Pick<TableProps, 'defaultAlign' | 'pagingAlign' | 'cellPadding'>;
105
- export interface TableCommands<T = TableItem> {
106
- getColumns(): TableProps<T>['columns'];
107
- setColumns(columns: TableProps<T>['columns']): void;
108
- getItems(): TableProps<T>['items'];
109
- setItems(items: TableProps<T>['items']): void;
110
- getPaging(): TableProps<T>['paging'];
111
- setItemsPaging(items: TableProps<T>['items'], paging: TableProps<T>['paging']): void;
112
- resetSort(): void;
113
- getCheckedItems(columnId: string): T[];
114
- scrollToTop(): void;
115
- }
1
+ import { 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
+ export interface TableItem {
7
+ [key: string]: any;
8
+ }
9
+ export interface TableColumn<T = TableItem> {
10
+ id?: string;
11
+ type?: 'text' | 'number' | 'tel' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'img' | 'button' | 'buttons' | 'check';
12
+ label?: ReactNode;
13
+ name?: keyof T;
14
+ align?: TableCellProps['align'];
15
+ width?: string | number;
16
+ minWidth?: string | number;
17
+ ellipsis?: boolean;
18
+ dateFormat?: string;
19
+ dateTwoLine?: boolean;
20
+ hideAllCheck?: boolean;
21
+ numberPrefix?: string;
22
+ numberSuffix?: string;
23
+ tooltipProps?: Omit<TooltipProps, 'children' | 'title'>;
24
+ display?: {
25
+ xs?: boolean;
26
+ sm?: boolean;
27
+ md?: boolean;
28
+ lg?: boolean;
29
+ xl?: boolean;
30
+ };
31
+ paddingLeft?: number;
32
+ paddingRight?: number;
33
+ head?: {
34
+ className?: CommonSxProps['className'];
35
+ style?: CommonSxProps['style'];
36
+ sx?: CommonSxProps['sx'];
37
+ onGetClassName?(): CommonSxProps['className'];
38
+ onGetStyle?(): CommonSxProps['style'];
39
+ onGetSx?(): CommonSxProps['sx'];
40
+ onRender?(): ReactNode;
41
+ };
42
+ footer?: {
43
+ value?: ReactNode;
44
+ className?: CommonSxProps['className'];
45
+ style?: CommonSxProps['style'];
46
+ sx?: CommonSxProps['sx'];
47
+ onGetClassName?(): CommonSxProps['className'];
48
+ onGetStyle?(): CommonSxProps['style'];
49
+ onGetSx?(): CommonSxProps['sx'];
50
+ onRender?(): ReactNode;
51
+ };
52
+ className?: CommonSxProps['className'];
53
+ style?: CommonSxProps['style'];
54
+ sx?: CommonSxProps['sx'];
55
+ onGetClassName?(item: T, index: number): CommonSxProps['className'];
56
+ onGetStyle?(item: T, index: number): CommonSxProps['style'];
57
+ onGetSx?(item: T, index: number): CommonSxProps['sx'];
58
+ onHide?(item: T, index: number): boolean;
59
+ onGetTooltip?(item: T, index: number): ReactNode;
60
+ onRender?(item: T, index: number): ReactNode;
61
+ onClick?(item: T, index: number): void;
62
+ onInitChecked?(item: T): boolean;
63
+ onCheckDisabled?(item: T): boolean;
64
+ onCheckChange?(item: T, checked: boolean): void;
65
+ onCheckDisabledChange?(item: T, checkDisabled: boolean): void;
66
+ }
67
+ export type TableColumns<T = TableItem> = (TableColumn<T> | false | undefined | null)[];
68
+ export interface TableProps<T = TableItem> extends CommonSxProps {
69
+ caption?: ReactNode;
70
+ topHeadRows?: TableTopHeadProps['rows'];
71
+ columns?: TableColumns<T>;
72
+ defaultAlign?: TableCellProps['align'];
73
+ defaultEllipsis?: boolean;
74
+ stickyHeader?: boolean;
75
+ items?: T[];
76
+ paging?: TablePaginationProps['paging'];
77
+ pagingAlign?: TablePaginationProps['align'];
78
+ height?: string | number;
79
+ maxHeight?: string | number;
80
+ minHeight?: string | number;
81
+ fullHeight?: boolean;
82
+ showOddColor?: boolean;
83
+ showEvenColor?: boolean;
84
+ cellPadding?: string | number;
85
+ footer?: boolean;
86
+ noData?: ReactNode;
87
+ pagination?: {
88
+ className?: CommonSxProps['className'];
89
+ style?: CommonSxProps['style'];
90
+ sx?: CommonSxProps['sx'];
91
+ };
92
+ sortable?: boolean;
93
+ onClick?(item: T, index: number): void;
94
+ onGetBodyRowClassName?(item: T, index: number): CommonSxProps['className'] | undefined;
95
+ onGetBodyRowStyle?(item: T, index: number): CommonSxProps['style'] | undefined;
96
+ onGetBodyRowSx?(item: T, index: number): CommonSxProps['sx'] | undefined;
97
+ onGetBodyColumnClassName?(column: TableColumn<T>, item: T, index: number): CommonSxProps['className'] | undefined;
98
+ onGetBodyColumnStyle?(column: TableColumn<T>, item: T, index: number): CommonSxProps['style'] | undefined;
99
+ onGetBodyColumnSx?(column: TableColumn<T>, item: T, index: number): CommonSxProps['sx'] | undefined;
100
+ onPageChange?(page: number): void;
101
+ onSortChange?(items: T[]): void;
102
+ onCheckChange?(columnId: string, items: T[]): void;
103
+ }
104
+ export declare const TableDefaultProps: Pick<TableProps, 'defaultAlign' | 'pagingAlign' | 'cellPadding'>;
105
+ export interface TableCommands<T = TableItem> {
106
+ getColumns(): TableProps<T>['columns'];
107
+ setColumns(columns: TableProps<T>['columns']): void;
108
+ getItems(): TableProps<T>['items'];
109
+ setItems(items: TableProps<T>['items']): void;
110
+ getPaging(): TableProps<T>['paging'];
111
+ setItemsPaging(items: TableProps<T>['items'], paging: TableProps<T>['paging']): void;
112
+ resetSort(): void;
113
+ getCheckedItems(columnId: string): T[];
114
+ scrollToTop(): void;
115
+ }