@pdg/react-table 1.1.13 → 1.2.0

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 (34) hide show
  1. package/README.md +13 -2
  2. package/dist/PInfoTable/PInfoTable.d.ts +1 -4
  3. package/dist/PInfoTable/PInfoTable.types.d.ts +3 -3
  4. package/dist/PSearchTable/PSearchTable.d.ts +2 -5
  5. package/dist/PSearchTable/PSearchTable.types.d.ts +10 -9
  6. package/dist/PTable/PTable.d.ts +2 -5
  7. package/dist/PTable/PTable.types.d.ts +8 -7
  8. package/dist/PTableBodyCell/PTableBodyCell.d.ts +2 -1
  9. package/dist/PTableBodyCell/PTableBodyCell.types.d.ts +9 -7
  10. package/dist/PTableBodyRow/PTableBodyRow.d.ts +2 -1
  11. package/dist/PTableBodyRow/PTableBodyRow.types.d.ts +8 -8
  12. package/dist/PTableButton/PTableButton.d.ts +1 -1
  13. package/dist/PTableCommonCell/PTableCommonCell.d.ts +3 -2
  14. package/dist/PTableCommonCell/PTableCommonCell.types.d.ts +5 -5
  15. package/dist/PTableContext/PTableContext.d.ts +1 -1
  16. package/dist/PTableContext/PTableContext.types.d.ts +6 -6
  17. package/dist/PTableContext/useTableState.d.ts +2 -1
  18. package/dist/PTableContextProvider/PTableContextProvider.d.ts +2 -1
  19. package/dist/PTableContextProvider/PTableContextProvider.types.d.ts +3 -2
  20. package/dist/PTableFooterCell/PTableFooterCell.d.ts +3 -2
  21. package/dist/PTableFooterCell/PTableFooterCell.types.d.ts +3 -3
  22. package/dist/PTableHeadCell/PTableHeadCell.d.ts +3 -2
  23. package/dist/PTableHeadCell/PTableHeadCell.types.d.ts +4 -4
  24. package/dist/PTableMenuButton/PTableMenuButton.d.ts +1 -1
  25. package/dist/PTablePagination/PTablePagination.d.ts +2 -2
  26. package/dist/PTableSortableBody/PTableSortableBody.d.ts +2 -1
  27. package/dist/PTableSortableBody/PTableSortableBody.types.d.ts +4 -4
  28. package/dist/PTableSortableBodyBlock/PTableSortableBodyBlock.d.ts +2 -1
  29. package/dist/PTableSortableBodyBlock/PTableSortableBodyBlock.types.d.ts +3 -2
  30. package/dist/PTableTopHead/PTableTopHead.d.ts +2 -1
  31. package/dist/PTableTopHead/PTableTopHead.types.d.ts +5 -5
  32. package/dist/index.esm.js +4948 -3819
  33. package/dist/index.js +4948 -3819
  34. package/package.json +37 -17
package/README.md CHANGED
@@ -7,7 +7,18 @@ Typescript React Table Module
7
7
  npm install -D @pdg/react-table
8
8
  ```
9
9
 
10
- ### simplebar-react css 추가
10
+ ### 추가 패키지 설치
11
11
  ```
