@fattureincloud/fic-design-system 0.7.1 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,5 +10,5 @@ export interface OptionType extends OptionTypeBase {
10
10
  interface Props<O extends OptionType = OptionType, IsMulti extends boolean = false> extends Omit<OptionProps<O, IsMulti>, 'data'> {
11
11
  data: OptionType;
12
12
  }
13
- declare const Option: <O extends OptionType = OptionType, IsMulti extends boolean = false>({ innerProps: { onClick }, data: { label, icon }, }: Props<O, IsMulti>) => JSX.Element;
13
+ declare const Option: <O extends OptionType = OptionType, IsMulti extends boolean = false>({ innerProps: { onClick }, data: { label, icon }, isSelected, }: Props<O, IsMulti>) => JSX.Element;
14
14
  export default Option;
@@ -28,6 +28,7 @@ import { TableProps } from './types';
28
28
  * @param {string} paginationNextText Pagination next button text
29
29
  * @param {function} onPaginationChange Callback to handle server side pagination
30
30
  * @param {function} renderEmptyState Render a custom empty state for the table's body
31
+ * @param {function} onRowClick Callback called after a click on a row, returns the row
31
32
  */
32
- declare const Table: <T>({ data, columns, isSelectable, onRowSelectionChange, favorites, onFavoritesChange, toggles, onTogglesChange, rowSize, headerSize, isFavoritesSortable, isTogglesSortable, sortable, sortDescFirst, enableSettings, settingsDropdownConfig, rowActions, bulkActions, isLoading, allSelectedCTA, noPagination, pageSize: pageLength, listSize, paginationPreviousText, paginationNextText, onPaginationChange, uniqueId, onSort, renderEmptyState, }: TableProps<T>) => JSX.Element;
33
+ declare const Table: <T>({ data, columns, isSelectable, onRowSelectionChange, favorites, onFavoritesChange, toggles, onTogglesChange, rowSize, headerSize, isFavoritesSortable, isTogglesSortable, sortable, sortDescFirst, enableSettings, settingsDropdownConfig, rowActions, bulkActions, isLoading, allSelectedCTA, noPagination, pageSize: pageLength, listSize, paginationPreviousText, paginationNextText, onPaginationChange, uniqueId, onSort, renderEmptyState, onRowClick, }: TableProps<T>) => JSX.Element;
33
34
  export default Table;
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Row } from '@tanstack/react-table';
3
+ import { CellProps } from 'react-table';
3
4
  import { TableProps } from '../../types';
4
5
  interface BodyProps<T> extends Pick<TableProps<T>, 'rowSize'> {
5
6
  rows: Row<T>[];
6
7
  isLoading?: boolean;
8
+ onRowClick?: (row: Row<CellProps | T>) => void;
7
9
  }
8
- declare const Body: <T>({ rows, rowSize, isLoading }: BodyProps<T>) => JSX.Element;
10
+ declare const Body: <T>({ rows, rowSize, isLoading, onRowClick }: BodyProps<T>) => JSX.Element;
9
11
  export default Body;
@@ -7,6 +7,7 @@ interface Props<T> {
7
7
  hover?: boolean;
8
8
  rowSize?: RowSize;
9
9
  isLoading?: boolean;
10
+ onRowClick?: (row: Row<T>) => void;
10
11
  }
11
- declare const Cell: <T>({ cell, row, hover, rowSize, isLoading }: Props<T>) => JSX.Element;
12
+ declare const Cell: <T>({ cell, row, hover, rowSize, isLoading, onRowClick }: Props<T>) => JSX.Element;
12
13
  export default Cell;
@@ -6,6 +6,7 @@ declare type Props<CellProps> = {
6
6
  context: CellContext<CellProps, unknown>;
7
7
  hover?: boolean;
8
8
  rowSize?: RowSize;
9
+ onRowClick?: (row: Row<CellProps>) => void;
9
10
  } & CustomCellProps & AccessorColumnDef<CellProps> & ActionColumnDef<CellProps> & AdditionalColumnDef;
10
- declare const CustomCell: <CellProps>({ content, isEditable, tag, unitSymbol, headline, leadingIcon, avatar, actionType, row, rowSize, onActionChange, isFavorite, isToggled, hover, onChange, trailingMicroTag, minWidth, rowActions, context, }: Props<CellProps>) => JSX.Element;
11
+ declare const CustomCell: <CellProps>({ content, isEditable, tag, unitSymbol, headline, leadingIcon, avatar, actionType, row, rowSize, onActionChange, isFavorite, isToggled, hover, onChange, trailingMicroTag, minWidth, rowActions, context, onRowClick, }: Props<CellProps>) => JSX.Element;
11
12
  export default CustomCell;
@@ -1,4 +1,7 @@
1
- export declare const Td: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const Td: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {
2
+ cellHasOnClick: boolean;
3
+ minWidth?: number | undefined;
4
+ }, never>;
2
5
  export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
6
  export declare const LeadingIconContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
7
  export declare const AvatarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -5,6 +5,7 @@ interface TrProps<T> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTa
5
5
  row: Row<T>;
6
6
  rowSize?: RowSize;
7
7
  isLoading?: boolean;
8
+ onRowClick?: (row: Row<T>) => void;
8
9
  }
9
- declare const Tr: <T>({ row, isLoading }: TrProps<T>) => JSX.Element;
10
+ declare const Tr: <T>({ row, isLoading, onRowClick }: TrProps<T>) => JSX.Element;
10
11
  export default Tr;
@@ -2,7 +2,7 @@
2
2
  import { DisplayColumnDef, GroupColumnDef, IdentifiedColumnDef, PaginationState, Row, SortDirection } from '@tanstack/react-table';
3
3
  import { AvatarProps } from '../avatar';
4
4
  import { ButtonProps } from '../buttons';
5
- import { DropdownItemType } from '../dropdown/types';
5
+ import { DropdownItemType } from '../dropdown';
6
6
  import { IconProps } from '../icon';
7
7
  import { MicroTagProps } from '../microTag';
8
8
  import { TagProps } from '../tag';
@@ -37,6 +37,7 @@ export interface TableProps<T> {
37
37
  paginationNextText?: string;
38
38
  onPaginationChange?: (pagination: PaginationState) => void;
39
39
  renderEmptyState?: () => JSX.Element;
40
+ onRowClick?: (row: Row<CellProps>) => void;
40
41
  }
41
42
  interface SettingsDropdownConfig {
42
43
  settingsTooltip?: TooltipProps;
@@ -126,7 +127,7 @@ export declare type CustomCellProps = CustomCellWithIcon | CustomCellWithAvatar;
126
127
  export declare type CellProps = CustomCellProps | string | number;
127
128
  export interface RowActions<T> {
128
129
  headerTitle?: string | number;
129
- primary?: PrimaryAction<T>;
130
+ primary?: PrimaryAction<T>[];
130
131
  dropdown?: DropdownAction<T>;
131
132
  }
132
133
  export interface RowAction<T> {