@pdg/react-table 1.0.89 → 1.0.91

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.
@@ -1,8 +1,6 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { SxProps } from '@mui/system';
3
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
4
  export interface CommonProps {
7
5
  children?: ReactNode;
8
6
  className?: string;
@@ -39,6 +39,12 @@ export interface InfoTableItem<T = InfoTableInfo> {
39
39
  clipboardProps?: Omit<IconButtonProps, 'children'>;
40
40
  onRender?(info: T): ReactNode;
41
41
  onRenderEmpty?(info: T): ReactNode;
42
+ onHide?(info: T): boolean;
43
+ onXs?(info: T): number;
44
+ onSm?(info: T): number;
45
+ onMd?(info: T): number;
46
+ onLg?(info: T): number;
47
+ onXl?(info: T): number;
42
48
  }
43
49
  export type InfoTableItems<T = InfoTableInfo> = (InfoTableItem<T> | false | undefined | null)[];
44
50
  export type InfoTableCols = 1 | 2 | 3 | 4 | 6 | 12;
@@ -3,9 +3,15 @@ import { TableCellProps, TooltipProps } from '@mui/material';
3
3
  import { TablePaginationProps } from '../TablePagination/TablePagination.types';
4
4
  import { CommonSxProps } from '../@types';
5
5
  import { TableTopHeadProps } from '../TableTopHead';
6
+ /********************************************************************************************************************
7
+ * TableItem
8
+ * ******************************************************************************************************************/
6
9
  export interface TableItem {
7
10
  [key: string]: any;
8
11
  }
12
+ /********************************************************************************************************************
13
+ * TableColumn
14
+ * ******************************************************************************************************************/
9
15
  export interface TableColumn<T = TableItem> {
10
16
  id?: string;
11
17
  type?: 'text' | 'number' | 'tel' | 'date' | 'datetime' | 'date-hour' | 'date-minute' | 'company_no' | 'personal_no' | 'img' | 'button' | 'buttons' | 'check';
@@ -68,6 +74,9 @@ export interface TableColumn<T = TableItem> {
68
74
  onCheckDisabledChange?(item: T, checkDisabled: boolean): void;
69
75
  }
70
76
  export type TableColumns<T = TableItem> = (TableColumn<T> | false | undefined | null)[];
77
+ /********************************************************************************************************************
78
+ * TableProps
79
+ * ******************************************************************************************************************/
71
80
  export interface TableProps<T = TableItem> extends CommonSxProps {
72
81
  caption?: ReactNode;
73
82
  topHeadRows?: TableTopHeadProps['rows'];
@@ -105,6 +114,9 @@ export interface TableProps<T = TableItem> extends CommonSxProps {
105
114
  onCheckChange?(columnId: string, items: T[]): void;
106
115
  }
107
116
  export declare const TableDefaultProps: Pick<TableProps, 'defaultAlign' | 'pagingAlign' | 'cellPadding'>;
117
+ /********************************************************************************************************************
118
+ * TableCommands
119
+ * ******************************************************************************************************************/
108
120
  export interface TableCommands<T = TableItem> {
109
121
  getColumns(): TableProps<T>['columns'];
110
122
  setColumns(columns: TableProps<T>['columns']): void;