@pdg/react-table 1.0.139 → 1.1.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 (98) hide show
  1. package/dist/@types/types.d.ts +2 -2
  2. package/dist/PInfoTable/PInfoTable.d.ts +7 -0
  3. package/dist/{InfoTable/InfoTable.types.d.ts → PInfoTable/PInfoTable.types.d.ts} +27 -27
  4. package/dist/PInfoTable/index.d.ts +4 -0
  5. package/dist/PSearchTable/PSearchTable.d.ts +8 -0
  6. package/dist/PSearchTable/PSearchTable.types.d.ts +42 -0
  7. package/dist/PSearchTable/index.d.ts +4 -0
  8. package/dist/PTable/PTable.d.ts +7 -0
  9. package/dist/{Table/Table.types.d.ts → PTable/PTable.types.d.ts} +51 -51
  10. package/dist/PTable/index.d.ts +4 -0
  11. package/dist/PTableBodyRow/PTableBodyRow.d.ts +5 -0
  12. package/dist/PTableBodyRow/PTableBodyRow.types.d.ts +18 -0
  13. package/dist/PTableBodyRow/index.d.ts +4 -0
  14. package/dist/{TableButton/TableButton.d.ts → PTableButton/PTableButton.d.ts} +1 -1
  15. package/dist/PTableButton/PTableButton.types.d.ts +3 -0
  16. package/dist/PTableButton/index.d.ts +4 -0
  17. package/dist/PTableCommonCell/PTableCommonCell.d.ts +4 -0
  18. package/dist/PTableCommonCell/PTableCommonCell.types.d.ts +11 -0
  19. package/dist/PTableCommonCell/index.d.ts +4 -0
  20. package/dist/PTableContext/PTableContext.d.ts +3 -0
  21. package/dist/PTableContext/PTableContext.types.d.ts +15 -0
  22. package/dist/PTableContext/index.d.ts +5 -0
  23. package/dist/PTableContext/useTableState.d.ts +2 -0
  24. package/dist/PTableContextProvider/PTableContextProvider.d.ts +4 -0
  25. package/dist/PTableContextProvider/PTableContextProvider.types.d.ts +6 -0
  26. package/dist/PTableContextProvider/index.d.ts +4 -0
  27. package/dist/PTableFooterCell/PTableFooterCell.d.ts +4 -0
  28. package/dist/PTableFooterCell/PTableFooterCell.types.d.ts +6 -0
  29. package/dist/PTableFooterCell/index.d.ts +4 -0
  30. package/dist/PTableHeadCell/PTableHeadCell.d.ts +4 -0
  31. package/dist/PTableHeadCell/PTableHeadCell.types.d.ts +12 -0
  32. package/dist/PTableHeadCell/index.d.ts +4 -0
  33. package/dist/PTableMenuButton/PTableMenuButton.d.ts +4 -0
  34. package/dist/{TableMenuButton/TableMenuButton.types.d.ts → PTableMenuButton/PTableMenuButton.types.d.ts} +2 -2
  35. package/dist/PTableMenuButton/index.d.ts +4 -0
  36. package/dist/PTablePagination/PTablePagination.d.ts +4 -0
  37. package/dist/PTablePagination/PTablePagination.types.d.ts +13 -0
  38. package/dist/PTablePagination/index.d.ts +4 -0
  39. package/dist/PTableSortableBody/PTableSortableBody.d.ts +4 -0
  40. package/dist/PTableSortableBody/PTableSortableBody.types.d.ts +8 -0
  41. package/dist/PTableSortableBody/index.d.ts +4 -0
  42. package/dist/PTableSortableBodyBlock/PTableSortableBodyBlock.d.ts +4 -0
  43. package/dist/PTableSortableBodyBlock/PTableSortableBodyBlock.types.d.ts +4 -0
  44. package/dist/PTableSortableBodyBlock/index.d.ts +4 -0
  45. package/dist/PTableTopHead/PTableTopHead.d.ts +4 -0
  46. package/dist/PTableTopHead/PTableTopHead.types.d.ts +18 -0
  47. package/dist/PTableTopHead/index.d.ts +4 -0
  48. package/dist/TableBodyCell/PTableBodyCell.d.ts +4 -0
  49. package/dist/TableBodyCell/PTableBodyCell.types.d.ts +18 -0
  50. package/dist/TableBodyCell/index.d.ts +4 -4
  51. package/dist/index.d.ts +5 -5
  52. package/dist/index.esm.js +81 -81
  53. package/dist/index.js +78 -78
  54. package/package.json +13 -8
  55. package/dist/InfoTable/InfoTable.d.ts +0 -7
  56. package/dist/InfoTable/index.d.ts +0 -4
  57. package/dist/SearchTable/SearchTable.d.ts +0 -8
  58. package/dist/SearchTable/SearchTable.types.d.ts +0 -42
  59. package/dist/SearchTable/index.d.ts +0 -4
  60. package/dist/Table/Table.d.ts +0 -7
  61. package/dist/Table/index.d.ts +0 -4
  62. package/dist/TableBodyCell/TableBodyCell.d.ts +0 -4
  63. package/dist/TableBodyCell/TableBodyCell.types.d.ts +0 -18
  64. package/dist/TableBodyRow/TableBodyRow.d.ts +0 -5
  65. package/dist/TableBodyRow/TableBodyRow.types.d.ts +0 -18
  66. package/dist/TableBodyRow/index.d.ts +0 -4
  67. package/dist/TableButton/TableButton.types.d.ts +0 -3
  68. package/dist/TableButton/index.d.ts +0 -4
  69. package/dist/TableCommonCell/TableCommonCell.d.ts +0 -4
  70. package/dist/TableCommonCell/TableCommonCell.types.d.ts +0 -11
  71. package/dist/TableCommonCell/index.d.ts +0 -4
  72. package/dist/TableContext/TableContext.d.ts +0 -3
  73. package/dist/TableContext/TableContext.types.d.ts +0 -15
  74. package/dist/TableContext/index.d.ts +0 -5
  75. package/dist/TableContext/useTableState.d.ts +0 -2
  76. package/dist/TableContextProvider/TableContextProvider.d.ts +0 -4
  77. package/dist/TableContextProvider/TableContextProvider.types.d.ts +0 -6
  78. package/dist/TableContextProvider/index.d.ts +0 -4
  79. package/dist/TableFooterCell/TableFooterCell.d.ts +0 -4
  80. package/dist/TableFooterCell/TableFooterCell.types.d.ts +0 -6
  81. package/dist/TableFooterCell/index.d.ts +0 -4
  82. package/dist/TableHeadCell/TableHeadCell.d.ts +0 -4
  83. package/dist/TableHeadCell/TableHeadCell.types.d.ts +0 -12
  84. package/dist/TableHeadCell/index.d.ts +0 -4
  85. package/dist/TableMenuButton/TableMenuButton.d.ts +0 -4
  86. package/dist/TableMenuButton/index.d.ts +0 -4
  87. package/dist/TablePagination/TablePagination.d.ts +0 -4
  88. package/dist/TablePagination/TablePagination.types.d.ts +0 -13
  89. package/dist/TablePagination/index.d.ts +0 -4
  90. package/dist/TableSortableBody/TableSortableBody.d.ts +0 -4
  91. package/dist/TableSortableBody/TableSortableBody.types.d.ts +0 -8
  92. package/dist/TableSortableBody/index.d.ts +0 -4
  93. package/dist/TableSortableBodyBlock/TableSortableBodyBlock.d.ts +0 -4
  94. package/dist/TableSortableBodyBlock/TableSortableBodyBlock.types.d.ts +0 -4
  95. package/dist/TableSortableBodyBlock/index.d.ts +0 -4
  96. package/dist/TableTopHead/TableTopHead.d.ts +0 -4
  97. package/dist/TableTopHead/TableTopHead.types.d.ts +0 -18
  98. package/dist/TableTopHead/index.d.ts +0 -4
