@fattureincloud/fic-design-system 0.19.11 → 0.19.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { DropdownProps } from '../../../dropdown/types';
2
- declare type BaseDropdownProps = Pick<DropdownProps, 'placement' | 'className' | 'triggerStyles' | 'content' | 'maxWidth' | 'minWidthAsTrigger'>;
2
+ declare type BaseDropdownProps = Pick<DropdownProps, 'placement' | 'className' | 'triggerStyles' | 'content' | 'maxWidth' | 'minWidthAsTrigger' | 'isDisabled'>;
3
3
  declare type UnitDropdownRenderContentProps = BaseDropdownProps & {
4
4
  createUnit?: never;
5
5
  currentUnit: string;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { UnitDropdownProps } from '../types';
3
- declare const UnitDropdown: ({ createUnit, currentUnit, items, renderContent, setCurrentUnit, unitTriggerMaxWidth, ...dropdownProps }: UnitDropdownProps) => JSX.Element;
3
+ declare const UnitDropdown: ({ createUnit, currentUnit, isDisabled, items, renderContent, setCurrentUnit, unitTriggerMaxWidth, ...dropdownProps }: UnitDropdownProps) => JSX.Element;
4
4
  export default UnitDropdown;
@@ -2,4 +2,6 @@ import Dropdown from '../../../../dropdown/dropdown';
2
2
  export declare const CustomDropdownWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
3
  unitTriggerMaxWidth: string;
4
4
  }, never>;
5
- export declare const CustomDropdown: import("styled-components").StyledComponent<typeof Dropdown, import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const CustomDropdown: import("styled-components").StyledComponent<typeof Dropdown, import("styled-components").DefaultTheme, {
6
+ isDisabled?: boolean | undefined;
7
+ }, never>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { Meta } from '@storybook/react';
2
+ import { Meta, Story } from '@storybook/react';
3
3
  import { IconProps } from './Icon';
4
- export declare const Normal: () => JSX.Element;
4
+ export declare const Normal: Story<IconProps>;
5
5
  export declare const WithBackground: () => JSX.Element;
6
6
  export declare const DuotoneColored: () => JSX.Element;
7
7
  export declare const _CustomIcon: () => JSX.Element;
@@ -29,6 +29,7 @@ import { TableProps } from './types';
29
29
  * @param {function} onRowClick Callback called after a click on a row, returns the row
30
30
  * @param {number} actionColumnWidth used to determine the width of the action column
31
31
  * @param {function} isRowHighlighted used to underline table rows
32
+ * @param {boolean} disableActions disable actions
32
33
  */
33
- declare const Table: <T>({ actionColumnWidth, allSelectedCTA, bodyHeight, bulkActions, columns, data, disableScrollX, enableSettings, forceHideSettings, headerSize, isLoading, isRowDisabled, isRowHighlighted, isSelectable, isTogglesSortable, listSize, noPagination, notRemovableColumns, onChangeTableSettings, onPaginationChange, onRowClick, onRowSelection, onSort, onTogglesChange, pageSize: pageLength, paginationNextText, paginationPreviousText, preSettedTableSettings, renderBulkActions, renderEmptyState, resetPageIndex, rowActions, rowHighlightColor, rowHighlightHideBorderBottom, rowSelection, rowSize, settingsDropdownConfig, sortDescFirst, sortable, toggles, totalPages, uniqueId, }: TableProps<T>) => JSX.Element;
34
+ declare const Table: <T>({ actionColumnWidth, allSelectedCTA, bodyHeight, bulkActions, columns, data, disableActions, disableScrollX, enableSettings, forceHideSettings, headerSize, isLoading, isRowDisabled, isRowHighlighted, isSelectable, isTogglesSortable, listSize, noPagination, notRemovableColumns, onChangeTableSettings, onPaginationChange, onRowClick, onRowSelection, onSort, onTogglesChange, pageSize: pageLength, paginationNextText, paginationPreviousText, preSettedTableSettings, renderBulkActions, renderEmptyState, resetPageIndex, rowActions, rowHighlightColor, rowHighlightHideBorderBottom, rowSelection, rowSize, settingsDropdownConfig, sortDescFirst, sortable, toggles, totalPages, uniqueId, }: TableProps<T>) => JSX.Element;
34
35
  export default Table;
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { Row } from '@tanstack/react-table';
3
3
  import { TableProps } from '../../types';