12
- import 'simplebar-react/dist/simplebar.min.css';
12
+ npm install -D @dnd-kit/core @dnd-kit/sortable @emotion/react @emotion/styled @mui/icons-material @mui/material @mui/x-date-pickers @pdg/react-component @pdg/react-form dayjs simplebar-react
13
13
  ```
14
+
15
+ ## simplebar-react css 추가
16
+ - javascript/typescript 에 추가 시
17
+ ```javascript
18
+ import 'simplebar-react/dist/simplebar.min.css';
19
+ ```
20
+
21
+ - css/scss 에 추가 시
22
+ ```css
23
+ @import 'simplebar-react/dist/simplebar.min.css';
24
+ ```
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import { PInfoTableProps as Props, PInfoTableInfo } from './PInfoTable.types';
3
- interface WithType<T = PInfoTableInfo> extends React.FC<Props<T>> {
4
- <T = PInfoTableInfo>(props: Props<T>): ReturnType<React.FC<Props<T>>>;
5
- }
6
- declare const PInfoTable: WithType;
3
+ declare function PInfoTable<T extends PInfoTableInfo = PInfoTableInfo>({ cols, spacing, columnSpacing, rowSpacing, className, style, sx, labelClassName, labelColor, labelStyle, labelSx, dividerColor, valueClassName, valueStyle, valueSx, ellipsis, valueUnderline, info, items, onCopyToClipboard, }: Props<T>): React.JSX.Element;
7
4
  export default PInfoTable;
@@ -6,7 +6,7 @@ export interface PInfoTableInfo {
6
6
  [key: string]: any;
7
7
  }
8
8
  export type PInfoTableItemType = 'text' | 'number' | 'tel' | 'url' | 'email' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'business_no' | 'personal_no' | 'divider';
9
- export interface PInfoTableItem<T = PInfoTableInfo> {
9
+ export interface PInfoTableItem<T extends PInfoTableInfo = PInfoTableInfo> {
10
10
  icon?: PIconProps['children'];
11
11
  label?: ReactNode;
12
12
  name?: keyof T;
@@ -46,9 +46,9 @@ export interface PInfoTableItem<T = PInfoTableInfo> {
46
46
  onLg?: (info: T) => number;
47
47
  onXl?: (info: T) => number;
48
48
  }
49
- export type PInfoTableItems<T = PInfoTableInfo> = (PInfoTableItem<T> | false | undefined | null)[];
49
+ export type PInfoTableItems<T extends PInfoTableInfo = PInfoTableInfo> = (PInfoTableItem<T> | false | undefined | null)[];
50
50
  export type PInfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
51
- export interface PInfoTableProps<T = PInfoTableInfo> {
51
+ export interface PInfoTableProps<T extends PInfoTableInfo = PInfoTableInfo> {
52
52
  cols: PInfoTableCols | {
53
53
  xs?: PInfoTableCols;
54
54
  sm?: PInfoTableCols;
@@ -1,8 +1,5 @@
1
1
  import React from 'react';
2
- import { PSearchTableProps, PSearchTableCommands } from './PSearchTable.types';
2
+ import { PSearchTableProps as Props } from './PSearchTable.types';
3
3
  import { PTableItem } from '../PTable';
4
- interface WithForwardRefType<T = PTableItem> extends React.FC<PSearchTableProps<T>> {
5
- <T = PTableItem>(props: PSearchTableProps<T> & React.RefAttributes<PSearchTableCommands<T>>): ReturnType<React.FC<PSearchTableProps<T>>>;
6
- }
7
- declare const PSearchTable: WithForwardRefType;
4
+ declare function PSearchTable<T extends PTableItem = PTableItem>({ ref, className, style: initStyle, sx, color, hash, stickyHeader, fullHeight, search, table, betweenSearchTableComponent, onGetData, onRequestHashChange, }: Props<T>): React.JSX.Element;
8
5
  export default PSearchTable;
@@ -8,22 +8,23 @@ export interface PSearchTableSearchInfo {
8
8
  searchGroups?: PSearchTableSearchProps['searchGroups'];
9
9
  props?: Omit<PSearchTableSearchProps, 'ref' | 'searchGroups'>;
10
10
  }
11
- export interface PSearchTableTableInfo {
12
- ref?: PSearchTableTableProps['ref'];
13
- props?: Omit<PSearchTableTableProps, 'ref'>;
11
+ export interface PSearchTableTableInfo<T extends PTableItem = PTableItem> {
12
+ ref?: PSearchTableTableProps<T>['ref'];
13
+ props?: Omit<PSearchTableTableProps<T>, 'ref'>;
14
14
  }
15
- export interface PSearchTableData<T = PTableItem> {
15
+ export interface PSearchTableData<T extends PTableItem = PTableItem> {
16
16
  items: PTableProps<T>['items'];
17
17
  paging?: PTableProps<T>['paging'];
18
18
  }
19
19
  export interface PSearchTableSearchProps extends Omit<PSearchProps, 'ref' | 'color' | 'autoSubmit' | 'onSubmit'> {
20
- ref?: React.ForwardedRef<PSearchCommands>;
20
+ ref?: React.Ref<PSearchCommands>;
21
21
  searchGroups?: ReactNode;
22
22
  }
23
- export interface PSearchTableTableProps<T = PTableItem> extends Omit<PTableProps<T>, 'ref' | 'items' | 'paging' | 'onPageChange'> {
24
- ref?: React.ForwardedRef<PTableCommands<T>>;
23
+ export interface PSearchTableTableProps<T extends PTableItem = PTableItem> extends Omit<PTableProps<T>, 'ref' | 'items' | 'paging' | 'onPageChange'> {
24
+ ref?: React.Ref<PTableCommands<T>>;
25
25
  }
26
- export interface PSearchTableProps<T = PTableItem> extends PTableCommonSxProps {
26
+ export interface PSearchTableProps<T extends PTableItem = PTableItem> extends PTableCommonSxProps {
27
+ ref?: React.Ref<PSearchTableCommands<T>>;
27
28
  color?: PSearchProps['color'];
28
29
  hash?: boolean;
29
30
  stickyHeader?: boolean;
@@ -34,7 +35,7 @@ export interface PSearchTableProps<T = PTableItem> extends PTableCommonSxProps {
34
35
  onGetData?(data: PFormValueMap): Promise<PSearchTableData<T>>;
35
36
  onRequestHashChange?: (hash: string) => void;
36
37
  }
37
- export interface PSearchTableCommands<T = PTableItem> {
38
+ export interface PSearchTableCommands<T extends PTableItem = PTableItem> {
38
39
  reload: (page?: number) => void;
39
40
  getLastLoadData: () => PFormValueMap;
40
41
  getSearch: () => PSearchCommands | undefined;
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
- import { PTableProps, PTableCommands, PTableItem } from './PTable.types';
3
- interface WithForwardRefType<T = PTableItem> extends React.FC<PTableProps<T>> {
4
- <T = PTableItem>(props: PTableProps<T> & React.RefAttributes<PTableCommands<T>>): ReturnType<React.FC<PTableProps<T>>>;
5
- }
6
- declare const PTable: WithForwardRefType;
2
+ import { PTableProps as Props, PTableItem } from './PTable.types';
3
+ declare function PTable<T extends PTableItem = PTableItem>({ ref, className, style: initStyle, sx, caption, topHeadRows, columns: initColumns, items: initItems, paging: initPaging, pagingAlign, defaultAlign, defaultEllipsis, stickyHeader: initStickyHeader, height, minHeight, maxHeight, fullHeight, showOddColor, showEvenColor, cellPadding, footer, noData, pagination, sortable, progressiveVisible, onClick, onGetBodyRowClassName, onGetBodyRowStyle, onGetBodyRowSx, onGetBodyColumnClassName, onGetBodyColumnStyle, onGetBodyColumnSx, onPageChange, onSortChange, onCheckChange, }: Props<T>): React.JSX.Element | null;
7
4
  export default PTable;
@@ -1,6 +1,6 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
2
  import { TableCellProps, TooltipProps } from '@mui/material';
3
- import { PTablePaginationProps } from '../PTablePagination/PTablePagination.types';
3
+ import { PTablePaginationProps } from '../PTablePagination';
4
4
  import { PTableCommonSxProps } from '../@types';
5
5
  import { PTableTopHeadProps } from '../PTableTopHead';
6
6
  /********************************************************************************************************************
@@ -20,7 +20,7 @@ export interface PTableProgressiveVisibleInfo {
20
20
  /********************************************************************************************************************
21
21
  * PTableColumn
22
22
  * ******************************************************************************************************************/
23
- export interface PTableColumn<T = PTableItem> {
23
+ export interface PTableColumn<T extends PTableItem = PTableItem> {
24
24
  id?: string;
25
25
  type?: 'text' | 'number' | 'tel' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'business_no' | 'personal_no' | 'img' | 'button' | 'buttons' | 'check';
26
26
  label?: ReactNode;
@@ -81,13 +81,14 @@ export interface PTableColumn<T = PTableItem> {
81
81
  onCheckChange?: (item: T, checked: boolean) => void;
82
82
  onCheckDisabledChange?: (item: T, checkDisabled: boolean) => void;
83
83
  }
84
- export type PTableColumns<T = PTableItem> = (PTableColumn<T> | false | undefined | null)[];
84
+ export type PTableColumns<T extends PTableItem = PTableItem> = (PTableColumn<T> | false | undefined | null)[];
85
85
  /********************************************************************************************************************
86
86
  * TableProps
87
87
  * ******************************************************************************************************************/
88
- export interface PTableProps<T = PTableItem> extends PTableCommonSxProps {
88
+ export interface PTableProps<T extends PTableItem = PTableItem> extends PTableCommonSxProps {
89
+ ref?: React.Ref<PTableCommands<T>>;
89
90
  caption?: ReactNode;
90
- topHeadRows?: PTableTopHeadProps['rows'];
91
+ topHeadRows?: PTableTopHeadProps<T>['rows'];
91
92
  columns?: PTableColumns<T>;
92
93
  defaultAlign?: TableCellProps['align'];
93
94
  defaultEllipsis?: boolean;
@@ -125,7 +126,7 @@ export interface PTableProps<T = PTableItem> extends PTableCommonSxProps {
125
126
  /********************************************************************************************************************
126
127
  * PTableCommands
127
128
  * ******************************************************************************************************************/
128
- export interface PTableCommands<T = PTableItem> {
129
+ export interface PTableCommands<T extends PTableItem = PTableItem> {
129
130
  getColumns: () => PTableProps<T>['columns'];
130
131
  setColumns: (columns: PTableProps<T>['columns']) => void;
131
132
  getItems: () => PTableProps<T>['items'];
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PTableBodyCellProps as Props } from './PTableBodyCell.types';
3
- declare const PTableBodyCell: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLTableCellElement>>;
3
+ import { PTableItem } from '../PTable/PTable.types';
4
+ declare function PTableBodyCell<T extends PTableItem = PTableItem>({ ref, className, style, sx, item, index, column, defaultAlign, defaultEllipsis, onClick, onCheckChange, }: Props<T>): React.JSX.Element;
4
5
  export default PTableBodyCell;
@@ -1,18 +1,20 @@
1
- import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
1
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable';
2
2
  import { PTableCommonSxProps } from '../@types';
3
+ import React from 'react';
3
4
  export interface PTableBodyCellCommands {
4
5
  setChecked: (checked: boolean) => void;
5
6
  setCheckDisabled: (disabled: boolean) => void;
6
7
  }
7
- export interface PTableBodyCellProps {
8
+ export interface PTableBodyCellProps<T extends PTableItem = PTableItem> {
9
+ ref?: React.Ref<HTMLTableCellElement>;
8
10
  className?: PTableCommonSxProps['className'];
9
11
  style?: PTableCommonSxProps['style'];
10
12
  sx?: PTableCommonSxProps['sx'];
11
13
  index: number;
12
- item: PTableItem;
13
- column: PTableColumn;
14
- defaultAlign?: PTableProps['defaultAlign'];
14
+ item: T;
15
+ column: PTableColumn<T>;
16
+ defaultAlign?: PTableProps<T>['defaultAlign'];
15
17
  defaultEllipsis?: boolean;
16
- onClick: PTableProps['onClick'];
17
- onCheckChange: (item: PTableItem, column: PTableColumn, checked: boolean) => void;
18
+ onClick: PTableProps<T>['onClick'];
19
+ onCheckChange: (item: T, column: PTableColumn<T>, checked: boolean) => void;
18
20
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PTableBodyRowProps as Props } from './PTableBodyRow.types';
3
+ import { PTableItem } from '../PTable';
3
4
  export declare const PStyledBodyRow: import("@emotion/styled").StyledComponent<import("@mui/material").TableRowOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "className" | "style" | "classes" | "children" | "hover" | "selected" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
- declare const PTableBodyRow: React.FC<Props>;
5
+ declare function PTableBodyRow<T extends PTableItem = PTableItem>({ className, style, id, index, defaultAlign, defaultEllipsis, sortable, columns, item, onClick, onCheckChange, onGetColumnClassName, onGetColumnStyle, onGetColumnSx, ...props }: Props<T>): React.JSX.Element;
5
6
  export default PTableBodyRow;
@@ -2,17 +2,17 @@ import { TableCellProps, TableRowProps } from '@mui/material';
2
2
  import { PTableColumn, PTableItem, PTableProps } from '../PTable';
3
3
  import { PTableBodyCellProps } from '../PTableBodyCell';
4
4
  import { PTableCommonSxProps } from '../@types';
5
- export interface PTableBodyRowProps extends Omit<TableRowProps, 'id' | 'onClick'> {
5
+ export interface PTableBodyRowProps<T extends PTableItem = PTableItem> extends Omit<TableRowProps, 'id' | 'onClick'> {
6
6
  id: string | number;
7
7
  index: number;
8
8
  defaultAlign?: TableCellProps['align'];
9
9
  defaultEllipsis?: boolean;
10
10
  sortable?: boolean;
11
- columns: PTableColumn[];
12
- item: PTableItem;
13
- onClick: PTableProps['onClick'];
14
- onCheckChange: PTableBodyCellProps['onCheckChange'];
15
- onGetColumnClassName?: (column: PTableColumn, item: PTableItem, index: number) => PTableCommonSxProps['className'] | undefined;
16
- onGetColumnStyle?: (column: PTableColumn, item: PTableItem, index: number) => PTableCommonSxProps['style'] | undefined;
17
- onGetColumnSx?: (column: PTableColumn, item: PTableItem, index: number) => PTableCommonSxProps['sx'] | undefined;
11
+ columns: PTableColumn<T>[];
12
+ item: T;
13
+ onClick: PTableProps<T>['onClick'];
14
+ onCheckChange: PTableBodyCellProps<T>['onCheckChange'];
15
+ onGetColumnClassName?: (column: PTableColumn<T>, item: T, index: number) => PTableCommonSxProps['className'] | undefined;
16
+ onGetColumnStyle?: (column: PTableColumn<T>, item: T, index: number) => PTableCommonSxProps['style'] | undefined;
17
+ onGetColumnSx?: (column: PTableColumn<T>, item: T, index: number) => PTableCommonSxProps['sx'] | undefined;
18
18
  }
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { PTableButtonProps as Props } from './PTableButton.types';
3
- declare const _default: React.NamedExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
3
+ declare const _default: React.MemoExoticComponent<({ children, className, sx: initSx, variant, color, startIcon, endIcon, onClick, ...props }: Props) => React.JSX.Element>;
4
4
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
- import { PTableCommonCellProps } from './PTableCommonCell.types';
3
- declare const PTableCommonCell: React.ForwardRefExoticComponent<PTableCommonCellProps & React.RefAttributes<HTMLTableCellElement>>;
2
+ import { PTableCommonCellProps as Props } from './PTableCommonCell.types';
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableCommonCell<T extends PTableItem = PTableItem>({ ref, children, className: initClassName, style: initStyle, sx: initSx, type, column, defaultAlign, defaultEllipsis: initDefaultEllipsis, index, item, onClick, }: Props<T>): React.JSX.Element;
4
5
  export default PTableCommonCell;
@@ -1,11 +1,11 @@
1
+ import React from 'react';
1
2
  import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
2
3
  import { PTableCommonSxProps } from '../@types';
3
- export interface PTableCommonCellProps extends PTableCommonSxProps {
4
+ export interface PTableCommonCellProps<T extends PTableItem = PTableItem> extends PTableCommonSxProps, Pick<PTableProps<T>, 'defaultAlign' | 'onClick'> {
5
+ ref?: React.Ref<HTMLTableCellElement>;
4
6
  type: 'head' | 'body' | 'footer';
5
- column: PTableColumn;
6
- defaultAlign?: PTableProps['defaultAlign'];
7
+ column: PTableColumn<T>;
7
8
  defaultEllipsis?: boolean;
8
9
  index?: number;
9
- item?: PTableItem;
10
- onClick?: PTableProps['onClick'];
10
+ item?: T;
11
11
  }
@@ -1,3 +1,3 @@
1
1
  import { PTableContextValue } from './PTableContext.types';
2
- declare const PTableContext: import("react").Context<PTableContextValue>;
2
+ declare const PTableContext: import("react").Context<PTableContextValue<import("..").PTableItem>>;
3
3
  export default PTableContext;
@@ -1,14 +1,14 @@
1
1
  import { PTableColumn, PTableItem, PTableProgressiveVisibleInfo } from '../PTable';
2
2
  import { PTableBodyCellCommands } from '../PTableBodyCell';
3
3
  import { PTableHeadCellCommands } from '../PTableHeadCell';
4
- export interface PTableContextValue {
4
+ export interface PTableContextValue<T extends PTableItem = PTableItem> {
5
5
  menuOpen: boolean;
6
6
  openMenuId?: string;
7
7
  progressiveVisible?: PTableProgressiveVisibleInfo;
8
8
  setMenuOpen: (menuOpen: boolean, openMenuId?: string) => void;
9
- setItemColumnChecked: (item: PTableItem, column: PTableColumn, checked: boolean) => void;
10
- setItemColumnCheckDisabled: (item: PTableItem, column: PTableColumn, checkDisabled: boolean) => void;
11
- setItemColumnCommands: (item: PTableItem, column: PTableColumn, commands: PTableBodyCellCommands) => void;
12
- setHeadColumnChecked: (column: PTableColumn, checked: boolean) => void;
13
- setHeadColumnCommands: (column: PTableColumn, commands: PTableHeadCellCommands) => void;
9
+ setItemColumnChecked: (item: T, column: PTableColumn<T>, checked: boolean) => void;
10
+ setItemColumnCheckDisabled: (item: T, column: PTableColumn<T>, checkDisabled: boolean) => void;
11
+ setItemColumnCommands: (item: T, column: PTableColumn<T>, commands: PTableBodyCellCommands) => void;
12
+ setHeadColumnChecked: (column: PTableColumn<T>, checked: boolean) => void;
13
+ setHeadColumnCommands: (column: PTableColumn<T>, commands: PTableHeadCellCommands) => void;
14
14
  }
@@ -1,2 +1,3 @@
1
1
  import { PTableContextValue } from './PTableContext.types';
2
- export default function useTableState(): PTableContextValue;
2
+ import { PTableItem } from '../PTable';
3
+ export default function useTableState<T extends PTableItem = PTableItem>(): PTableContextValue<T>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PTableContextProviderProps as Props } from './PTableContextProvider.types';
3
- declare const PTableContextProvider: React.FC<Props>;
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableContextProvider<T extends PTableItem = PTableItem>({ children, value }: Props<T>): React.JSX.Element;
4
5
  export default PTableContextProvider;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { PTableContextValue } from '../PTableContext';
3
- export interface PTableContextProviderProps {
4
- value: PTableContextValue;
3
+ import { PTableItem } from '../PTable';
4
+ export interface PTableContextProviderProps<T extends PTableItem = PTableItem> {
5
+ value: PTableContextValue<T>;
5
6
  children: ReactNode;
6
7
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
- import { PTableFooterCellProps } from './PTableFooterCell.types';
3
- declare const PTableFooterCell: React.FC<PTableFooterCellProps>;
2
+ import { PTableFooterCellProps as Props } from './PTableFooterCell.types';
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableFooterCell<T extends PTableItem = PTableItem>({ column, items, defaultAlign }: Props<T>): React.JSX.Element;
4
5
  export default PTableFooterCell;
@@ -1,6 +1,6 @@
1
1
  import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
2
- export interface PTableFooterCellProps<T = PTableItem> {
3
- column: PTableColumn;
2
+ export interface PTableFooterCellProps<T extends PTableItem = PTableItem> {
3
+ column: PTableColumn<T>;
4
4
  items?: T[];
5
- defaultAlign?: PTableProps['defaultAlign'];
5
+ defaultAlign?: PTableProps<T>['defaultAlign'];
6
6
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
- import { PTableHeadCellProps } from './PTableHeadCell.types';
3
- declare const PTableHeadCell: React.FC<PTableHeadCellProps>;
2
+ import { PTableHeadCellProps as Props } from './PTableHeadCell.types';
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableHeadCell<T extends PTableItem = PTableItem>({ column, items, defaultAlign, top, onCheckChange, }: Props<T>): React.JSX.Element;
4
5
  export default PTableHeadCell;
@@ -3,10 +3,10 @@ export interface PTableHeadCellCommands {
3
3
  setChecked: (checked: boolean) => void;
4
4
  setCheckDisabled: (checkDisabled: boolean) => void;
5
5
  }
6
- export interface PTableHeadCellProps<T = PTableItem> {
7
- column: PTableColumn;
6
+ export interface PTableHeadCellProps<T extends PTableItem = PTableItem> {
7
+ column: PTableColumn<T>;
8
8
  items?: T[];
9
- defaultAlign?: PTableProps['defaultAlign'];
9
+ defaultAlign?: PTableProps<T>['defaultAlign'];
10
10
  top?: number;
11
- onCheckChange: (column: PTableColumn, checked: boolean) => void;
11
+ onCheckChange: (column: PTableColumn<T>, checked: boolean) => void;
12
12
  }
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { PTableMenuButtonProps as Props } from './PTableMenuButton.types';
3
- declare const PTableMenuButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
3
+ declare const PTableMenuButton: ({ ref, children, className, sx: initSx, color, variant, startIcon, placement, inModal, zIndex, menuList, ...props }: Props) => React.JSX.Element;
4
4
  export default PTableMenuButton;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { PTablePaginationProps } from './PTablePagination.types';
3
- declare const PTablePagination: React.FC<PTablePaginationProps>;
2
+ import { PTablePaginationProps as Props } from './PTablePagination.types';
3
+ declare const PTablePagination: ({ className, style, sx, paging, align, onChange }: Props) => React.JSX.Element;
4
4
  export default PTablePagination;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PTableSortableBodyProps as Props } from './PTableSortableBody.types';
3
- export declare const PTableSortableBody: ({ items, columns, showOddColor, showEvenColor, onGetBodyRowStyle, onGetBodyRowSx, onGetBodyRowClassName, onGetBodyColumnClassName, onGetBodyColumnStyle, onGetBodyColumnSx, defaultAlign, defaultEllipsis, sortable, onClick, onCheckChange, }: Props) => React.JSX.Element;
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableSortableBody<T extends PTableItem = PTableItem>({ items, columns, showOddColor, showEvenColor, onGetBodyRowStyle, onGetBodyRowSx, onGetBodyRowClassName, onGetBodyColumnClassName, onGetBodyColumnStyle, onGetBodyColumnSx, defaultAlign, defaultEllipsis, sortable, onClick, onCheckChange, }: Props<T>): React.JSX.Element;
4
5
  export default PTableSortableBody;
@@ -1,8 +1,8 @@
1
- import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
1
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable';
2
2
  import { PTableBodyRowProps } from '../PTableBodyRow';
3
- export interface PTableSortableBodyProps extends Pick<PTableProps, 'showOddColor' | 'showEvenColor' | 'onGetBodyRowSx' | 'onGetBodyRowClassName' | 'onGetBodyRowStyle' | 'onGetBodyColumnClassName' | 'onGetBodyColumnSx' | 'onGetBodyColumnStyle' | 'defaultAlign' | 'defaultEllipsis' | 'sortable' | 'onClick'>, Pick<PTableBodyRowProps, 'onCheckChange'> {
4
- items: (PTableItem & {
3
+ export interface PTableSortableBodyProps<T extends PTableItem = PTableItem> extends Pick<PTableProps<T>, 'showOddColor' | 'showEvenColor' | 'onGetBodyRowSx' | 'onGetBodyRowClassName' | 'onGetBodyRowStyle' | 'onGetBodyColumnClassName' | 'onGetBodyColumnSx' | 'onGetBodyColumnStyle' | 'defaultAlign' | 'defaultEllipsis' | 'sortable' | 'onClick'>, Pick<PTableBodyRowProps<T>, 'onCheckChange'> {
4
+ items: (T & {
5
5
  id: number | string;
6
6
  })[];
7
- columns: PTableColumn[];
7
+ columns: PTableColumn<T>[];
8
8
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PTableSortableBodyBlockProps as Props } from './PTableSortableBodyBlock.types';
3
- export declare const PTableSortableBodyBlock: ({ items, baseIndex, columns, showOddColor, showEvenColor, onGetBodyRowStyle, onGetBodyRowSx, onGetBodyRowClassName, onGetBodyColumnClassName, onGetBodyColumnStyle, onGetBodyColumnSx, defaultAlign, defaultEllipsis, sortable, onClick, onCheckChange, }: Props) => React.JSX.Element;
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableSortableBodyBlock<T extends PTableItem = PTableItem>({ items, baseIndex, columns, showOddColor, showEvenColor, onGetBodyRowStyle, onGetBodyRowSx, onGetBodyRowClassName, onGetBodyColumnClassName, onGetBodyColumnStyle, onGetBodyColumnSx, defaultAlign, defaultEllipsis, sortable, onClick, onCheckChange, }: Props<T>): React.JSX.Element;
4
5
  export default PTableSortableBodyBlock;
@@ -1,4 +1,5 @@
1
- import { PTableSortableBodyProps } from '../PTableSortableBody/PTableSortableBody.types';
2
- export interface PTableSortableBodyBlockProps extends PTableSortableBodyProps {
1
+ import { PTableSortableBodyProps } from '../PTableSortableBody';
2
+ import { PTableItem } from '../PTable';
3
+ export interface PTableSortableBodyBlockProps<T extends PTableItem = PTableItem> extends PTableSortableBodyProps<T> {
3
4
  baseIndex: number;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PTableTopHeadProps as Props } from './PTableTopHead.types';
3
- declare const PTableTopHead: React.FC<Props>;
3
+ import { PTableItem } from '../PTable';
4
+ declare function PTableTopHead<T extends PTableItem = PTableItem>({ columns, items, rows, caption, defaultAlign, onCheckChange, }: Props<T>): React.JSX.Element;
4
5
  export default PTableTopHead;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { TableCellProps } from '@mui/material';
3
- import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
3
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable';
4
4
  export interface PTableTopHeadRowColumn {
5
5
  colSpan?: number;
6
6
  rowSpan?: number;
@@ -8,11 +8,11 @@ export interface PTableTopHeadRowColumn {
8
8
  align?: TableCellProps['align'];
9
9
  }
10
10
  export type PTableTopHeadRowColumnValue = PTableTopHeadRowColumn | false | undefined | null;
11
- export interface PTableTopHeadProps<T = PTableItem> {
11
+ export interface PTableTopHeadProps<T extends PTableItem = PTableItem> {
12
12
  caption?: ReactNode;
13
13
  rows?: PTableTopHeadRowColumnValue[] | PTableTopHeadRowColumnValue[][];
14
- columns: PTableColumn[];
14
+ columns: PTableColumn<T>[];
15
15
  items?: T[];
16
- defaultAlign: PTableProps['defaultAlign'];
17
- onCheckChange: (column: PTableColumn, checked: boolean) => void;
16
+ defaultAlign: PTableProps<T>['defaultAlign'];
17
+ onCheckChange: (column: PTableColumn<T>, checked: boolean) => void;
18
18
  }