@@ -1,11 +1,11 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { Theme } from '@mui/material/styles';
4
- export interface TableCommonProps {
4
+ export interface PTableCommonProps {
5
5
  children?: ReactNode;
6
6
  className?: string;
7
7
  style?: CSSProperties;
8
8
  }
9
- export interface TableCommonSxProps extends TableCommonProps {
9
+ export interface PTableCommonSxProps extends PTableCommonProps {
10
10
  sx?: SxProps<Theme>;
11
11
  }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
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;
7
+ export default PInfoTable;
@@ -1,16 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BoxProps, GridProps, IconButtonProps, TypographyProps } from '@mui/material';
3
- import { TableCommonSxProps } from '../@types';
4
- import { PdgIconProps } from '@pdg/react-component';
5
- export interface InfoTableInfo {
3
+ import { PTableCommonSxProps } from '../@types';
4
+ import { PIconProps } from '@pdg/react-component';
5
+ export interface PInfoTableInfo {
6
6
  [key: string]: any;
7
7
  }
8
- export type InfoTableItemType = 'text' | 'number' | 'tel' | 'url' | 'email' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'business_no' | 'personal_no' | 'divider';
9
- export interface InfoTableItem<T = InfoTableInfo> {
10
- icon?: PdgIconProps['children'];
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> {
10
+ icon?: PIconProps['children'];
11
11
  label?: ReactNode;
12
12
  name?: keyof T;
13
- type?: InfoTableItemType;
13
+ type?: PInfoTableItemType;
14
14
  ellipsis?: boolean;
15
15
  className?: string;
16
16
  dateFormat?: string;
@@ -19,15 +19,15 @@ export interface InfoTableItem<T = InfoTableInfo> {
19
19
  numberSuffix?: string;
20
20
  dividerColor?: TypographyProps['color'];
21
21
  dividerLine?: boolean;
22
- style?: TableCommonSxProps['style'];
22
+ style?: PTableCommonSxProps['style'];
23
23
  sx?: BoxProps['sx'];
24
24
  labelClassName?: string;
25
25
  labelColor?: TypographyProps['color'];
26
- labelStyle?: TableCommonSxProps['style'];
26
+ labelStyle?: PTableCommonSxProps['style'];
27
27
  labelSx?: BoxProps['sx'];
28
28
  valueClassName?: string;
29
- valueStyle?: TableCommonSxProps['style'];
30
- valueSx?: TableCommonSxProps['sx'];
29
+ valueStyle?: PTableCommonSxProps['style'];
30
+ valueSx?: PTableCommonSxProps['sx'];
31
31
  xs?: number;
32
32
  sm?: number;
33
33
  md?: number;
@@ -46,33 +46,33 @@ export interface InfoTableItem<T = InfoTableInfo> {
46
46
  onLg?(info: T): number;
47
47
  onXl?(info: T): number;
48
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;
49
+ export type PInfoTableItems<T = PInfoTableInfo> = (PInfoTableItem<T> | false | undefined | null)[];
50
+ export type PInfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
51
+ export interface PInfoTableProps<T = PInfoTableInfo> {
52
+ cols: PInfoTableCols | {
53
+ xs?: PInfoTableCols;
54
+ sm?: PInfoTableCols;
55
+ md?: PInfoTableCols;
56
+ lg?: PInfoTableCols;
57
+ xl?: PInfoTableCols;
58
58
  };
59
59
  spacing?: GridProps['spacing'];
60
60
  columnSpacing?: GridProps['spacing'];
61
61
  rowSpacing?: GridProps['spacing'];
62
62
  className?: string;
63
- style?: TableCommonSxProps['style'];
64
- sx?: TableCommonSxProps['sx'];
63
+ style?: PTableCommonSxProps['style'];
64
+ sx?: PTableCommonSxProps['sx'];
65
65
  labelClassName?: string;
66
66
  labelColor?: TypographyProps['color'];
67
- labelStyle?: TableCommonSxProps['style'];
67
+ labelStyle?: PTableCommonSxProps['style'];
68
68
  labelSx?: BoxProps['sx'];
69
69
  dividerColor?: TypographyProps['color'];
70
70
  valueClassName?: string;
71
- valueStyle?: TableCommonSxProps['style'];
72
- valueSx?: TableCommonSxProps['sx'];
71
+ valueStyle?: PTableCommonSxProps['style'];
72
+ valueSx?: PTableCommonSxProps['sx'];
73
73
  ellipsis?: boolean;
74
74
  valueUnderline?: boolean;
75
75
  info: T;
76
- items: InfoTableItems<T>;
77
- onCopyToClipboard?(item: InfoTableItem<T>, text: string): void;
76
+ items: PInfoTableItems<T>;
77
+ onCopyToClipboard?(item: PInfoTableItem<T>, text: string): void;
78
78
  }
@@ -0,0 +1,4 @@
1
+ import PInfoTable from './PInfoTable';
2
+ export default PInfoTable;
3
+ export { PInfoTable };
4
+ export * from './PInfoTable.types';
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { PSearchTableProps, PSearchTableCommands } from './PSearchTable.types';
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;
8
+ export default PSearchTable;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { PTableProps, PTableCommands, PTableItem } from '../PTable';
3
+ import { PFormValueMap, PSearchCommands, PSearchProps } from '@pdg/react-form';
4
+ import { ReactNode } from 'react';
5
+ import { PTableCommonSxProps } from '../@types';
6
+ export interface PSearchInfo {
7
+ ref?: PSearchTableSearchProps['ref'];
8
+ searchGroups?: PSearchTableSearchProps['searchGroups'];
9
+ props?: Omit<PSearchTableSearchProps, 'ref' | 'searchGroups'>;
10
+ }
11
+ export interface PTableInfo {
12
+ ref?: PSearchTableTableProps['ref'];
13
+ props?: Omit<PSearchTableTableProps, 'ref'>;
14
+ }
15
+ export interface PSearchTableData<T = PTableItem> {
16
+ items: PTableProps<T>['items'];
17
+ paging?: PTableProps<T>['paging'];
18
+ }
19
+ export interface PSearchTableSearchProps extends Omit<PSearchProps, 'ref' | 'color' | 'autoSubmit' | 'onSubmit'> {
20
+ ref?: React.ForwardedRef<PSearchCommands>;
21
+ searchGroups?: ReactNode;
22
+ }
23
+ export interface PSearchTableTableProps<T = PTableItem> extends Omit<PTableProps<T>, 'ref' | 'items' | 'paging' | 'onPageChange'> {
24
+ ref?: React.ForwardedRef<PTableCommands<T>>;
25
+ }
26
+ export interface PSearchTableProps<T = PTableItem> extends PTableCommonSxProps {
27
+ color?: PSearchProps['color'];
28
+ hash?: boolean;
29
+ stickyHeader?: boolean;
30
+ fullHeight?: boolean;
31
+ search?: PSearchTableSearchProps;
32
+ table: PSearchTableTableProps<T>;
33
+ betweenSearchTableComponent?: ReactNode;
34
+ onGetData?(data: PFormValueMap): Promise<PSearchTableData<T>>;
35
+ onRequestHashChange?(hash: string): void;
36
+ }
37
+ export interface PSearchTableCommands<T = PTableItem> {
38
+ reload(page?: number): void;
39
+ getLastLoadData(): PFormValueMap;
40
+ getSearch(): PSearchCommands | undefined;
41
+ getTable(): PTableCommands<T> | undefined;
42
+ }
@@ -0,0 +1,4 @@
1
+ import PSearchTable from './PSearchTable';
2
+ export default PSearchTable;
3
+ export { PSearchTable };
4
+ export * from './PSearchTable.types';
@@ -0,0 +1,7 @@
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;
7
+ export default PTable;
@@ -1,26 +1,26 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { TableCellProps, TooltipProps } from '@mui/material';
3
- import { TablePaginationProps } from '../TablePagination/TablePagination.types';
4
- import { TableCommonSxProps } from '../@types';
5
- import { TableTopHeadProps } from '../TableTopHead';
3
+ import { PTablePaginationProps } from '../PTablePagination/PTablePagination.types';
4
+ import { PTableCommonSxProps } from '../@types';
5
+ import { PTableTopHeadProps } from '../PTableTopHead';
6
6
  /********************************************************************************************************************
7
- * TableItem
7
+ * PTableItem
8
8
  * ******************************************************************************************************************/
9
- export interface TableItem {
9
+ export interface PTableItem {
10
10
  [key: string]: any;
11
11
  }
12
12
  /********************************************************************************************************************
13
- * TableProgressiveVisibleInfo
13
+ * PTableProgressiveVisibleInfo
14
14
  * ******************************************************************************************************************/
15
- export interface TableProgressiveVisibleInfo {
15
+ export interface PTableProgressiveVisibleInfo {
16
16
  rowHeight: number;
17
17
  blockSize?: number;
18
18
  delay?: number;
19
19
  }
20
20
  /********************************************************************************************************************
21
- * TableColumn
21
+ * PTableColumn
22
22
  * ******************************************************************************************************************/
23
- export interface TableColumn<T = TableItem> {
23
+ export interface PTableColumn<T = 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;
@@ -45,33 +45,33 @@ export interface TableColumn<T = TableItem> {
45
45
  paddingLeft?: number;
46
46
  paddingRight?: number;
47
47
  head?: {
48
- className?: TableCommonSxProps['className'];
49
- style?: TableCommonSxProps['style'];
48
+ className?: PTableCommonSxProps['className'];
49
+ style?: PTableCommonSxProps['style'];
50
50
  backgroundColor?: CSSProperties['backgroundColor'];
51
- sx?: TableCommonSxProps['sx'];
52
- onGetClassName?(items?: T[]): TableCommonSxProps['className'];
53
- onGetStyle?(items?: T[]): TableCommonSxProps['style'];
54
- onGetSx?(items?: T[]): TableCommonSxProps['sx'];
51
+ sx?: PTableCommonSxProps['sx'];
52
+ onGetClassName?(items?: T[]): PTableCommonSxProps['className'];
53
+ onGetStyle?(items?: T[]): PTableCommonSxProps['style'];
54
+ onGetSx?(items?: T[]): PTableCommonSxProps['sx'];
55
55
  onRender?(items?: T[]): ReactNode;
56
56
  };
57
57
  footer?: {
58
58
  value?: ReactNode;
59
- className?: TableCommonSxProps['className'];
60
- style?: TableCommonSxProps['style'];
59
+ className?: PTableCommonSxProps['className'];
60
+ style?: PTableCommonSxProps['style'];
61
61
  backgroundColor?: CSSProperties['backgroundColor'];
62
- sx?: TableCommonSxProps['sx'];
63
- onGetClassName?(items?: T[]): TableCommonSxProps['className'];
64
- onGetStyle?(items?: T[]): TableCommonSxProps['style'];
65
- onGetSx?(items?: T[]): TableCommonSxProps['sx'];
62
+ sx?: PTableCommonSxProps['sx'];
63
+ onGetClassName?(items?: T[]): PTableCommonSxProps['className'];
64
+ onGetStyle?(items?: T[]): PTableCommonSxProps['style'];
65
+ onGetSx?(items?: T[]): PTableCommonSxProps['sx'];
66
66
  onRender?(items?: T[]): ReactNode;
67
67
  };
68
- className?: TableCommonSxProps['className'];
69
- style?: TableCommonSxProps['style'];
68
+ className?: PTableCommonSxProps['className'];
69
+ style?: PTableCommonSxProps['style'];
70
70
  backgroundColor?: CSSProperties['backgroundColor'];
71
- sx?: TableCommonSxProps['sx'];
72
- onGetClassName?(item: T, index: number): TableCommonSxProps['className'];
73
- onGetStyle?(item: T, index: number): TableCommonSxProps['style'];
74
- onGetSx?(item: T, index: number): TableCommonSxProps['sx'];
71
+ sx?: PTableCommonSxProps['sx'];
72
+ onGetClassName?(item: T, index: number): PTableCommonSxProps['className'];
73
+ onGetStyle?(item: T, index: number): PTableCommonSxProps['style'];
74
+ onGetSx?(item: T, index: number): PTableCommonSxProps['sx'];
75
75
  onHide?(item: T, index: number): boolean;
76
76
  onGetTooltip?(item: T, index: number): ReactNode;
77
77
  onRender?(item: T, index: number): ReactNode;
@@ -81,20 +81,20 @@ export interface TableColumn<T = TableItem> {
81
81
  onCheckChange?(item: T, checked: boolean): void;
82
82
  onCheckDisabledChange?(item: T, checkDisabled: boolean): void;
83
83
  }
84
- export type TableColumns<T = TableItem> = (TableColumn<T> | false | undefined | null)[];
84
+ export type PTableColumns<T = PTableItem> = (PTableColumn<T> | false | undefined | null)[];
85
85
  /********************************************************************************************************************
86
86
  * TableProps
87
87
  * ******************************************************************************************************************/
88
- export interface TableProps<T = TableItem> extends TableCommonSxProps {
88
+ export interface PTableProps<T = PTableItem> extends PTableCommonSxProps {
89
89
  caption?: ReactNode;
90
- topHeadRows?: TableTopHeadProps['rows'];
91
- columns?: TableColumns<T>;
90
+ topHeadRows?: PTableTopHeadProps['rows'];
91
+ columns?: PTableColumns<T>;
92
92
  defaultAlign?: TableCellProps['align'];
93
93
  defaultEllipsis?: boolean;
94
94
  stickyHeader?: boolean;
95
95
  items?: T[];
96
- paging?: TablePaginationProps['paging'];
97
- pagingAlign?: TablePaginationProps['align'];
96
+ paging?: PTablePaginationProps['paging'];
97
+ pagingAlign?: PTablePaginationProps['align'];
98
98
  height?: string | number;
99
99
  maxHeight?: string | number;
100
100
  minHeight?: string | number;
@@ -105,33 +105,33 @@ export interface TableProps<T = TableItem> extends TableCommonSxProps {
105
105
  footer?: boolean;
106
106
  noData?: ReactNode;
107
107
  pagination?: {
108
- className?: TableCommonSxProps['className'];
109
- style?: TableCommonSxProps['style'];
110
- sx?: TableCommonSxProps['sx'];
108
+ className?: PTableCommonSxProps['className'];
109
+ style?: PTableCommonSxProps['style'];
110
+ sx?: PTableCommonSxProps['sx'];
111
111
  };
112
- progressiveVisible?: TableProgressiveVisibleInfo;
112
+ progressiveVisible?: PTableProgressiveVisibleInfo;
113
113
  sortable?: boolean;
114
114
  onClick?(item: T, index: number): void;
115
- onGetBodyRowClassName?(item: T, index: number): TableCommonSxProps['className'] | undefined;
116
- onGetBodyRowStyle?(item: T, index: number): TableCommonSxProps['style'] | undefined;
117
- onGetBodyRowSx?(item: T, index: number): TableCommonSxProps['sx'] | undefined;
118
- onGetBodyColumnClassName?(column: TableColumn<T>, item: T, index: number): TableCommonSxProps['className'] | undefined;
119
- onGetBodyColumnStyle?(column: TableColumn<T>, item: T, index: number): TableCommonSxProps['style'] | undefined;
120
- onGetBodyColumnSx?(column: TableColumn<T>, item: T, index: number): TableCommonSxProps['sx'] | undefined;
115
+ onGetBodyRowClassName?(item: T, index: number): PTableCommonSxProps['className'] | undefined;
116
+ onGetBodyRowStyle?(item: T, index: number): PTableCommonSxProps['style'] | undefined;
117
+ onGetBodyRowSx?(item: T, index: number): PTableCommonSxProps['sx'] | undefined;
118
+ onGetBodyColumnClassName?(column: PTableColumn<T>, item: T, index: number): PTableCommonSxProps['className'] | undefined;
119
+ onGetBodyColumnStyle?(column: PTableColumn<T>, item: T, index: number): PTableCommonSxProps['style'] | undefined;
120
+ onGetBodyColumnSx?(column: PTableColumn<T>, item: T, index: number): PTableCommonSxProps['sx'] | undefined;
121
121
  onPageChange?(page: number): void;
122
122
  onSortChange?(items: T[]): void;
123
123
  onCheckChange?(columnId: string, items: T[]): void;
124
124
  }
125
125
  /********************************************************************************************************************
126
- * TableCommands
126
+ * PTableCommands
127
127
  * ******************************************************************************************************************/
128
- export interface TableCommands<T = TableItem> {
129
- getColumns(): TableProps<T>['columns'];
130
- setColumns(columns: TableProps<T>['columns']): void;
131
- getItems(): TableProps<T>['items'];
132
- setItems(items: TableProps<T>['items']): void;
133
- getPaging(): TableProps<T>['paging'];
134
- setItemsPaging(items: TableProps<T>['items'], paging: TableProps<T>['paging']): void;
128
+ export interface PTableCommands<T = PTableItem> {
129
+ getColumns(): PTableProps<T>['columns'];
130
+ setColumns(columns: PTableProps<T>['columns']): void;
131
+ getItems(): PTableProps<T>['items'];
132
+ setItems(items: PTableProps<T>['items']): void;
133
+ getPaging(): PTableProps<T>['paging'];
134
+ setItemsPaging(items: PTableProps<T>['items'], paging: PTableProps<T>['paging']): void;
135
135
  resetSort(): void;
136
136
  getCheckedItems(columnId: string): T[];
137
137
  getChecked(itemKey: string, itemValue: any, columnId: string): boolean;
@@ -0,0 +1,4 @@
1
+ import PTable from './PTable';
2
+ export default PTable;
3
+ export { PTable };
4
+ export * from './PTable.types';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { PTableBodyRowProps as Props } from './PTableBodyRow.types';
3
+ 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
+ export default PTableBodyRow;
@@ -0,0 +1,18 @@
1
+ import { TableCellProps, TableRowProps } from '@mui/material';
2
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable';
3
+ import { PTableBodyCellProps } from '../TableBodyCell';
4
+ import { PTableCommonSxProps } from '../@types';
5
+ export interface PTableBodyRowProps extends Omit<TableRowProps, 'id' | 'onClick'> {
6
+ id: string | number;
7
+ index: number;
8
+ defaultAlign?: TableCellProps['align'];
9
+ defaultEllipsis?: boolean;
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;
18
+ }
@@ -0,0 +1,4 @@
1
+ import PTableBodyRow from './PTableBodyRow';
2
+ export default PTableBodyRow;
3
+ export { PTableBodyRow };
4
+ export * from './PTableBodyRow.types';
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { TableButtonProps as Props } from './TableButton.types';
2
+ import { PTableButtonProps as Props } from './PTableButton.types';
3
3
  declare const _default: React.NamedExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
4
4
  export default _default;
@@ -0,0 +1,3 @@
1
+ import { PButtonProps } from '@pdg/react-component';
2
+ export interface PTableButtonProps extends Omit<PButtonProps, 'size'> {
3
+ }
@@ -0,0 +1,4 @@
1
+ import PTableButton from './PTableButton';
2
+ export default PTableButton;
3
+ export { PTableButton };
4
+ export * from './PTableButton.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { PTableCommonCellProps } from './PTableCommonCell.types';
3
+ declare const PTableCommonCell: React.ForwardRefExoticComponent<PTableCommonCellProps & React.RefAttributes<HTMLTableCellElement>>;
4
+ export default PTableCommonCell;
@@ -0,0 +1,11 @@
1
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
2
+ import { PTableCommonSxProps } from '../@types';
3
+ export interface PTableCommonCellProps extends PTableCommonSxProps {
4
+ type: 'head' | 'body' | 'footer';
5
+ column: PTableColumn;
6
+ defaultAlign?: PTableProps['defaultAlign'];
7
+ defaultEllipsis?: boolean;
8
+ index?: number;
9
+ item?: PTableItem;
10
+ onClick?: PTableProps['onClick'];
11
+ }
@@ -0,0 +1,4 @@
1
+ import PTableCommonCell from './PTableCommonCell';
2
+ export default PTableCommonCell;
3
+ export { PTableCommonCell };
4
+ export * from './PTableCommonCell.types';
@@ -0,0 +1,3 @@
1
+ import { PTableContextValue } from './PTableContext.types';
2
+ declare const PTableContext: import("react").Context<PTableContextValue>;
3
+ export default PTableContext;
@@ -0,0 +1,15 @@
1
+ import { PTableColumn, PTableItem, PTableProgressiveVisibleInfo } from '../PTable';
2
+ import { PTableBodyCellCommands } from '../TableBodyCell';
3
+ import { PTableHeadCellCommands } from '../PTableHeadCell';
4
+ export interface PTableContextValue {
5
+ menuOpen: boolean;
6
+ openMenuId?: string;
7
+ progressiveVisible?: PTableProgressiveVisibleInfo;
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;
14
+ }
15
+ export declare const PTableContextDefaultValue: PTableContextValue;
@@ -0,0 +1,5 @@
1
+ import PTableContext from './PTableContext';
2
+ export default PTableContext;
3
+ export { PTableContext };
4
+ export * from './PTableContext.types';
5
+ export { default as useFormState } from './useTableState';
@@ -0,0 +1,2 @@
1
+ import { PTableContextValue } from './PTableContext.types';
2
+ export default function useTableState(): PTableContextValue;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { PTableContextProviderProps as Props } from './PTableContextProvider.types';
3
+ declare const PTableContextProvider: React.FC<Props>;
4
+ export default PTableContextProvider;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { PTableContextValue } from '../PTableContext';
3
+ export interface PTableContextProviderProps {
4
+ value: PTableContextValue;
5
+ children: ReactNode;
6
+ }
@@ -0,0 +1,4 @@
1
+ import PTableContextProvider from './PTableContextProvider';
2
+ export default PTableContextProvider;
3
+ export { PTableContextProvider };
4
+ export * from './PTableContextProvider.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { PTableFooterCellProps } from './PTableFooterCell.types';
3
+ declare const PTableFooterCell: React.FC<PTableFooterCellProps>;
4
+ export default PTableFooterCell;
@@ -0,0 +1,6 @@
1
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
2
+ export interface PTableFooterCellProps<T = PTableItem> {
3
+ column: PTableColumn;
4
+ items?: T[];
5
+ defaultAlign?: PTableProps['defaultAlign'];
6
+ }
@@ -0,0 +1,4 @@
1
+ import PTableFooterCell from './PTableFooterCell';
2
+ export default PTableFooterCell;
3
+ export { PTableFooterCell };
4
+ export * from './PTableFooterCell.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { PTableHeadCellProps } from './PTableHeadCell.types';
3
+ declare const PTableHeadCell: React.FC<PTableHeadCellProps>;
4
+ export default PTableHeadCell;
@@ -0,0 +1,12 @@
1
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
2
+ export interface PTableHeadCellCommands {
3
+ setChecked(checked: boolean): void;
4
+ setCheckDisabled(checkDisabled: boolean): void;
5
+ }
6
+ export interface PTableHeadCellProps<T = PTableItem> {
7
+ column: PTableColumn;
8
+ items?: T[];
9
+ defaultAlign?: PTableProps['defaultAlign'];
10
+ top?: number;
11
+ onCheckChange(column: PTableColumn, checked: boolean): void;
12
+ }
@@ -0,0 +1,4 @@
1
+ import PTableHeadCell from './PTableHeadCell';
2
+ export default PTableHeadCell;
3
+ export { PTableHeadCell };
4
+ export * from './PTableHeadCell.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { PTableMenuButtonProps as Props } from './PTableMenuButton.types';
3
+ declare const PTableMenuButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
4
+ export default PTableMenuButton;
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
- import { PdgButtonProps } from '@pdg/react-component';
2
+ import { PButtonProps } from '@pdg/react-component';
3
3
  import { PopperPlacementType, MenuListProps } from '@mui/material';
4
- export interface TableMenuButtonProps extends Omit<PdgButtonProps, 'size' | 'onClick'> {
4
+ export interface PTableMenuButtonProps extends Omit<PButtonProps, 'size' | 'onClick'> {
5
5
  placement?: PopperPlacementType;
6
6
  inModal?: boolean;
7
7
  zIndex?: number;
@@ -0,0 +1,4 @@
1
+ import PTableMenuButton from './PTableMenuButton';
2
+ export default PTableMenuButton;
3
+ export { PTableMenuButton };
4
+ export * from './PTableMenuButton.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { PTablePaginationProps } from './PTablePagination.types';
3
+ declare const PTablePagination: React.FC<PTablePaginationProps>;
4
+ export default PTablePagination;
@@ -0,0 +1,13 @@
1
+ import { StackProps } from '@mui/material';
2
+ import { PTableCommonSxProps } from '../@types';
3
+ export interface PTablePaging {
4
+ current_page: number;
5
+ per_page: number;
6
+ last_page: number;
7
+ total: number;
8
+ }
9
+ export interface PTablePaginationProps extends Pick<PTableCommonSxProps, 'className' | 'style' | 'sx'> {
10
+ paging: PTablePaging;
11
+ align?: StackProps['alignItems'];
12
+ onChange?(page: number): void;
13
+ }
@@ -0,0 +1,4 @@
1
+ import PTablePagination from './PTablePagination';
2
+ export default PTablePagination;
3
+ export { PTablePagination };
4
+ export * from './PTablePagination.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
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;
4
+ export default PTableSortableBody;
@@ -0,0 +1,8 @@
1
+ import { PTableColumn, PTableItem, PTableProps } from '../PTable/PTable.types';
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 & {
5
+ id: number | string;
6
+ })[];
7
+ columns: PTableColumn[];
8
+ }
@@ -0,0 +1,4 @@
1
+ import PTableSortableBody from './PTableSortableBody';
2
+ export default PTableSortableBody;
3
+ export { PTableSortableBody };
4
+ export * from './PTableSortableBody.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
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;
4
+ export default PTableSortableBodyBlock;