@fattureincloud/fic-design-system 0.4.9-expenses.1.3 → 0.4.9-expenses.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,20 +4,48 @@ import { EmptyTablePageProps } from './components/EmptyState';
4
4
  import { ManualPagination, OnSort, RowActions, TableData } from './types';
5
5
  export interface TableProps<T extends TableData> extends UseTableOptions<T> {
6
6
  sortable?: boolean;
7
- hideHeader?: boolean;
8
- EmptyPage?: EmptyTablePageProps['EmptyPage'];
9
- Footer?: JSX.Element;
7
+ onSort?: OnSort<T>;
10
8
  noPagination?: boolean;
11
9
  manualPagination?: ManualPagination;
12
10
  onScroll?: () => void;
13
- withCheckbox?: boolean;
11
+ selectableRows?: boolean;
12
+ preSelectAllRows?: boolean;
14
13
  onSelectionChange?: (rows: Array<Row<T>>) => void;
15
- actions?: RowActions<T>;
16
- renderActions?: () => JSX.Element;
17
- onSort?: OnSort<T>;
14
+ onRowClick?: (row: Row<T>) => void;
18
15
  globalFilter?: string;
16
+ hideHeader?: boolean;
17
+ EmptyPage?: EmptyTablePageProps['EmptyPage'];
18
+ Footer?: JSX.Element;
19
+ withCheckbox?: boolean;
19
20
  isLoading?: boolean;
20
- selectableRows?: boolean;
21
+ actions?: RowActions<T>;
22
+ renderActions?: () => JSX.Element;
23
+ bodyHeight?: number | string;
24
+ headerHeight?: number | string;
25
+ rowHeight?: number | string;
21
26
  }
22
- declare const Table: <T extends TableData>({ columns, data, EmptyPage, Footer, onSelectionChange, actions, renderActions, sortable, hideHeader, noPagination, manualPagination, onScroll, withCheckbox, onSort, globalFilter: externalGlobalFilter, isLoading, selectableRows, }: TableProps<T>) => JSX.Element;
27
+ /**
28
+ * Component Props:
29
+ * @param {boolean} sortable Makes all columns sortable, sort can be disabled for a single column inside columns definition
30
+ * @param {function} onSort Callback called on column sort change
31
+ * @param {boolean} noPagination Hide table paginator and disabled pagination
32
+ * @param {object} manualPagination If you want to manage the pagination by yourself
33
+ * @param {function} onScroll If pagination is disabled, this callback is called when user scroll to the bottom of the table
34
+ * @param {boolean} selectableRows Allow to select rows
35
+ * @param {boolean} preSelectAllRows Pre-select all rows
36
+ * @param {function} onSelectionChange Callback called when rows selection changes
37
+ * @param {function} onRowClick Callback called on row click
38
+ * @param {string} globalFilter Filter all columns by value
39
+ * @param {boolean} hideHeader Hide the table header
40
+ * @param {object} EmptyPage Configuration to show a custom component when table has no rows
41
+ * @param {JSX.Element} Footer Custom footer component
42
+ * @param {boolean} withCheckbox Show a column with checkboxes on left side of the table
43
+ * @param {boolean} isLoading Apply loading style to all cells
44
+ * @param {object} actions Configuration to render actions column
45
+ * @param {function} renderActions Used to customize actions column
46
+ * @param {number|string} bodyHeight Set tbody height, default 300px (if number is provided is considered as measure in pixels)
47
+ * @param {number|string} headerHeight Set thead and th height, default 40px (if number is provided is considered as measure in pixels)
48
+ * @param {number|string} rowHeight Set row height, default 40px (if number is provided is considered as measure in pixels)
49
+ */
50
+ declare const Table: <T extends TableData>({ actions, bodyHeight, columns, data, EmptyPage, Footer, globalFilter: externalGlobalFilter, headerHeight, hideHeader, isLoading, manualPagination, noPagination, onRowClick, onScroll, onSelectionChange, onSort, preSelectAllRows, renderActions, rowHeight, selectableRows, sortable, withCheckbox, }: TableProps<T>) => JSX.Element;
23
51
  export default Table;
@@ -0,0 +1,12 @@
1
+ import { Row, UseTableInstanceProps } from 'react-table';
2
+ import { TableData } from '../../types';
3
+ interface Props<T extends TableData> {
4
+ rows: Row<T>[];
5
+ prepareRow: UseTableInstanceProps<T>['prepareRow'];
6
+ selectedRowsIds: string[];
7
+ isLoading: boolean;
8
+ onRowClick?: (row: Row<T>) => void;
9
+ rowHeight?: number | string;
10
+ }
11
+ declare const TableBody: <T extends TableData>({ isLoading, rows, prepareRow, selectedRowsIds, onRowClick, rowHeight, }: Props<T>) => JSX.Element;
12
+ export default TableBody;
@@ -0,0 +1,7 @@
1
+ import { TableBodyTrStyles } from '../../utils';
2
+ export interface TableBodyTrProps {
3
+ isSelected?: boolean;
4
+ isDisabled?: boolean;
5
+ }
6
+ declare const TableBodyTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, import("../tableParts/styled").TrProps & TableBodyTrStyles & TableBodyTrProps, keyof TableBodyTrStyles>;
7
+ export default TableBodyTr;
@@ -3,6 +3,8 @@ import { TableData } from '../../types';
3
3
  interface Props<T extends TableData> {
4
4
  scrollBar: number;
5
5
  headerGroups: HeaderGroup<T>[];
6
+ headerHeight?: number | string;
7
+ selectedRowsIds?: string[];
6
8
  }
7
- declare const TableHeaders: <T extends TableData>({ headerGroups, scrollBar }: Props<T>) => JSX.Element;
8
- export default TableHeaders;
9
+ declare const TableHeader: <T extends TableData>({ headerHeight, headerGroups, scrollBar }: Props<T>) => JSX.Element;
10
+ export default TableHeader;
@@ -3,9 +3,14 @@ interface THeadProps {
3
3
  scrollBar: number;
4
4
  }
5
5
  export declare const THead: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, THeadProps, never>;
6
- export declare const TBody: import("styled-components").StyledComponent<"tbody", import("styled-components").DefaultTheme, {}, never>;
6
+ interface TableBodyProps {
7
+ bodyHeight?: number | string;
8
+ }
9
+ export declare const TBody: import("styled-components").StyledComponent<"tbody", import("styled-components").DefaultTheme, TableBodyProps, never>;
7
10
  export interface TrProps {
8
11
  isHeader?: boolean;
12
+ rowHeight?: number | string;
13
+ headerHeight?: number | string;
9
14
  }
10
15
  export declare const TableTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, TrProps, never>;
11
16
  export declare const TFoot: import("styled-components").StyledComponent<"tfoot", import("styled-components").DefaultTheme, {}, never>;
@@ -1,6 +1,6 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
2
  import { paletteColor } from '../../styles/types';
3
- import { TableBodyTrProps } from './components/TableBody';
3
+ import { TableBodyTrProps } from './components/tableBody/TableBodyTr';
4
4
  interface GetTableBodyTrStylesParams extends TableBodyTrProps {
5
5
  theme: DefaultTheme;
6
6
  }
@@ -11,4 +11,5 @@ export interface TableBodyTrStyles {
11
11
  hoverBackground: paletteColor;
12
12
  }
13
13
  export declare const getTableBodyTrStyles: ({ theme, isDisabled, isSelected, }: GetTableBodyTrStylesParams) => TableBodyTrStyles;
14
+ export declare const isNumber: (n: number | string | undefined) => boolean;
14
15
  export {};