@fattureincloud/fic-design-system 0.14.4 → 0.15.0
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.
- package/dist/common/hooks/useOutsideClick.d.ts +1 -1
- package/dist/common/hooks/useSyncScroll.d.ts +10 -0
- package/dist/common/types/misc.d.ts +12 -0
- package/dist/common/utils/stringUtils.d.ts +6 -0
- package/dist/components/accordion/Accordion.d.ts +4 -0
- package/dist/components/accordion/accordion.stories.d.ts +2 -1
- package/dist/components/accordion/const.d.ts +4 -0
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/types.d.ts +53 -17
- package/dist/components/accordion/utils.d.ts +2 -1
- package/dist/components/buttons/button/styled.d.ts +2 -2
- package/dist/components/buttons/iconButton/IconButton.d.ts +6 -12
- package/dist/components/buttons/iconButton/styled.d.ts +3 -0
- package/dist/components/buttons/iconButton/types.d.ts +12 -4
- package/dist/components/buttons/iconButton/utils.d.ts +3 -4
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/carousel/components/carouselMainMedia/styled.d.ts +1 -1
- package/dist/components/carousel/components/carouselThumbnails/styled.d.ts +2 -2
- package/dist/components/carousel/components/fullscreenMedia/styled.d.ts +1 -1
- package/dist/components/chart/styled.d.ts +1 -1
- package/dist/components/chip/styled.d.ts +2 -2
- package/dist/components/closableCard/styled.d.ts +1 -1
- package/dist/components/drawer/components/styledDrawerWrapper.d.ts +1 -1
- package/dist/components/drawer/drawer.stories.d.ts +0 -1
- package/dist/components/dropdown/DropdownImpl.d.ts +1 -1
- package/dist/components/dropdown/DropdownPopper.d.ts +20 -0
- package/dist/components/dropdown/types.d.ts +1 -0
- package/dist/components/dropdown/utils.d.ts +3 -1
- package/dist/components/editableInput/components/styled.d.ts +1 -1
- package/dist/components/form/checkbox/utils.d.ts +1 -1
- package/dist/components/form/inputText/InputText.d.ts +2 -1
- package/dist/components/form/inputText/components/InputElement.d.ts +2 -1
- package/dist/components/form/inputText/types.d.ts +2 -2
- package/dist/components/form/radioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/form/select/components/Control.d.ts +2 -2
- package/dist/components/form/select/components/GroupHeading.d.ts +5 -0
- package/dist/components/form/select/components.d.ts +1 -1
- package/dist/components/form/select/hooks/useSelectGeneric.d.ts +1 -1
- package/dist/components/form/textArea/types.d.ts +0 -1
- package/dist/components/gridCard/index.d.ts +1 -1
- package/dist/components/gridCard/styled.d.ts +1 -1
- package/dist/components/icon/Icon.d.ts +1 -1
- package/dist/components/inlineMessage/styled.d.ts +1 -1
- package/dist/components/layout/sidebarItem/styled.d.ts +1 -1
- package/dist/components/modals/modalStyled.d.ts +1 -1
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/ColumnItem.d.ts +1 -1
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/styled.d.ts +1 -1
- package/dist/components/newTable/components/action/settings/ColumnsSettings/styled.d.ts +0 -2
- package/dist/components/newTable/components/action/settings/RowHeightSettings/styled.d.ts +1 -1
- package/dist/components/newTable/components/action/settings/styled.d.ts +1 -1
- package/dist/components/newTable/components/cell/customActionCell/styled.d.ts +1 -1
- package/dist/components/newTable/components/cell/customCell/styled.d.ts +1 -1
- package/dist/components/newTable/styled.d.ts +1 -1
- package/dist/components/newTable_v2/Table.d.ts +112 -0
- package/dist/components/newTable_v2/components/body/Body.d.ts +9 -0
- package/dist/components/newTable_v2/components/body/styled.d.ts +1 -0
- package/dist/components/newTable_v2/components/bulkBar/BulkBar.d.ts +10 -0
- package/dist/components/newTable_v2/components/bulkBar/styled.d.ts +4 -0
- package/dist/components/newTable_v2/components/cell/Cell.d.ts +12 -0
- package/dist/components/newTable_v2/components/cell/actionsCell/ActionsCell.d.ts +14 -0
- package/dist/components/newTable_v2/components/cell/actionsCell/DropdownAction.d.ts +9 -0
- package/dist/components/newTable_v2/components/cell/actionsCell/PrimaryActionButton.d.ts +9 -0
- package/dist/components/newTable_v2/components/cell/actionsCell/styled.d.ts +11 -0
- package/dist/components/newTable_v2/components/cell/checkboxCell/CheckboxCell.d.ts +13 -0
- package/dist/components/newTable_v2/components/cell/checkboxCell/styled.d.ts +10 -0
- package/dist/components/newTable_v2/components/cell/editableCell/CustomInput.d.ts +11 -0
- package/dist/components/newTable_v2/components/cell/editableCell/styled.d.ts +2 -0
- package/dist/components/newTable_v2/components/cell/editableCell/textAreaPopup/TableTextArea.d.ts +4 -0
- package/dist/components/newTable_v2/components/cell/editableCell/textAreaPopup/TextAreaPopup.d.ts +4 -0
- package/dist/components/newTable_v2/components/cell/editableCell/textAreaPopup/styled.d.ts +3 -0
- package/dist/components/newTable_v2/components/cell/editableCell/textAreaPopup/types.d.ts +16 -0
- package/dist/components/newTable_v2/components/cell/hooks/useCellValues.d.ts +11 -0
- package/dist/components/newTable_v2/components/cell/loadingCell/LoadingCell.d.ts +3 -0
- package/dist/components/newTable_v2/components/cell/styled.d.ts +9 -0
- package/dist/components/newTable_v2/components/footer/Footer.d.ts +7 -0
- package/dist/components/newTable_v2/components/footer/footerCell/FooterCell.d.ts +7 -0
- package/dist/components/newTable_v2/components/footer/footerCell/styled.d.ts +10 -0
- package/dist/components/newTable_v2/components/footer/hooks/useFooterValues.d.ts +8 -0
- package/dist/components/newTable_v2/components/footer/styled.d.ts +7 -0
- package/dist/components/newTable_v2/components/header/Header.d.ts +13 -0
- package/dist/components/newTable_v2/components/header/actionsHeader/ActionsHeader.d.ts +6 -0
- package/dist/components/newTable_v2/components/header/actionsHeader/styled.d.ts +6 -0
- package/dist/components/newTable_v2/components/header/checkboxHeader/CheckboxHeader.d.ts +9 -0
- package/dist/components/newTable_v2/components/header/checkboxHeader/styled.d.ts +1 -0
- package/dist/components/newTable_v2/components/header/headerCell/HeaderCell.d.ts +11 -0
- package/dist/components/newTable_v2/components/header/headerCell/styled.d.ts +9 -0
- package/dist/components/newTable_v2/components/header/hooks/useActionHeaderValues.d.ts +15 -0
- package/dist/components/newTable_v2/components/header/hooks/useHeaderValues.d.ts +13 -0
- package/dist/components/newTable_v2/components/header/styled.d.ts +11 -0
- package/dist/components/newTable_v2/components/row/Row.d.ts +8 -0
- package/dist/components/newTable_v2/components/row/styled.d.ts +14 -0
- package/dist/components/newTable_v2/components/settings/Settings.d.ts +8 -0
- package/dist/components/newTable_v2/components/settings/settingsDropdownContent/DraggableColumn.d.ts +11 -0
- package/dist/components/newTable_v2/components/settings/settingsDropdownContent/SettingsDropdownContent.d.ts +7 -0
- package/dist/components/newTable_v2/components/settings/settingsDropdownContent/styled.d.ts +9 -0
- package/dist/components/newTable_v2/components/settings/styled.d.ts +3 -0
- package/dist/components/newTable_v2/components/toggle/Toggle.d.ts +14 -0
- package/dist/components/newTable_v2/components/toggle/constants.d.ts +3 -0
- package/dist/components/newTable_v2/components/toggle/index.d.ts +1 -0
- package/dist/components/newTable_v2/components/toggle/styled.d.ts +5 -0
- package/dist/components/newTable_v2/constants.d.ts +9 -0
- package/dist/components/newTable_v2/customCells/BooleanCell.d.ts +6 -0
- package/dist/components/newTable_v2/customCells/DateCell.d.ts +9 -0
- package/dist/components/newTable_v2/customCells/MicroTagCell.d.ts +10 -0
- package/dist/components/newTable_v2/customCells/TagCell.d.ts +10 -0
- package/dist/components/newTable_v2/customCells/TwoRowsCell.d.ts +9 -0
- package/dist/components/newTable_v2/customCells/ValueWithUnitCell.d.ts +9 -0
- package/dist/components/newTable_v2/customCells/index.d.ts +4 -0
- package/dist/components/newTable_v2/hooks/useClassNames.d.ts +6 -0
- package/dist/components/newTable_v2/hooks/useColumnHelper.d.ts +7 -0
- package/dist/components/newTable_v2/hooks/useColumnPinning.d.ts +8 -0
- package/dist/components/newTable_v2/hooks/usePagination.d.ts +8 -0
- package/dist/components/newTable_v2/index.d.ts +3 -0
- package/dist/components/newTable_v2/providers/TableProvider/TableProvider.d.ts +5 -0
- package/dist/components/newTable_v2/providers/TableProvider/index.d.ts +3 -0
- package/dist/components/newTable_v2/providers/TableProvider/types.d.ts +27 -0
- package/dist/components/newTable_v2/stories/actions.d.ts +5 -0
- package/dist/components/newTable_v2/stories/columns.d.ts +3 -0
- package/dist/components/newTable_v2/stories/data.d.ts +2 -0
- package/dist/components/newTable_v2/stories/styled.d.ts +1 -0
- package/dist/components/newTable_v2/stories/types.d.ts +10 -0
- package/dist/components/newTable_v2/styled.d.ts +6 -0
- package/dist/components/newTable_v2/table.stories.d.ts +6 -0
- package/dist/components/newTable_v2/types/cellsTypes.d.ts +1 -0
- package/dist/components/newTable_v2/types/columnsTypes.d.ts +48 -0
- package/dist/components/newTable_v2/types/enums.d.ts +16 -0
- package/dist/components/newTable_v2/types/features/actions.d.ts +40 -0
- package/dist/components/newTable_v2/types/features/highlight.d.ts +5 -0
- package/dist/components/newTable_v2/types/features/pagination.d.ts +20 -0
- package/dist/components/newTable_v2/types/features/selectRow.d.ts +16 -0
- package/dist/components/newTable_v2/types/features/settings.d.ts +27 -0
- package/dist/components/newTable_v2/types/features/sort.d.ts +15 -0
- package/dist/components/newTable_v2/types/index.d.ts +10 -0
- package/dist/components/newTable_v2/types/tableTypes.d.ts +33 -0
- package/dist/components/newTable_v2/utils.d.ts +18 -0
- package/dist/components/switch/Switch.d.ts +1 -1
- package/dist/components/tag/styled.d.ts +2 -2
- package/dist/components/toast/components/ToastContent.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +3 -21
- package/dist/components/tooltip/TooltipPopup.d.ts +8 -0
- package/dist/components/tooltip/components/Arrow.d.ts +5 -0
- package/dist/components/tooltip/index.d.ts +4 -3
- package/dist/components/tooltip/styled.d.ts +1 -1
- package/dist/components/tooltip/tooltipPalette.d.ts +1 -2
- package/dist/components/tooltip/types.d.ts +23 -0
- package/dist/components/tooltip/useTooltip.d.ts +17 -0
- package/dist/components/verticalTabs/styled.d.ts +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.esm.js +9 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/assets/index-7ee742e8.css +0 -154
- package/dist/assets/index-9fc4893a.css +0 -155
- package/dist/assets/index.esm-bff8cd71.css +0 -155
- package/dist/assets/index.esm-c9d742c9.css +0 -154
- package/dist/common/components/Label.d.ts +0 -3
- package/dist/common/types/label.d.ts +0 -12
- package/dist/common/utils/label.d.ts +0 -5
- package/dist/components/accordion/accordion.d.ts +0 -14
- package/dist/components/accordion/styled.d.ts +0 -5
- package/dist/components/accordions/accordions.d.ts +0 -9
- package/dist/components/accordions/accordions.stories.d.ts +0 -8
- package/dist/components/accordions/components/styledAccordionWrapper.d.ts +0 -1
- package/dist/components/accordions/index.d.ts +0 -1
- package/dist/components/accordions/types.d.ts +0 -19
- package/dist/components/carousel/components/common/styled.d.ts +0 -2
- package/dist/components/form/datepicker/components/MonthPicker.d.ts +0 -5
- package/dist/components/graphic/Graphic.d.ts +0 -4
- package/dist/components/graphic/components/ChartLegend.d.ts +0 -9
- package/dist/components/graphic/components/GraphButton.d.ts +0 -8
- package/dist/components/graphic/components/GraphIndicators.d.ts +0 -14
- package/dist/components/graphic/graphic.stories.d.ts +0 -7
- package/dist/components/graphic/index.d.ts +0 -2
- package/dist/components/graphic/stories/data.d.ts +0 -2
- package/dist/components/graphic/stories/styled.d.ts +0 -4
- package/dist/components/graphic/styled.d.ts +0 -3
- package/dist/components/graphic/types.d.ts +0 -52
- package/dist/components/graphic/utils.d.ts +0 -6
- package/dist/components/newTable/components/action/favorite/Favorite.d.ts +0 -14
- package/dist/components/newTable/components/action/favorite/index.d.ts +0 -1
- package/dist/components/newTable/components/action/favorite/styled.d.ts +0 -4
- package/dist/components/newTable/components/row/LoadingRow.d.ts +0 -9
- package/dist/components/verticalTab/VerticalTab.d.ts +0 -4
- package/dist/components/verticalTab/components/VerticalTabSelector/VerticalTabSelector.d.ts +0 -13
- package/dist/components/verticalTab/components/VerticalTabSelector/index.d.ts +0 -5
- package/dist/components/verticalTab/components/VerticalTabSelector/styled.d.ts +0 -11
- package/dist/components/verticalTab/components/VerticalTabSelector/types.d.ts +0 -37
- package/dist/components/verticalTab/components/VerticalTabSelector/verticalTabSelector.stories.d.ts +0 -5
- package/dist/components/verticalTab/components/VerticalTabSelector/verticalTabSelectorPalette.d.ts +0 -3
- package/dist/components/verticalTab/index.d.ts +0 -2
- package/dist/components/verticalTab/styled.d.ts +0 -6
- package/dist/components/verticalTab/types.d.ts +0 -6
- package/dist/components/verticalTab/verticalTab.stories.d.ts +0 -8
- package/dist/index.css +0 -154
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SettingsLabels, TableComponent } from './types';
|
|
2
|
+
export declare const HEIGHT_SMALL = 42;
|
|
3
|
+
export declare const HEIGHT_LARGE = 56;
|
|
4
|
+
export declare const TEXTAREA_HEIGHT = 100;
|
|
5
|
+
export declare const CHECKBOX_WIDTH = 35;
|
|
6
|
+
export declare const CLASS_PREFIX = "DS-table";
|
|
7
|
+
export declare const DS_PREFIX = "dstbl";
|
|
8
|
+
export declare const COMPONENTS: Record<TableComponent, string[]>;
|
|
9
|
+
export declare const defaultLabels: Required<SettingsLabels>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ParsableDateTime, ValidFormat } from '@fattureincloud/madbit-js-dates';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
date: ParsableDateTime;
|
|
5
|
+
format: ValidFormat;
|
|
6
|
+
locale: 'en' | 'es' | 'it';
|
|
7
|
+
};
|
|
8
|
+
declare const DateCell: (props: Props) => JSX.Element;
|
|
9
|
+
export default DateCell;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
import { MicroTagProps } from '../../microTag';
|
|
4
|
+
declare type ConversionFnProps<T> = {
|
|
5
|
+
row: Row<T>;
|
|
6
|
+
convertToProps: (row: Row<T>) => MicroTagProps;
|
|
7
|
+
};
|
|
8
|
+
declare type Props<T> = MicroTagProps | ConversionFnProps<T>;
|
|
9
|
+
declare const MicroTagCell: <T>(props: Props<T>) => JSX.Element;
|
|
10
|
+
export default MicroTagCell;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
import { TagProps } from '../../tag';
|
|
4
|
+
declare type ConversionFnProps<T> = {
|
|
5
|
+
row: Row<T>;
|
|
6
|
+
convertToProps: (row: Row<T>) => TagProps;
|
|
7
|
+
};
|
|
8
|
+
declare type Props<T> = TagProps | ConversionFnProps<T>;
|
|
9
|
+
declare const TagCell: <T>(props: Props<T>) => JSX.Element;
|
|
10
|
+
export default TagCell;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconProps } from '../../icon';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
icon?: IconProps;
|
|
5
|
+
mainText?: string;
|
|
6
|
+
subText?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const NameVatTableCell: ({ icon, mainText, subText }: Props) => JSX.Element;
|
|
9
|
+
export default NameVatTableCell;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UnitConfig } from '../../../common/utils/stringUtils';
|
|
3
|
+
import { CellValue } from '../types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
value: CellValue;
|
|
6
|
+
unit: UnitConfig;
|
|
7
|
+
};
|
|
8
|
+
declare const ValueWithUnitCell: ({ unit, value }: Props) => JSX.Element;
|
|
9
|
+
export default ValueWithUnitCell;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TableComponent } from '../types';
|
|
2
|
+
declare type ClassNames<K extends TableComponent> = {
|
|
3
|
+
[P in K as `${P}ClassName`]: string;
|
|
4
|
+
};
|
|
5
|
+
declare const useClassNames: <K extends TableComponent>(...components: K[]) => ClassNames<K>;
|
|
6
|
+
export default useClassNames;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
import { CellValue, ColumnsType } from '../types';
|
|
3
|
+
declare type ColumnsHelperProps<T> = {
|
|
4
|
+
columns: ColumnsType<T>[];
|
|
5
|
+
};
|
|
6
|
+
declare const useColumnsHelper: <T>({ columns }: ColumnsHelperProps<T>) => ColumnDef<T, CellValue>[];
|
|
7
|
+
export default useColumnsHelper;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColumnPinningState } from '@tanstack/react-table';
|
|
3
|
+
interface ReturnType {
|
|
4
|
+
readonly columnPinning: ColumnPinningState;
|
|
5
|
+
readonly setColumnPinning: React.Dispatch<React.SetStateAction<ColumnPinningState>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const useColumnPinning: (defaultValues?: ColumnPinningState | undefined) => ReturnType;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PaginationState } from '@tanstack/react-table';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
interface ReturnType {
|
|
4
|
+
pagination: PaginationState;
|
|
5
|
+
setPagination: Dispatch<SetStateAction<PaginationState>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const usePagination: (size: number | undefined) => ReturnType;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableContextProps, TableProviderProps } from './types';
|
|
3
|
+
export declare const TableContext: React.Context<TableContextProps>;
|
|
4
|
+
declare const TableProvider: <T>({ absoluteElementsPortal, actionColumnWidth, children, columns, columnsSettings: initialColumnsSettings, enableSettings, hideableColumns, isLoading, isSelectable, loadingStyle, onSettingsChange, rowActions, rowSize: initialRowSize, settingsLabels, settingsTooltip, sortableColumns, }: TableProviderProps<T>) => JSX.Element;
|
|
5
|
+
export default TableProvider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
|
+
import { TooltipProps } from '../../../tooltip';
|
|
3
|
+
import { ColumnsSettings, LoadingStyle, RowSize, SettingsLabels, TableProps, TableSettings } from '../../types';
|
|
4
|
+
export declare type ImmutableContext = {
|
|
5
|
+
absoluteElementsPortal?: HTMLElement;
|
|
6
|
+
loadingStyle?: LoadingStyle;
|
|
7
|
+
tableID: string;
|
|
8
|
+
enableSettings: boolean;
|
|
9
|
+
hideableColumns: string[];
|
|
10
|
+
settingsLabels: Required<SettingsLabels>;
|
|
11
|
+
settingsTooltip: TooltipProps;
|
|
12
|
+
sortableColumns: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare type TableContextProps = ImmutableContext & {
|
|
15
|
+
actionColumnWidth: number;
|
|
16
|
+
hasActions: boolean;
|
|
17
|
+
hasCheckbox: boolean;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
rowSize: RowSize;
|
|
20
|
+
setRowSize: Dispatch<SetStateAction<RowSize>>;
|
|
21
|
+
columnsSettings: Required<ColumnsSettings>;
|
|
22
|
+
setColumnsSettings: Dispatch<SetStateAction<Required<ColumnsSettings>>>;
|
|
23
|
+
onSettingsChange?: TableSettings['onSettingsChange'];
|
|
24
|
+
};
|
|
25
|
+
export declare type TableProviderProps<T> = TableProps<T> & {
|
|
26
|
+
children: ReactNode | ReactNode[];
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const HorizontalScroll: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const DSTable: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const SortIndicator: import("styled-components").StyledComponent<({ isDisabled, onClick, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const PaginationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
|
2
|
+
import { DataType } from './stories/types';
|
|
3
|
+
import { TableProps } from './types';
|
|
4
|
+
export declare const Template: Story<TableProps<DataType>>;
|
|
5
|
+
declare const TableStories: Meta<TableProps<DataType>>;
|
|
6
|
+
export default TableStories;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type CellValue = Record<string, unknown> | boolean | string | number | null | undefined;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DisplayColumnDef as RTDisplayColumnDef, GroupColumnDef as RTGroupColumnDef, IdentifiedColumnDef, Row } from '@tanstack/react-table';
|
|
3
|
+
import { InputTextProps } from '../../form/inputText';
|
|
4
|
+
import { TooltipProps } from '../../tooltip';
|
|
5
|
+
import { CellValue } from './cellsTypes';
|
|
6
|
+
import { ColumnDefType } from './enums';
|
|
7
|
+
export declare type BaseColumnsType<T> = {
|
|
8
|
+
columnDef: BaseColumnDef<T>;
|
|
9
|
+
columnDefType: ColumnDefType;
|
|
10
|
+
key: keyof T & string;
|
|
11
|
+
};
|
|
12
|
+
export declare type BaseColumnDef<T> = IdentifiedColumnDef<T> & {
|
|
13
|
+
align?: 'center' | 'left' | 'right';
|
|
14
|
+
customCell?: (row: Row<T>, hasHover: boolean) => JSX.Element;
|
|
15
|
+
disableClick?: boolean;
|
|
16
|
+
header?: IdentifiedColumnDef<T, CellValue>['header'] | JSX.Element;
|
|
17
|
+
headerTooltip?: TooltipProps;
|
|
18
|
+
id?: string;
|
|
19
|
+
maxWidth?: number;
|
|
20
|
+
minWidth?: number;
|
|
21
|
+
multiline?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare type EditableCellsColumn<T> = {
|
|
24
|
+
inputProps?: Omit<InputTextProps, 'value' | 'setValue'>;
|
|
25
|
+
onChange: (text: string, row: Row<T>) => void;
|
|
26
|
+
};
|
|
27
|
+
declare type StandardCellsColumn = {
|
|
28
|
+
inputProps?: never;
|
|
29
|
+
onChange?: never;
|
|
30
|
+
};
|
|
31
|
+
export declare type AccessorColumnDef<T> = IdentifiedColumnDef<T, CellValue> & BaseColumnDef<T> & (EditableCellsColumn<T> | StandardCellsColumn);
|
|
32
|
+
export declare type AccessorColumn<T> = BaseColumnsType<T> & {
|
|
33
|
+
columnDefType: ColumnDefType.ACCESSOR;
|
|
34
|
+
columnDef: AccessorColumnDef<T>;
|
|
35
|
+
};
|
|
36
|
+
export declare type DisplayColumnDef<T> = RTDisplayColumnDef<T, CellValue> & BaseColumnDef<T>;
|
|
37
|
+
export declare type DisplayColumn<T> = BaseColumnsType<T> & {
|
|
38
|
+
columnDefType: ColumnDefType.DISPLAY;
|
|
39
|
+
columnDef: DisplayColumnDef<T> & BaseColumnDef<T>;
|
|
40
|
+
};
|
|
41
|
+
export declare type GroupColumnDef<T> = RTGroupColumnDef<T, CellValue>;
|
|
42
|
+
export declare type GroupColumn<T> = BaseColumnsType<T> & {
|
|
43
|
+
columnDefType: ColumnDefType.GROUP;
|
|
44
|
+
columnDef: GroupColumnDef<T>;
|
|
45
|
+
};
|
|
46
|
+
export declare type ColumnDef<T> = AccessorColumnDef<T> | DisplayColumnDef<T> | GroupColumnDef<T>;
|
|
47
|
+
export declare type ColumnsType<T> = AccessorColumn<T> | DisplayColumn<T> | GroupColumn<T>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum RowSize {
|
|
2
|
+
SMALL,
|
|
3
|
+
LARGE
|
|
4
|
+
}
|
|
5
|
+
export declare enum ColumnDefType {
|
|
6
|
+
ACCESSOR = "accessor",
|
|
7
|
+
DISPLAY = "display",
|
|
8
|
+
GROUP = "group",
|
|
9
|
+
ACTION = "action"
|
|
10
|
+
}
|
|
11
|
+
export declare enum ActionType {
|
|
12
|
+
CHECKBOX = "checkbox",
|
|
13
|
+
TOGGLE = "toggle",
|
|
14
|
+
ROW_ACTIONS = "row_actions",
|
|
15
|
+
SETTINGS = "settings"
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
import { RequireAtLeastOne } from '../../../../common/types';
|
|
4
|
+
import { ButtonProps } from '../../../buttons';
|
|
5
|
+
import { buttonColors } from '../../../buttons/button/types';
|
|
6
|
+
import { DropdownItemProps } from '../../../dropdown';
|
|
7
|
+
import { IconProps } from '../../../icon';
|
|
8
|
+
import { TooltipProps } from '../../../tooltip';
|
|
9
|
+
export declare type TableActions<T> = {
|
|
10
|
+
actionsHeader?: string | JSX.Element;
|
|
11
|
+
rowActions?: RowActions<T> | ((row: Row<T>) => RowActions<T>);
|
|
12
|
+
bulkActions?: BulkAction[];
|
|
13
|
+
renderBulkActions?: (rows: string[]) => JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
export interface RowActions<T> {
|
|
16
|
+
primary?: PrimaryAction<T>[];
|
|
17
|
+
dropdown?: DropdownActions<T>;
|
|
18
|
+
}
|
|
19
|
+
declare type BaseAction = {
|
|
20
|
+
icon?: IconProps;
|
|
21
|
+
text?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type PrimaryAction<T> = RequireAtLeastOne<BaseAction> & {
|
|
24
|
+
className?: string;
|
|
25
|
+
color?: buttonColors;
|
|
26
|
+
onClick: (row: Row<T>) => void;
|
|
27
|
+
tooltip?: TooltipProps;
|
|
28
|
+
};
|
|
29
|
+
export declare type TableActionsDropdowItem<T> = DropdownItemProps & {
|
|
30
|
+
onClick: (row: Row<T>) => void;
|
|
31
|
+
};
|
|
32
|
+
export declare type DropdownActions<T> = {
|
|
33
|
+
items: TableActionsDropdowItem<T>[];
|
|
34
|
+
tooltip?: TooltipProps;
|
|
35
|
+
};
|
|
36
|
+
export interface BulkAction extends Omit<ButtonProps, 'onClick' | 'text'> {
|
|
37
|
+
onClick: (rows: string[]) => void;
|
|
38
|
+
text: string | JSX.Element;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PaginationState } from '@tanstack/react-table';
|
|
2
|
+
export declare type PaginatedTable = {
|
|
3
|
+
noPagination?: false;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
listSize: number;
|
|
6
|
+
paginationPreviousText?: string;
|
|
7
|
+
paginationNextText?: string;
|
|
8
|
+
onPaginationChange: (pagination: PaginationState) => void;
|
|
9
|
+
totalPages: number;
|
|
10
|
+
resetPageIndex?: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
noPagination: true;
|
|
13
|
+
pageSize?: never;
|
|
14
|
+
listSize?: never;
|
|
15
|
+
paginationPreviousText?: never;
|
|
16
|
+
paginationNextText?: never;
|
|
17
|
+
onPaginationChange?: never;
|
|
18
|
+
totalPages?: never;
|
|
19
|
+
resetPageIndex?: never;
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare type AllSelectedCTA = {
|
|
2
|
+
description?: string;
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type SelectableTable = {
|
|
7
|
+
isSelectable: true;
|
|
8
|
+
rowSelection: string[];
|
|
9
|
+
onRowSelection: (e: string[]) => void;
|
|
10
|
+
allSelectedCTA?: AllSelectedCTA;
|
|
11
|
+
} | {
|
|
12
|
+
isSelectable?: false;
|
|
13
|
+
rowSelection?: never;
|
|
14
|
+
onRowSelection?: never;
|
|
15
|
+
allSelectedCTA?: never;
|
|
16
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { VisibilityState } from '@tanstack/react-table';
|
|
2
|
+
import { TooltipProps } from '../../../tooltip';
|
|
3
|
+
import { RowSize } from '../enums';
|
|
4
|
+
export declare type ColumnsSettings = {
|
|
5
|
+
order?: string[];
|
|
6
|
+
visible?: VisibilityState;
|
|
7
|
+
};
|
|
8
|
+
export declare type VariableSettings = {
|
|
9
|
+
rowSize?: RowSize;
|
|
10
|
+
columnsSettings?: ColumnsSettings;
|
|
11
|
+
};
|
|
12
|
+
export declare type SettingsLabels = {
|
|
13
|
+
main?: string;
|
|
14
|
+
rowSizeLabel?: string;
|
|
15
|
+
rowSizeSmallLabel?: string;
|
|
16
|
+
rowSizeLargeLabel?: string;
|
|
17
|
+
columnsLabel?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare type SettingsEvent = 'resizeRow' | 'hideColumn' | 'showColumn' | 'moveColumn';
|
|
20
|
+
export declare type TableSettings = VariableSettings & {
|
|
21
|
+
enableSettings?: boolean;
|
|
22
|
+
settingsLabels?: SettingsLabels;
|
|
23
|
+
settingsTooltip?: TooltipProps;
|
|
24
|
+
onSettingsChange?: (event: SettingsEvent, settings: VariableSettings) => void;
|
|
25
|
+
hideableColumns?: string[];
|
|
26
|
+
sortableColumns?: string[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SortDirection } from '@tanstack/react-table';
|
|
2
|
+
export declare type OnSort<T> = (sortParams: {
|
|
3
|
+
sortBy: keyof T;
|
|
4
|
+
direction: false | SortDirection;
|
|
5
|
+
}) => void;
|
|
6
|
+
export declare type SortableTable<T> = {
|
|
7
|
+
sortable: true;
|
|
8
|
+
sortDescFirst?: boolean;
|
|
9
|
+
onSort?: OnSort<T>;
|
|
10
|
+
} | {
|
|
11
|
+
sortable?: false;
|
|
12
|
+
sortDescFirst?: never;
|
|
13
|
+
onSort?: never;
|
|
14
|
+
};
|
|
15
|
+
export declare type CustomSorted = Record<string, false | SortDirection>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './cellsTypes';
|
|
2
|
+
export * from './columnsTypes';
|
|
3
|
+
export * from './enums';
|
|
4
|
+
export * from './tableTypes';
|
|
5
|
+
export * from './features/actions';
|
|
6
|
+
export * from './features/highlight';
|
|
7
|
+
export * from './features/pagination';
|
|
8
|
+
export * from './features/selectRow';
|
|
9
|
+
export * from './features/settings';
|
|
10
|
+
export * from './features/sort';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
import { ColumnsType } from './columnsTypes';
|
|
4
|
+
import { RowSize } from './enums';
|
|
5
|
+
import { TableActions } from './features/actions';
|
|
6
|
+
import { HighlightRow } from './features/highlight';
|
|
7
|
+
import { PaginatedTable } from './features/pagination';
|
|
8
|
+
import { SelectableTable } from './features/selectRow';
|
|
9
|
+
import { TableSettings } from './features/settings';
|
|
10
|
+
import { SortableTable } from './features/sort';
|
|
11
|
+
export declare type TableProps<T> = SelectableTable & PaginatedTable & SortableTable<T> & TableSettings & HighlightRow<T> & TableActions<T> & {
|
|
12
|
+
absoluteElementsPortal?: HTMLElement;
|
|
13
|
+
actionColumnWidth?: number;
|
|
14
|
+
bodyHeight?: number;
|
|
15
|
+
columns: ColumnsType<T>[];
|
|
16
|
+
data: T[];
|
|
17
|
+
headerSize?: RowSize;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
isRowDisabled?: (row: Row<T>) => boolean;
|
|
20
|
+
loadingStyle?: LoadingStyle;
|
|
21
|
+
onRowClick?: (row: Row<T>) => void;
|
|
22
|
+
renderEmptyState?: () => JSX.Element;
|
|
23
|
+
rowTooltip?: (row: Row<T>) => string;
|
|
24
|
+
showFooter?: boolean;
|
|
25
|
+
uniqueId: keyof T;
|
|
26
|
+
};
|
|
27
|
+
export declare type LoadingStyle = {
|
|
28
|
+
backgroundColor?: string;
|
|
29
|
+
foregroundColor?: string;
|
|
30
|
+
height?: number | string;
|
|
31
|
+
width?: number | string;
|
|
32
|
+
};
|
|
33
|
+
export declare type TableComponent = 'tableContainer' | 'table' | 'paginator' | 'tableBody' | 'tableRow' | 'bulkBar' | 'bulkBarContent' | 'bulkBarActions' | 'tableFooter' | 'tableFooterRow' | 'tableFooterCell' | 'tableHeader' | 'tableHeaderRow' | 'tableHeaderCell';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SortDirection } from '@tanstack/react-table';
|
|
2
|
+
import { DefaultTheme } from 'styled-components';
|
|
3
|
+
import { ColumnsType } from './types';
|
|
4
|
+
export declare const getNextSortingDirection: (direction?: false | SortDirection | undefined) => false | SortDirection;
|
|
5
|
+
declare type MapBackgrounProps = {
|
|
6
|
+
isDisabled: boolean;
|
|
7
|
+
isRowHighlighted?: boolean;
|
|
8
|
+
rowHighlightColor?: string;
|
|
9
|
+
selected: boolean;
|
|
10
|
+
theme: DefaultTheme;
|
|
11
|
+
};
|
|
12
|
+
export declare type MappedProps = {
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
backgroundHover: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const mapBackground: ({ isDisabled, isRowHighlighted, rowHighlightColor, selected, theme, }: MapBackgrounProps) => MappedProps;
|
|
17
|
+
export declare const getColumnId: <T>(column: ColumnsType<T>) => string;
|
|
18
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SwitchProps } from '.';
|
|
3
|
-
declare const Switch: ({ checked, color,
|
|
3
|
+
declare const Switch: ({ checked, color, disabled, onChange }: SwitchProps) => JSX.Element;
|
|
4
4
|
export default Switch;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagParts } from './tagPalette';
|
|
3
3
|
import { StyledTagProps } from './types';
|
|
4
|
-
export declare const LeftIcon: import("styled-components").StyledComponent<({
|
|
5
|
-
export declare const RightIcon: import("styled-components").StyledComponent<({
|
|
4
|
+
export declare const LeftIcon: import("styled-components").StyledComponent<({ isDisabled, onClick, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const RightIcon: import("styled-components").StyledComponent<({ isDisabled, onClick, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
6
6
|
export declare const Text: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export declare const StyledTag: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TagParts & StyledTagProps, import("./tagPalette").tagParts>;
|
|
@@ -5,7 +5,7 @@ export declare const StyledHeader: import("styled-components").StyledComponent<"
|
|
|
5
5
|
export declare const ActionButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../buttons").ButtonProps & import("react").RefAttributes<HTMLDivElement | HTMLAnchorElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
6
|
export declare const StyledIconContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export declare const StyledTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
-
export declare const StyledIcon: import("styled-components").StyledComponent<({
|
|
8
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<({ isDisabled, onClick, ...props }: import("../../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
9
9
|
export declare const StyledTitleText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
10
10
|
type: ToastType;
|
|
11
11
|
}, never>;
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { IconProps } from '../icon';
|
|
4
|
-
import { MessageProps } from './components/Message';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TooltipProps } from './types';
|
|
5
3
|
export declare const defaultTooltipProps: TooltipProps;
|
|
6
|
-
|
|
7
|
-
callbackAfterTimeout?: () => void;
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
hideAfterSeconds?: number;
|
|
11
|
-
icon?: IconProps;
|
|
12
|
-
message: string | JSX.Element;
|
|
13
|
-
onMouseEnter?: MouseEventHandler;
|
|
14
|
-
onMouseLeave?: MouseEventHandler;
|
|
15
|
-
onOpen?: (isOpen: boolean) => void;
|
|
16
|
-
placement: BasePlacement;
|
|
17
|
-
renderButton?: () => JSX.Element;
|
|
18
|
-
showAfterSeconds?: number;
|
|
19
|
-
showAlways?: boolean;
|
|
20
|
-
shouldRender?: boolean;
|
|
21
|
-
}
|
|
22
|
-
declare const Tooltip: ({ message, placement, className, children, type, onMouseEnter, onMouseLeave, showAlways, showAfterSeconds, hideAfterSeconds, callbackAfterTimeout, onOpen, icon, renderButton, shouldRender, }: TooltipProps) => JSX.Element;
|
|
4
|
+
declare const Tooltip: ({ callbackAfterTimeout, children, className, hideAfterSeconds, icon, message, onMouseEnter, onMouseLeave, onOpen, placement, positionStrategy, renderButton, shouldRender, showAfterSeconds, showAlways, style, type, }: TooltipProps) => JSX.Element;
|
|
23
5
|
export default Tooltip;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TooltipProps } from './types';
|
|
3
|
+
import { UseTooltipValue } from './useTooltip';
|
|
4
|
+
declare type TooltipPopupProps<W extends HTMLElement, C extends HTMLElement> = Pick<TooltipProps, 'icon' | 'message' | 'renderButton' | 'type'> & Pick<UseTooltipValue<W, C>, 'showTooltip' | 'popperRef' | 'styles' | 'setArrowRef' | 'attributes'> & {
|
|
5
|
+
shouldRender: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const TooltipPopup: <W extends HTMLElement, C extends HTMLElement>({ attributes, icon, message, popperRef, renderButton, setArrowRef, shouldRender, showTooltip, styles, type, }: TooltipPopupProps<W, C>) => JSX.Element;
|
|
8
|
+
export default TooltipPopup;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { tooltipTypes } from '../tooltipPalette';
|
|
2
|
+
export declare const Arrow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
+
type: tooltipTypes;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const arrowStyle: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
export { default as Tooltip } from './Tooltip';
|
|
2
|
+
export { defaultTooltipProps } from './Tooltip';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './tooltipPalette';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const BodyAnimationWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const MessageIcon: import("styled-components").StyledComponent<({
|
|
3
|
+
export declare const MessageIcon: import("styled-components").StyledComponent<({ isDisabled, onClick, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const ButtonContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -3,5 +3,4 @@ export declare type tooltipTypes = 'dark' | 'light';
|
|
|
3
3
|
export declare type TooltipPalette = {
|
|
4
4
|
[key in tooltipTypes]: colorsPalette;
|
|
5
5
|
};
|
|
6
|
-
declare const tooltipPalette: TooltipPalette;
|
|
7
|
-
export default tooltipPalette;
|
|
6
|
+
export declare const tooltipPalette: TooltipPalette;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BasePlacement } from '@popperjs/core';
|
|
2
|
+
import React, { MouseEventHandler, ReactNode } from 'react';
|
|
3
|
+
import { IconProps } from '../icon';
|
|
4
|
+
import { tooltipTypes } from './tooltipPalette';
|
|
5
|
+
export interface TooltipProps {
|
|
6
|
+
callbackAfterTimeout?: () => void;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
hideAfterSeconds?: number;
|
|
10
|
+
icon?: IconProps;
|
|
11
|
+
message: string | JSX.Element;
|
|
12
|
+
onMouseEnter?: MouseEventHandler;
|
|
13
|
+
onMouseLeave?: MouseEventHandler;
|
|
14
|
+
onOpen?: (isOpen: boolean) => void;
|
|
15
|
+
placement?: BasePlacement;
|
|
16
|
+
positionStrategy?: 'fixed' | 'absolute';
|
|
17
|
+
renderButton?: () => JSX.Element;
|
|
18
|
+
showAfterSeconds?: number;
|
|
19
|
+
showAlways?: boolean;
|
|
20
|
+
shouldRender?: boolean;
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
type?: tooltipTypes;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties, Dispatch, MouseEventHandler, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
+
import { TooltipProps } from './types';
|
|
3
|
+
declare type UseTooltipParams = Pick<TooltipProps, 'callbackAfterTimeout' | 'hideAfterSeconds' | 'onMouseEnter' | 'onMouseLeave' | 'onOpen' | 'placement' | 'showAfterSeconds' | 'showAlways' | 'positionStrategy'>;
|
|
4
|
+
export declare type UseTooltipValue<W extends HTMLElement, C extends HTMLElement> = {
|
|
5
|
+
_onMouseEnter: MouseEventHandler;
|
|
6
|
+
_onMouseLeave: MouseEventHandler;
|
|
7
|
+
attributes: Record<string, Record<string, string> | undefined>;
|
|
8
|
+
childrenRef: MutableRefObject<C | null>;
|
|
9
|
+
popperRef: MutableRefObject<HTMLDivElement | null>;
|
|
10
|
+
setArrowRef: Dispatch<SetStateAction<HTMLDivElement | null>>;
|
|
11
|
+
show: () => void;
|
|
12
|
+
showTooltip: boolean | undefined;
|
|
13
|
+
styles: Record<string, CSSProperties>;
|
|
14
|
+
wrapperRef: MutableRefObject<W | null>;
|
|
15
|
+
};
|
|
16
|
+
declare const useTooltip: <W extends HTMLElement, C extends HTMLElement>({ callbackAfterTimeout, hideAfterSeconds, onMouseEnter, onMouseLeave, onOpen, placement, positionStrategy, showAfterSeconds, showAlways, }: UseTooltipParams) => UseTooltipValue<W, C>;
|
|
17
|
+
export default useTooltip;
|