4
- interface BodyProps<T> extends Pick<TableProps<T>, 'rowSize' | 'bodyHeight' | 'rowHighlightColor' | 'isRowHighlighted' | 'rowHighlightHideBorderBottom' | 'isRowDisabled'> {
5
- rows: Row<T>[];
4
+ interface BodyProps<T> extends Pick<TableProps<T>, 'rowSize' | 'bodyHeight' | 'rowHighlightColor' | 'isRowHighlighted' | 'rowHighlightHideBorderBottom' | 'isRowDisabled' | 'disableActions'> {
5
+ actionColumnWidth: number;
6
+ disableScrollX?: boolean;
6
7
  isLoading?: boolean;
7
8
  onRowClick?: (row: Row<T>) => void;
8
9
  pageIndex: number;
9
- actionColumnWidth: number;
10
- disableScrollX?: boolean;
10
+ rows: Row<T>[];
11
11
  }
12
- declare const Body: <T>({ rows, rowSize, isLoading, onRowClick, bodyHeight, rowHighlightColor, pageIndex, actionColumnWidth, disableScrollX, isRowHighlighted, isRowDisabled, rowHighlightHideBorderBottom, }: BodyProps<T>) => JSX.Element;
12
+ declare const Body: <T>({ actionColumnWidth, bodyHeight, disableActions, disableScrollX, isLoading, isRowDisabled, isRowHighlighted, onRowClick, pageIndex, rowHighlightColor, rowHighlightHideBorderBottom, rowSize, rows, }: BodyProps<T>) => JSX.Element;
13
13
  export default Body;
@@ -4,12 +4,13 @@ import { RowSize } from '../../types';
4
4
  interface Props<T> {
5
5
  actionColumnWidth: number;
6
6
  cell: TCell<T, unknown>;
7
+ disableAction: boolean;
8
+ disableRow: boolean;
7
9
  hover?: boolean;
8
10
  isLoading?: boolean;
9
- disableRow: boolean;
10
11
  onRowClick?: (row: Row<T>) => void;
11
12
  row: Row<T>;
12
13
  rowSize?: RowSize;
13
14
  }
14
- declare const Cell: <T>({ actionColumnWidth, cell, disableRow, hover, isLoading, onRowClick, row, rowSize, }: Props<T>) => JSX.Element;
15
+ declare const Cell: <T>({ actionColumnWidth, cell, disableAction, disableRow, hover, isLoading, onRowClick, row, rowSize, }: Props<T>) => JSX.Element;
15
16
  export default Cell;
@@ -4,11 +4,12 @@ import { AccessorColumnDef, ActionColumnDef, AdditionalColumnDef, CustomCellProp
4
4
  declare type Props<CellProps> = {
5
5
  actionColumnWidth: number;
6
6
  context: CellContext<CellProps, unknown>;
7
+ disableAction: boolean;
7
8
  disableRow: boolean;
8
9
  hover?: boolean;
9
10
  onRowClick?: (row: Row<CellProps>) => void;
10
11
  row: Row<CellProps>;
11
12
  rowSize?: RowSize;
12
13
  } & CustomCellProps & AccessorColumnDef<CellProps> & ActionColumnDef<CellProps> & AdditionalColumnDef<CellProps>;
13
- declare const CustomCell: <CellProps>({ actionColumnWidth, actionType, align, avatar, content, context, disableClick, disableRow, headline, hover, isEditable, isToggled, leadingIcon, maxWidth, minWidth, onActionChange, onChange, onRowClick, row, rowActions, rowSize, tag, trailingMicroTag, unitSymbol, }: Props<CellProps>) => JSX.Element;
14
+ declare const CustomCell: <CellProps>({ actionColumnWidth, actionType, align, avatar, content, context, disableAction, disableClick, disableRow, headline, hover, isEditable, isToggled, leadingIcon, maxWidth, minWidth, onActionChange, onChange, onRowClick, row, rowActions, rowSize, tag, trailingMicroTag, unitSymbol, }: Props<CellProps>) => JSX.Element;
14
15
  export default CustomCell;
@@ -2,15 +2,16 @@ import { Row } from '@tanstack/react-table';
2
2
  import React from 'react';
3
3
  import { RowSize, TableProps } from '../../types';
4
4
  interface TrProps<T> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> {
5
- row: Row<T>;
5
+ actionColumnWidth: number;
6
6
  defaultRowSize?: RowSize;
7
+ disableActions?: (row: Row<T>) => boolean;
7
8
  isLoading?: boolean;
9
+ isRowDisabled?: (row: Row<T>) => boolean;
10
+ isRowHighlighted?: (row: Row<T>) => boolean;
8
11
  onRowClick?: (row: Row<T>) => void;
12
+ row: Row<T>;
9
13
  rowHighlightColor?: TableProps<T>['rowHighlightColor'];
10
- actionColumnWidth: number;
11
- isRowHighlighted?: (row: Row<T>) => boolean;
12
14
  rowHighlightHideBorderBottom?: boolean;
13
- isRowDisabled?: (row: Row<T>) => boolean;
14
15
  }
15
- declare const Tr: <T>({ row, isLoading, onRowClick, rowHighlightColor, defaultRowSize, actionColumnWidth, isRowHighlighted, isRowDisabled, rowHighlightHideBorderBottom, }: TrProps<T>) => JSX.Element;
16
+ declare const Tr: <T>({ actionColumnWidth, defaultRowSize, disableActions, isLoading, isRowDisabled, isRowHighlighted, onRowClick, row, rowHighlightColor, rowHighlightHideBorderBottom, }: TrProps<T>) => JSX.Element;
16
17
  export default Tr;
@@ -9,52 +9,53 @@ import { MicroTagProps } from '../microTag';
9
9
  import { TagProps } from '../tag';
10
10
  import { TooltipProps } from '../tooltip';
11
11
  export interface TableProps<T> {
12
- uniqueId: keyof T;
13
- data: T[];
12
+ actionColumnWidth?: number;
13
+ allSelectedCTA?: AllSelectedCTA;
14
+ bodyHeight?: number;
15
+ bulkActions?: BulkAction[];
14
16
  columns: ColumnsType<T>[];
15
- isSelectable?: boolean;
16
- toggles?: string[];
17
- onTogglesChange?: (toggles: string[]) => void;
18
- rowSize?: RowSize;
17
+ data: T[];
18
+ disableActions?: (row: Row<T>) => boolean;
19
+ disableScrollX?: boolean;
20
+ enableSettings?: boolean;
21
+ forceHideSettings?: boolean;
19
22
  headerSize?: RowSize;
20
- sortable?: boolean;
21
- sortDescFirst?: boolean;
22
- onSort?: OnSort<T>;
23
- isTogglesSortable?: boolean;
24
- rowActions?: RowActions<T> | ((row?: Row<T>) => RowActions<T>);
25
- bulkActions?: BulkAction[];
26
- renderBulkActions?: (rows: string[]) => JSX.Element;
27
23
  isLoading?: boolean;
28
- allSelectedCTA?: AllSelectedCTA;
29
- noPagination?: boolean;
30
- pageSize?: number;
24
+ isRowDisabled?: (row: Row<T>) => boolean;
25
+ isRowHighlighted?: (row: Row<T>) => boolean;
26
+ isSelectable?: boolean;
27
+ isTogglesSortable?: boolean;
31
28
  listSize?: number;
32
- enableSettings?: boolean;
33
- settingsDropdownConfig?: SettingsDropdownConfig;
34
- paginationPreviousText?: string;
35
- paginationNextText?: string;
29
+ noPagination?: boolean;
30
+ notRemovableColumns?: string[];
31
+ onChangeTableSettings?: onChangeTableSettings;
36
32
  onPaginationChange?: (pagination: PaginationState) => void;
37
- renderEmptyState?: () => JSX.Element;
38
33
  onRowClick?: (row: Row<T>) => void;
39
- bodyHeight?: number;
40
- totalPages?: number;
41
- isRowHighlighted?: (row: Row<T>) => boolean;
42
- rowHighlightColor?: string;
43
- rowHighlightHideBorderBottom?: boolean;
44
- rowSelection?: string[];
45
34
  onRowSelection?: (e: string[]) => void;
46
- forceHideSettings?: boolean;
35
+ onSort?: OnSort<T>;
36
+ onTogglesChange?: (toggles: string[]) => void;
37
+ pageSize?: number;
38
+ paginationNextText?: string;
39
+ paginationPreviousText?: string;
47
40
  preSettedTableSettings?: {
48
41
  orderColumns?: string[];
49
42
  dimensionRow?: number;
50
43
  notVisibleColumns?: string[];
51
44
  };
52
- notRemovableColumns?: string[];
53
- onChangeTableSettings?: onChangeTableSettings;
54
- actionColumnWidth?: number;
55
- disableScrollX?: boolean;
45
+ renderBulkActions?: (rows: string[]) => JSX.Element;
46
+ renderEmptyState?: () => JSX.Element;
56
47
  resetPageIndex?: boolean;
57
- isRowDisabled?: (row: Row<T>) => boolean;
48
+ rowActions?: RowActions<T> | ((row?: Row<T>) => RowActions<T>);
49
+ rowHighlightColor?: string;
50
+ rowHighlightHideBorderBottom?: boolean;
51
+ rowSelection?: string[];
52
+ rowSize?: RowSize;
53
+ settingsDropdownConfig?: SettingsDropdownConfig;
54
+ sortDescFirst?: boolean;
55
+ sortable?: boolean;
56
+ toggles?: string[];
57
+ totalPages?: number;
58
+ uniqueId: keyof T;
58
59
  }
59
60
  export declare type onChangeTableSettings = (key: keyof PreSettedTableSettings, valueChange: Pick<PreSettedTableSettings, 'orderColumns' | 'dimensionRow' | 'notVisibleColumns'>) => void;
60
61
  export interface PreSettedTableSettings {
@@ -1,13 +1,12 @@
1
1
  import { ColumnDef, SortDirection } from '@tanstack/react-table';
2
- import { CellProps, RowSize } from './types';
3
- import { TableProps } from './types';
2
+ import { CellProps, RowSize, TableProps } from './types';
4
3
  interface ColumnsHelperProps<T> extends Omit<TableProps<T>, 'data' | 'uniqueId'> {
5
4
  preSettedTableSettings?: {
6
- orderColumns?: string[];
7
5
  dimensionRow?: RowSize;
8
6
  notVisibleColumns?: string[];
7
+ orderColumns?: string[];
9
8
  };
10
9
  }
11
- export declare const useColumnsHelper: <T>({ columns, isSelectable, toggles, isTogglesSortable, onTogglesChange, rowActions, enableSettings, settingsDropdownConfig, preSettedTableSettings, actionColumnWidth, }: ColumnsHelperProps<T>) => ColumnDef<T, CellProps>[];
10
+ export declare const useColumnsHelper: <T>({ actionColumnWidth, columns, enableSettings, isSelectable, isTogglesSortable, onTogglesChange, preSettedTableSettings, rowActions, settingsDropdownConfig, toggles, }: ColumnsHelperProps<T>) => ColumnDef<T, CellProps>[];
12
11
  export declare const getNextSortingDirection: (direction?: false | SortDirection | undefined) => false | SortDirection;
13
12
  export {};
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Row as RowType } from '@tanstack/react-table';
3
3
  import { TableProps } from '../../types';
4
- interface BodyProps<T> extends Pick<TableProps<T>, 'isLoading' | 'isRowDisabled' | 'isRowHighlighted' | 'onRowClick' | 'rowActions' | 'rowHighlightColor' | 'rowSelection' | 'rowTooltip' | 'renderEmptyState'> {
4
+ interface BodyProps<T> extends Pick<TableProps<T>, 'isLoading' | 'isRowDisabled' | 'isRowHighlighted' | 'onRowClick' | 'rowActions' | 'rowHighlightColor' | 'rowSelection' | 'rowTooltip' | 'renderEmptyState' | 'isRowActionDisabled'> {
5
5
  pageIndex: number;
6
6
  rows: RowType<T>[];
7
7
  columnsCount: number;
8
8
  isTableEmpty?: boolean;
9
9
  }
10
- declare const Body: <T>({ columnsCount, isLoading, isRowDisabled, isRowHighlighted, isTableEmpty, onRowClick, pageIndex, renderEmptyState, rowActions, rowHighlightColor, rowSelection, rowTooltip, rows, }: BodyProps<T>) => JSX.Element;
10
+ declare const Body: <T>({ columnsCount, isLoading, isRowActionDisabled, isRowDisabled, isRowHighlighted, isTableEmpty, onRowClick, pageIndex, renderEmptyState, rowActions, rowHighlightColor, rowSelection, rowTooltip, rows, }: BodyProps<T>) => JSX.Element;
11
11
  export default Body;
@@ -3,6 +3,7 @@ import { Row } from '@tanstack/react-table';
3
3
  import { TableProps } from '../../../types';
4
4
  declare type Props<T> = {
5
5
  disableRow: boolean;
6
+ disableRowActions: boolean;
6
7
  mouseHover: boolean;
7
8
  isRowHighlighted?: boolean;
8
9
  row: Row<T>;
@@ -10,5 +11,5 @@ declare type Props<T> = {
10
11
  rowHighlightColor?: string;
11
12
  selected: boolean;
12
13
  };
13
- declare const ActionsCell: <T>({ disableRow, isRowHighlighted, mouseHover, row, rowActions, rowHighlightColor, selected, }: Props<T>) => JSX.Element;
14
+ declare const ActionsCell: <T>({ disableRow, disableRowActions, isRowHighlighted, mouseHover, row, rowActions, rowHighlightColor, selected, }: Props<T>) => JSX.Element;
14
15
  export default ActionsCell;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { Row as RowType } from '@tanstack/react-table';
3
3
  import { TableProps } from '../../types';
4
- declare type TrProps<T> = Pick<TableProps<T>, 'isLoading' | 'isRowDisabled' | 'isRowHighlighted' | 'onRowClick' | 'rowActions' | 'rowHighlightColor' | 'rowSelection' | 'rowTooltip'> & {
4
+ declare type TrProps<T> = Pick<TableProps<T>, 'isLoading' | 'isRowDisabled' | 'isRowActionDisabled' | 'isRowHighlighted' | 'onRowClick' | 'rowActions' | 'rowHighlightColor' | 'rowSelection' | 'rowTooltip'> & {
5
5
  row: RowType<T>;
6
6
  };
7
- declare const Row: <T>({ isLoading, isRowDisabled, isRowHighlighted, onRowClick, row, rowActions, rowHighlightColor, rowSelection, rowTooltip, }: TrProps<T>) => JSX.Element;
7
+ declare const Row: <T>({ isLoading, isRowActionDisabled, isRowDisabled, isRowHighlighted, onRowClick, row, rowActions, rowHighlightColor, rowSelection, rowTooltip, }: TrProps<T>) => JSX.Element;
8
8
  export default Row;
@@ -16,6 +16,7 @@ export declare type TableProps<T> = SelectableTable<T> & PaginatedTable & Sortab
16
16
  headerSize?: RowSize;
17
17
  isLoading?: boolean;
18
18
  isRowDisabled?: (row: Row<T>) => boolean;
19
+ isRowActionDisabled?: (row: Row<T>) => boolean;
19
20
  loadingStyle?: LoadingStyle;
20
21
  maxHeight?: number;
21
22
  onRowClick?: (row: Row<T>) => void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { TooltipProps } from './types';
3
3
  export declare const defaultTooltipProps: TooltipProps;
4
- declare const Tooltip: ({ callbackAfterTimeout, children, className, hideAfterSeconds, icon, message, onMouseEnter, onMouseLeave, onMouseLeaveHideDelay, onOpen, placement, positionStrategy, renderButton, shouldRender, showAfterSeconds, showAlways, style, type, usePortal, }: TooltipProps) => JSX.Element;
4
+ declare const Tooltip: ({ callbackAfterTimeout, children, className, hideAfterSeconds, icon, message, onMouseEnter, onMouseLeave, onMouseLeaveHideDelay, onOpen, placement, portalContainer, positionStrategy, renderButton, shouldRender, showAfterSeconds, showAlways, style, type, usePortal, }: TooltipProps) => JSX.Element;
5
5
  export default Tooltip;
@@ -14,11 +14,12 @@ export interface TooltipProps {
14
14
  onMouseLeaveHideDelay?: number;
15
15
  onOpen?: (isOpen: boolean) => void;
16
16
  placement?: BasePlacement;
17
+ portalContainer?: HTMLElement;
17
18
  positionStrategy?: 'fixed' | 'absolute';
18
19
  renderButton?: () => JSX.Element;
20
+ shouldRender?: boolean;
19
21
  showAfterSeconds?: number;
20
22
  showAlways?: boolean;
21
- shouldRender?: boolean;
22
23
  style?: React.CSSProperties;
23
24
  type?: tooltipTypes;
24
25
  usePortal?: boolean;