@pdg/react-table 1.0.22 → 1.0.23

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,4 +1,8 @@
1
1
  import React from 'react';
2
2
  import { SearchTableProps, SearchTableCommands } from './SearchTable.types';
3
- declare const SearchTable: React.ForwardRefExoticComponent<SearchTableProps & React.RefAttributes<SearchTableCommands>>;
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;
4
8
  export default SearchTable;
@@ -3,32 +3,32 @@ import { TableProps, TableCommands, TableItem } from '../Table';
3
3
  import { FormValueMap, SearchCommands, SearchProps } from '@pdg/react-form';
4
4
  import { ReactNode } from 'react';
5
5
  import { CommonSxProps } from '../@types';
6
- export interface SearchTableData {
7
- items: TableProps['items'];
8
- paging?: TableProps['paging'];
6
+ export interface SearchTableData<T = TableItem> {
7
+ items: TableProps<T>['items'];
8
+ paging?: TableProps<T>['paging'];
9
9
  }
10
10
  export interface SearchTableSearchProps extends Omit<SearchProps, 'ref' | 'color' | 'autoSubmit' | 'onSubmit'> {
11
11
  ref?: React.ForwardedRef<SearchCommands>;
12
12
  searchGroups?: ReactNode;
13
13
  }
14
14
  export interface SearchTableTableProps<T = TableItem> extends Omit<TableProps<T>, 'ref' | 'items' | 'paging' | 'onPageChange'> {
15
- ref?: React.ForwardedRef<TableCommands>;
15
+ ref?: React.ForwardedRef<TableCommands<T>>;
16
16
  }
17
- export interface SearchTableProps extends CommonSxProps {
17
+ export interface SearchTableProps<T = TableItem> extends CommonSxProps {
18
18
  color?: SearchProps['color'];
19
19
  hash?: boolean;
20
20
  stickyHeader?: boolean;
21
21
  fullHeight?: boolean;
22
22
  search?: SearchTableSearchProps;
23
- table: SearchTableTableProps;
23
+ table: SearchTableTableProps<T>;
24
24
  betweenSearchTableComponent?: ReactNode;
25
- onGetData?(data: FormValueMap): Promise<SearchTableData>;
25
+ onGetData?(data: FormValueMap): Promise<SearchTableData<T>>;
26
26
  onRequestHashChange?(hash: string): void;
27
27
  }
28
28
  export declare const SearchTableDefaultProps: {};
29
- export interface SearchTableCommands {
29
+ export interface SearchTableCommands<T = TableItem> {
30
30
  reload(page?: number): void;
31
31
  getLastLoadData(): FormValueMap;
32
32
  getSearch(): SearchCommands | undefined;
33
- getTable(): TableCommands | undefined;
33
+ getTable(): TableCommands<T> | undefined;
34
34
  }