@fattureincloud/fic-design-system 0.6.5 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/common/hooks/useOutsideClick.d.ts +3 -0
- package/dist/components/drawer/components/styledDrawerWrapper.d.ts +2 -2
- package/dist/components/drawer/drawer.d.ts +10 -6
- package/dist/components/dropdown/DropdownImpl.d.ts +1 -1
- package/dist/components/dropdown/types.d.ts +1 -0
- package/dist/components/form/datepicker/hooks/useDatePickerValues.d.ts +13 -0
- package/dist/components/form/inputText/components/codeInput/CodeInput.d.ts +4 -0
- package/dist/components/form/inputText/components/codeInput/styled.d.ts +29 -0
- package/dist/components/form/inputText/components/codeInput/useCodeInputHooks.d.ts +11 -0
- package/dist/components/form/inputText/components/telephoneInput/TelephoneInput.d.ts +4 -0
- package/dist/components/form/inputText/components/telephoneInput/countriesTelephonePrefixes.d.ts +7 -0
- package/dist/components/form/inputText/components/telephoneInput/styled.d.ts +2 -0
- package/dist/components/form/textArea/TextArea.d.ts +3 -3
- package/dist/components/form/textArea/components/TextAreaElement.d.ts +2 -2
- package/dist/components/modals/stepModal/components/StepModalBody.d.ts +1 -1
- package/dist/components/modals/stepModal/types.d.ts +2 -0
- package/dist/components/newTable/Table.d.ts +33 -0
- package/dist/components/newTable/components/action/favorite/Favorite.d.ts +14 -0
- package/dist/components/newTable/components/action/favorite/index.d.ts +1 -0
- package/dist/components/newTable/components/action/favorite/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/ColumnItem.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnsSettings.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/DraggableContent/DraggableContent.d.ts +7 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/index.d.ts +2 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/DropdownSettings/DropdownSettings.d.ts +7 -0
- package/dist/components/newTable/components/action/settings/DropdownSettings/index.d.ts +1 -0
- package/dist/components/newTable/components/action/settings/DropdownSettings/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/RowHeightSettings/RowHeightSettings.d.ts +10 -0
- package/dist/components/newTable/components/action/settings/RowHeightSettings/index.d.ts +1 -0
- package/dist/components/newTable/components/action/settings/RowHeightSettings/styled.d.ts +2 -0
- package/dist/components/newTable/components/action/settings/Settings.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/hooks/index.d.ts +2 -0
- package/dist/components/newTable/components/action/settings/hooks/useColumnValues.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/hooks/useDropdownSettingsValues.d.ts +13 -0
- package/dist/components/newTable/components/action/settings/index.d.ts +1 -0
- package/dist/components/newTable/components/action/settings/styled.d.ts +2 -0
- package/dist/components/newTable/components/action/toggle/Toggle.d.ts +14 -0
- package/dist/components/newTable/components/action/toggle/constants.d.ts +3 -0
- package/dist/components/newTable/components/action/toggle/index.d.ts +1 -0
- package/dist/components/newTable/components/action/toggle/styled.d.ts +5 -0
- package/dist/components/newTable/components/body/Body.d.ts +9 -0
- package/dist/components/newTable/components/bulkBar/BulkBar.d.ts +9 -0
- package/dist/components/newTable/components/bulkBar/styled.d.ts +10 -0
- package/dist/components/newTable/components/cell/Cell.d.ts +12 -0
- package/dist/components/newTable/components/cell/customActionCell/CustomActionCell.d.ts +12 -0
- package/dist/components/newTable/components/cell/customActionCell/DropdownActionCell.d.ts +10 -0
- package/dist/components/newTable/components/cell/customActionCell/PrimaryActionCell.d.ts +9 -0
- package/dist/components/newTable/components/cell/customActionCell/index.d.ts +3 -0
- package/dist/components/newTable/components/cell/customActionCell/styled.d.ts +4 -0
- package/dist/components/newTable/components/cell/customCell/CustomCell.d.ts +11 -0
- package/dist/components/newTable/components/cell/customCell/CustomInput.d.ts +9 -0
- package/dist/components/newTable/components/cell/customCell/TextAreaPopup.d.ts +9 -0
- package/dist/components/newTable/components/cell/customCell/constants.d.ts +1 -0
- package/dist/components/newTable/components/cell/customCell/index.d.ts +1 -0
- package/dist/components/newTable/components/cell/customCell/styled.d.ts +7 -0
- package/dist/components/newTable/components/cell/hooks/index.d.ts +1 -0
- package/dist/components/newTable/components/cell/hooks/useCellValues.d.ts +16 -0
- package/dist/components/newTable/components/cell/loadingCell/LoadingCell.d.ts +7 -0
- package/dist/components/newTable/components/cell/loadingCell/index.d.ts +1 -0
- package/dist/components/newTable/components/cell/styled.d.ts +20 -0
- package/dist/components/newTable/components/footer/Footer.d.ts +7 -0
- package/dist/components/newTable/components/header/Header.d.ts +10 -0
- package/dist/components/newTable/components/header/headerCell/ActionHeaderCell.d.ts +8 -0
- package/dist/components/newTable/components/header/headerCell/HeaderCell.d.ts +12 -0
- package/dist/components/newTable/components/header/headerCell/styled.d.ts +9 -0
- package/dist/components/newTable/components/header/hooks/index.d.ts +2 -0
- package/dist/components/newTable/components/header/hooks/useActionHeaderValues.d.ts +16 -0
- package/dist/components/newTable/components/header/hooks/useHeaderValues.d.ts +14 -0
- package/dist/components/newTable/components/row/Row.d.ts +10 -0
- package/dist/components/newTable/components/row/styled.d.ts +6 -0
- package/dist/components/newTable/components/utils.d.ts +10 -0
- package/dist/components/newTable/constants.d.ts +2 -0
- package/dist/components/newTable/hooks/useColumnPinning.d.ts +8 -0
- package/dist/components/newTable/hooks/usePagination.d.ts +9 -0
- package/dist/components/newTable/index.d.ts +2 -0
- package/dist/components/newTable/providers/TableProvider/TableProvider.d.ts +5 -0
- package/dist/components/newTable/providers/TableProvider/index.d.ts +3 -0
- package/dist/components/newTable/providers/TableProvider/types.d.ts +10 -0
- package/dist/components/newTable/stories/actions.d.ts +4 -0
- package/dist/components/newTable/stories/columns.d.ts +3 -0
- package/dist/components/newTable/stories/data.d.ts +2 -0
- package/dist/components/newTable/stories/styled.d.ts +1 -0
- package/dist/components/newTable/stories/types.d.ts +9 -0
- package/dist/components/newTable/styled.d.ts +9 -0
- package/dist/components/newTable/table.stories.d.ts +6 -0
- package/dist/components/newTable/types.d.ts +171 -0
- package/dist/components/newTable/utils.d.ts +8 -0
- package/dist/components/oldTable/components/EmptyState.d.ts +7 -0
- package/dist/components/oldTable/components/SelectedRowsCount.d.ts +7 -0
- package/dist/components/oldTable/components/actions/ActionsCell.d.ts +10 -0
- package/dist/components/oldTable/components/actions/DropdownActions.d.ts +10 -0
- package/dist/components/oldTable/components/actions/PrimaryAction.d.ts +12 -0
- package/dist/components/oldTable/components/checkboxes/Cell.d.ts +5 -0
- package/dist/components/oldTable/components/checkboxes/Header.d.ts +5 -0
- package/dist/components/oldTable/components/checkboxes/useHeaderCheckboxProps.d.ts +12 -0
- package/dist/components/oldTable/components/loadingCell/LoadingCell.d.ts +8 -0
- package/dist/components/oldTable/components/pagination/PageButton.d.ts +10 -0
- package/dist/components/oldTable/components/pagination/PaginationButtons.d.ts +10 -0
- package/dist/components/oldTable/components/pagination/utils.d.ts +14 -0
- package/dist/components/oldTable/components/tableBody/TableBody.d.ts +17 -0
- package/dist/components/oldTable/components/tableBody/TableBodyTr.d.ts +8 -0
- package/dist/components/oldTable/components/tableHeader/SortIndicator.d.ts +7 -0
- package/dist/components/oldTable/components/tableHeader/TableHeader.d.ts +12 -0
- package/dist/components/oldTable/components/tableParts/TableTd.d.ts +8 -0
- package/dist/components/oldTable/components/tableParts/TableTh.d.ts +4 -0
- package/dist/components/oldTable/components/tableParts/styled.d.ts +17 -0
- package/dist/components/oldTable/constants.d.ts +2 -0
- package/dist/components/oldTable/hooks/useCheckboxesComponents.d.ts +4 -0
- package/dist/components/oldTable/hooks/useRowsSelection.d.ts +4 -0
- package/dist/components/oldTable/hooks/useTableHooks.d.ts +6 -0
- package/dist/components/oldTable/hooks/useTableValues.d.ts +14 -0
- package/dist/components/oldTable/index.d.ts +7 -0
- package/dist/components/oldTable/stories/columns.d.ts +3 -0
- package/dist/components/oldTable/stories/components/CustomPerson.d.ts +7 -0
- package/dist/components/oldTable/stories/components/Role.d.ts +8 -0
- package/dist/components/oldTable/stories/components/types.d.ts +14 -0
- package/dist/components/oldTable/stories/data.d.ts +2 -0
- package/dist/components/oldTable/table.stories.d.ts +6 -0
- package/dist/components/oldTable/tablePalette.d.ts +33 -0
- package/dist/components/oldTable/types.d.ts +28 -0
- package/dist/components/oldTable/utils.d.ts +16 -0
- package/dist/components/pagination/Pagination.d.ts +0 -1
- package/dist/components/pagination/pagination.stories.d.ts +1 -2
- package/dist/components/pagination/styled.d.ts +3 -4
- package/dist/components/pagination/types.d.ts +14 -4
- package/dist/components/table/Table.d.ts +57 -0
- package/dist/components/table/components/ActionsCell.d.ts +10 -0
- package/dist/components/table/components/Pagination.d.ts +8 -0
- package/dist/components/table/components/SortIndicator.d.ts +6 -0
- package/dist/components/table/components/TableBody.d.ts +14 -0
- package/dist/components/table/components/TableFoot.d.ts +2 -0
- package/dist/components/table/components/TableHeader.d.ts +7 -0
- package/dist/components/table/components/tableBody/TableBodyLoader.d.ts +7 -0
- package/dist/components/table/components/tableBody/styled.d.ts +3 -0
- package/dist/components/toast/typings/toast.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.d.ts +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +26 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +25 -4
- package/dist/index.js.map +1 -1
- package/dist/styles/theme.d.ts +1 -1
- package/package.json +2 -1
- package/dist/components/accordion-new/Accordion.d.ts +0 -12
- package/dist/components/accordion-new/accordion-new.stories.d.ts +0 -4
- package/dist/components/accordion-new/components/AccordionIcon.d.ts +0 -3
- package/dist/components/accordion-new/components/AccordionItem.d.ts +0 -3
- package/dist/components/accordion-new/components/styled.d.ts +0 -8
- package/dist/components/accordion-new/index.d.ts +0 -3
- package/dist/components/accordion-new/types.d.ts +0 -58
- package/dist/components/accordion-new/utils.d.ts +0 -10
- package/dist/components/checkbox/Checkbox.d.ts +0 -15
- package/dist/components/checkbox/checkbox.stories.d.ts +0 -1
- package/dist/components/checkbox/checkboxPalette.d.ts +0 -16
- package/dist/components/checkbox/components/Input.d.ts +0 -9
- package/dist/components/checkbox/components/Label.d.ts +0 -8
- package/dist/components/checkbox/hooks/useCheckboxValue.d.ts +0 -11
- package/dist/components/checkbox/index.d.ts +0 -4
- package/dist/components/checkbox/types.d.ts +0 -19
- package/dist/components/checkbox/utils.d.ts +0 -24
- package/dist/components/form/fileUploader/fileTypes.d.ts +0 -3
- package/dist/components/form/fileUploader/hooks/useIcon.d.ts +0 -4
- package/dist/components/form/fileUploader/hooks/useTexts.d.ts +0 -3
- package/dist/components/form/select/components/types.d.ts +0 -10
- package/dist/components/inputText/components/icons.d.ts +0 -8
- package/dist/components/inputText/components/inputContainer.d.ts +0 -1
- package/dist/components/inputText/components/messages.d.ts +0 -2
- package/dist/components/inputText/components/wrapperTextArea.d.ts +0 -1
- package/dist/components/inputText/icons.d.ts +0 -9
- package/dist/components/inputText/index.d.ts +0 -3
- package/dist/components/inputText/inputText.stories.d.ts +0 -1
- package/dist/components/inputText/inputTextStyledWrapper.d.ts +0 -2
- package/dist/components/inputText/sideText.d.ts +0 -6
- package/dist/components/inputText/typings/enums.d.ts +0 -17
- package/dist/components/inputText/typings/inputText.d.ts +0 -43
- package/dist/components/inputText/utils.d.ts +0 -8
- package/dist/components/select/hooks/constants.d.ts +0 -4613
- package/dist/components/select/hooks/useCustomSelectStyle.d.ts +0 -4
- package/dist/components/select/index.d.ts +0 -4
- package/dist/components/select/select.stories.d.ts +0 -1
- package/dist/components/select/typings/select.d.ts +0 -22
- package/dist/components/stepBar/components/singleStep.d.ts +0 -3
- package/dist/components/stepBar/components/styledStepBarWrapper.d.ts +0 -2
- package/dist/components/stepBar/index.d.ts +0 -2
- package/dist/components/stepBar/stepBar.d.ts +0 -7
- package/dist/components/stepBar/stepBar.stories.d.ts +0 -1
- package/dist/components/stepBar/types.d.ts +0 -15
- package/dist/components/table/components/actionLink.d.ts +0 -3
- package/dist/components/table/components/actions/actionsContainer.d.ts +0 -1
- package/dist/components/table/components/actions/actionsPopUp.d.ts +0 -12
- package/dist/components/table/components/actions/actionsPopUpButton.d.ts +0 -8
- package/dist/components/table/components/actions/actionsPopUpUnderlay.d.ts +0 -3
- package/dist/components/table/components/components/headDesktop.d.ts +0 -15
- package/dist/components/table/components/components/listMobile.d.ts +0 -15
- package/dist/components/table/components/components/rowDesktop.d.ts +0 -18
- package/dist/components/table/components/customizationModal/customizationsModal.d.ts +0 -10
- package/dist/components/table/components/customizationModal/index.d.ts +0 -2
- package/dist/components/table/components/customizationModal/styledWrapper.d.ts +0 -3
- package/dist/components/table/components/customizationModal/useDnd.d.ts +0 -8
- package/dist/components/table/components/customizationModal/utils.d.ts +0 -6
- package/dist/components/table/components/emptySet.d.ts +0 -10
- package/dist/components/table/components/linearBackground.d.ts +0 -1
- package/dist/components/table/components/loadingContent.d.ts +0 -7
- package/dist/components/table/components/sortIcon.d.ts +0 -2
- package/dist/components/table/components/styledWrapper.d.ts +0 -3
- package/dist/components/table/components/unstyledTable.d.ts +0 -11
- package/dist/components/table/typings/main.d.ts +0 -92
- package/dist/components/table/utils/configPersistency.d.ts +0 -14
- package/dist/components/textButton/TextButton.d.ts +0 -12
- package/dist/components/textButton/index.d.ts +0 -2
- package/dist/components/textButton/textButton.stories.d.ts +0 -1
- package/dist/components/tooltips/components/message.d.ts +0 -12
- package/dist/components/tooltips/components/styledTooltipWrapper.d.ts +0 -1
- package/dist/components/tooltips/index.d.ts +0 -2
- package/dist/components/tooltips/tooltips.d.ts +0 -15
- package/dist/components/tooltips/tooltips.stories.d.ts +0 -1
- package/dist/components/tooltips/types.d.ts +0 -25
- package/dist/styles/elevations.d.ts +0 -7
- package/dist/utils/FICNumbers.d.ts +0 -11
- /package/dist/components/{table/table.d.ts → oldTable/Table.d.ts} +0 -0
- /package/dist/components/{table/components/pagination.d.ts → oldTable/components/Pagination.d.ts} +0 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { HeaderGroup } from '@tanstack/react-table';
|
3
|
+
import { OnSort, RowSize } from '../../types';
|
4
|
+
interface HeaderProps<T> {
|
5
|
+
headerGroup: HeaderGroup<T>[];
|
6
|
+
headerSize?: RowSize;
|
7
|
+
onSort?: OnSort<T>;
|
8
|
+
}
|
9
|
+
declare const Header: <T>({ headerGroup, headerSize, onSort }: HeaderProps<T>) => JSX.Element;
|
10
|
+
export default Header;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Header } from '@tanstack/react-table';
|
3
|
+
interface CustomHeaderCellProps<T> {
|
4
|
+
header: Header<T, unknown>;
|
5
|
+
onOpen?: (isOpen: boolean) => void;
|
6
|
+
}
|
7
|
+
declare const ActionHeaderCell: <T>({ header, onOpen }: CustomHeaderCellProps<T>) => JSX.Element;
|
8
|
+
export default ActionHeaderCell;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Header, SortDirection } from '@tanstack/react-table';
|
2
|
+
import { default as React } from 'react';
|
3
|
+
import { CustomSorted, OnSort, RowSize } from '../../../types';
|
4
|
+
interface HeaderCellProps<T> {
|
5
|
+
header: Header<T, unknown>;
|
6
|
+
headerSize?: RowSize;
|
7
|
+
onSort?: OnSort<T>;
|
8
|
+
customSorted?: false | SortDirection;
|
9
|
+
setCustomSorted?: React.Dispatch<React.SetStateAction<CustomSorted<T> | undefined>>;
|
10
|
+
}
|
11
|
+
declare const HeaderCell: <T>({ header, headerSize, onSort, customSorted, setCustomSorted, }: HeaderCellProps<T>) => JSX.Element;
|
12
|
+
export default HeaderCell;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { RowSize } from '../../../types';
|
2
|
+
export declare const TextHeaderCell: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const Th: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {
|
4
|
+
size?: RowSize | undefined;
|
5
|
+
minWidth?: number | undefined;
|
6
|
+
sortable: boolean;
|
7
|
+
}, never>;
|
8
|
+
export declare const TextHeaderCellWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
9
|
+
export declare const ActionCell: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Column, Header, Table } from '@tanstack/react-table';
|
2
|
+
import { ActionType } from '../../../types';
|
3
|
+
interface ActionHeaderValues<T> {
|
4
|
+
actionType: ActionType;
|
5
|
+
canSort: boolean;
|
6
|
+
isSorted: boolean;
|
7
|
+
isSortedDesc: string | null;
|
8
|
+
isSettingsEnabled: boolean;
|
9
|
+
toggleSortable: boolean;
|
10
|
+
favoriteSortable: boolean;
|
11
|
+
table: Table<T>;
|
12
|
+
headerTitle?: string | number;
|
13
|
+
allColumns: Column<T, unknown>[];
|
14
|
+
}
|
15
|
+
declare const useActionHeaderValues: <T>(header: Header<T, unknown>) => ActionHeaderValues<T>;
|
16
|
+
export default useActionHeaderValues;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Column, Header } from '@tanstack/react-table';
|
2
|
+
import { TooltipProps } from '../../../../tooltip';
|
3
|
+
import { ActionType } from '../../../types';
|
4
|
+
interface HeaderValues<T> {
|
5
|
+
column: Column<T, unknown>;
|
6
|
+
actionType: ActionType;
|
7
|
+
canSort: boolean;
|
8
|
+
isSorted: boolean;
|
9
|
+
isSortedDesc: string | null;
|
10
|
+
minWidth?: number;
|
11
|
+
tooltip?: TooltipProps;
|
12
|
+
}
|
13
|
+
declare const useHeaderValues: <T>(header: Header<T, unknown>) => HeaderValues<T>;
|
14
|
+
export default useHeaderValues;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Row } from '@tanstack/react-table';
|
2
|
+
import React from 'react';
|
3
|
+
import { RowSize } from '../../types';
|
4
|
+
interface TrProps<T> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> {
|
5
|
+
row: Row<T>;
|
6
|
+
rowSize?: RowSize;
|
7
|
+
isLoading?: boolean;
|
8
|
+
}
|
9
|
+
declare const Tr: <T>({ row, isLoading }: TrProps<T>) => JSX.Element;
|
10
|
+
export default Tr;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { RowSize } from '../../types';
|
2
|
+
export declare const TRow: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
|
3
|
+
mouseHover?: boolean | undefined;
|
4
|
+
size?: RowSize | undefined;
|
5
|
+
selected?: boolean | undefined;
|
6
|
+
}, never>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ColumnPinningPosition } from '@tanstack/react-table';
|
2
|
+
import { DefaultTheme } from 'styled-components';
|
3
|
+
interface Props {
|
4
|
+
theme: DefaultTheme;
|
5
|
+
isHeader: boolean;
|
6
|
+
isPopoverActive?: boolean;
|
7
|
+
isPinned: ColumnPinningPosition;
|
8
|
+
}
|
9
|
+
export declare const getFixedColumnsStyles: ({ theme, isHeader, isPopoverActive, isPinned }: Props) => React.CSSProperties;
|
10
|
+
export {};
|
@@ -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,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { PaginationState } from '@tanstack/react-table';
|
3
|
+
interface ReturnType {
|
4
|
+
readonly pageIndex: number;
|
5
|
+
readonly pageSize: number;
|
6
|
+
readonly setPagination: React.Dispatch<React.SetStateAction<PaginationState>>;
|
7
|
+
}
|
8
|
+
export declare const usePagination: (size: number) => ReturnType;
|
9
|
+
export {};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TableContextProps, TableProviderProps } from '.';
|
3
|
+
export declare const TableContext: React.Context<TableContextProps>;
|
4
|
+
declare const TableProvider: ({ children, defaultRowSize }: TableProviderProps) => JSX.Element;
|
5
|
+
export default TableProvider;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { RowSize } from '../../types';
|
3
|
+
export interface TableContextProps {
|
4
|
+
rowSize: RowSize;
|
5
|
+
setRowSize: (rowHeight: RowSize) => void;
|
6
|
+
}
|
7
|
+
export interface TableProviderProps {
|
8
|
+
children: React.ReactNode | React.ReactNode[];
|
9
|
+
defaultRowSize?: RowSize;
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const TableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const ScrollableContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const TableWrapper: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {}, never>;
|
5
|
+
export declare const SortIndicator: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {
|
6
|
+
isSorted: boolean;
|
7
|
+
isSortedDesc: boolean;
|
8
|
+
}, never>;
|
9
|
+
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,171 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { DisplayColumnDef, GroupColumnDef, IdentifiedColumnDef, PaginationState, Row, SortDirection } from '@tanstack/react-table';
|
3
|
+
import { AvatarProps } from '../avatar';
|
4
|
+
import { ButtonProps } from '../buttons';
|
5
|
+
import { DropdownItemType } from '../dropdown/types';
|
6
|
+
import { IconProps } from '../icon';
|
7
|
+
import { MicroTagProps } from '../microTag';
|
8
|
+
import { TagProps } from '../tag';
|
9
|
+
import { TooltipProps } from '../tooltip';
|
10
|
+
export interface TableProps<T> {
|
11
|
+
uniqueId: keyof T;
|
12
|
+
data: T[];
|
13
|
+
columns: ColumnsType<T>[];
|
14
|
+
isSelectable?: boolean;
|
15
|
+
onRowSelectionChange?: (data: T[]) => void;
|
16
|
+
favorites?: string[];
|
17
|
+
onFavoritesChange?: (favourites: string[]) => void;
|
18
|
+
toggles?: string[];
|
19
|
+
onTogglesChange?: (toggles: string[]) => void;
|
20
|
+
rowSize?: RowSize;
|
21
|
+
headerSize?: RowSize;
|
22
|
+
sortable?: boolean;
|
23
|
+
sortDescFirst?: boolean;
|
24
|
+
onSort?: OnSort<T>;
|
25
|
+
isFavoritesSortable?: boolean;
|
26
|
+
isTogglesSortable?: boolean;
|
27
|
+
rowActions?: RowActions<T>;
|
28
|
+
bulkActions?: BulkAction<T>[];
|
29
|
+
isLoading?: boolean;
|
30
|
+
allSelectedCTA?: AllSelectedCTA;
|
31
|
+
noPagination?: boolean;
|
32
|
+
pageSize?: number;
|
33
|
+
listSize?: number;
|
34
|
+
enableSettings?: boolean;
|
35
|
+
settingsDropdownConfig?: SettingsDropdownConfig;
|
36
|
+
paginationPreviousText?: string;
|
37
|
+
paginationNextText?: string;
|
38
|
+
onPaginationChange?: (pagination: PaginationState) => void;
|
39
|
+
renderEmptyState?: () => JSX.Element;
|
40
|
+
}
|
41
|
+
interface SettingsDropdownConfig {
|
42
|
+
settingsTooltip?: TooltipProps;
|
43
|
+
displaySettingsLabel?: string;
|
44
|
+
visibleColumnsLabel?: string;
|
45
|
+
rowHeightLabel?: string;
|
46
|
+
unspecifiedRowsLabel?: string;
|
47
|
+
smallRowsLabel?: string;
|
48
|
+
largeRowsLabel?: string;
|
49
|
+
}
|
50
|
+
export declare enum RowSize {
|
51
|
+
UNSPECIFIED = 0,
|
52
|
+
SMALL,
|
53
|
+
LARGE
|
54
|
+
}
|
55
|
+
export declare enum ColumnDefType {
|
56
|
+
ACCESSOR = "accessor",
|
57
|
+
DISPLAY = "display",
|
58
|
+
GROUP = "group",
|
59
|
+
ACTION = "action"
|
60
|
+
}
|
61
|
+
interface ExtraColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
|
62
|
+
isEditable: boolean;
|
63
|
+
onChange: (text: string, row: Row<T>) => void;
|
64
|
+
}
|
65
|
+
interface InitalColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
|
66
|
+
isEditable?: false;
|
67
|
+
onChange?: never;
|
68
|
+
}
|
69
|
+
export declare type AccessorColumnDef<T> = InitalColumnDef<T> | ExtraColumnDef<T>;
|
70
|
+
export declare enum ActionType {
|
71
|
+
CHECKBOX = "checkbox",
|
72
|
+
TOGGLE = "toggle",
|
73
|
+
FAVORITE = "favorite",
|
74
|
+
ROW_ACTIONS = "row_actions",
|
75
|
+
SETTINGS = "settings"
|
76
|
+
}
|
77
|
+
export declare type ActionColumnDef<T> = {
|
78
|
+
onActionChange?: (id: string) => void;
|
79
|
+
actionType: ActionType;
|
80
|
+
favorites?: string[];
|
81
|
+
toggles?: string[];
|
82
|
+
enableSorting?: boolean;
|
83
|
+
enableSettings?: boolean;
|
84
|
+
rowActions?: RowActions<T>;
|
85
|
+
settingsDropdownConfig?: SettingsDropdownConfig;
|
86
|
+
} & IdentifiedColumnDef<T, CellProps>;
|
87
|
+
export declare type AdditionalColumnDef = {
|
88
|
+
unitSymbol?: string;
|
89
|
+
minWidth?: number;
|
90
|
+
headerTooltip?: TooltipProps;
|
91
|
+
};
|
92
|
+
export declare type ColumnsType<T> = ({
|
93
|
+
columnDefType: ColumnDefType.ACCESSOR;
|
94
|
+
columnDef: AccessorColumnDef<T> & AdditionalColumnDef;
|
95
|
+
} & BaseColumnsType<T>) | ({
|
96
|
+
columnDefType: ColumnDefType.DISPLAY;
|
97
|
+
columnDef: DisplayColumnDef<T, unknown> & AdditionalColumnDef;
|
98
|
+
} & BaseColumnsType<T>) | ({
|
99
|
+
columnDefType: ColumnDefType.ACTION;
|
100
|
+
columnDef: ActionColumnDef<T> & AdditionalColumnDef;
|
101
|
+
} & BaseColumnsType<T>) | ({
|
102
|
+
columnDefType: ColumnDefType.GROUP;
|
103
|
+
columnDef: GroupColumnDef<T, unknown>;
|
104
|
+
} & BaseColumnsType<T>);
|
105
|
+
interface BaseColumnsType<T> {
|
106
|
+
key: keyof T | Lowercase<keyof typeof ActionType>;
|
107
|
+
}
|
108
|
+
interface CustomCellWithAvatar extends BasicCustomCell {
|
109
|
+
avatar?: AvatarProps;
|
110
|
+
leadingIcon?: never;
|
111
|
+
}
|
112
|
+
interface CustomCellWithIcon extends BasicCustomCell {
|
113
|
+
avatar?: never;
|
114
|
+
leadingIcon?: IconProps;
|
115
|
+
}
|
116
|
+
export interface BasicCustomCell {
|
117
|
+
unitSymbol?: string;
|
118
|
+
trailingMicroTag?: MicroTagProps;
|
119
|
+
headline?: boolean;
|
120
|
+
content?: string | number;
|
121
|
+
tag?: TagProps;
|
122
|
+
isFavorite?: boolean;
|
123
|
+
isToggled?: boolean;
|
124
|
+
}
|
125
|
+
export declare type CustomCellProps = CustomCellWithIcon | CustomCellWithAvatar;
|
126
|
+
export declare type CellProps = CustomCellProps | string | number;
|
127
|
+
export interface RowActions<T> {
|
128
|
+
headerTitle?: string | number;
|
129
|
+
primary?: PrimaryAction<T>;
|
130
|
+
dropdown?: DropdownAction<T>;
|
131
|
+
}
|
132
|
+
export interface RowAction<T> {
|
133
|
+
text: string;
|
134
|
+
icon?: IconProps;
|
135
|
+
type?: DropdownItemType;
|
136
|
+
onClick: (row: Row<T>) => void;
|
137
|
+
}
|
138
|
+
declare type BasicPrimaryAction<T> = {
|
139
|
+
tooltip?: TooltipProps;
|
140
|
+
onClick: (row: Row<T>) => void;
|
141
|
+
};
|
142
|
+
interface PrimaryTextAction<T> extends BasicPrimaryAction<T> {
|
143
|
+
text?: string | number;
|
144
|
+
icon?: never;
|
145
|
+
}
|
146
|
+
interface PrimaryIconAction<T> extends BasicPrimaryAction<T> {
|
147
|
+
text?: never;
|
148
|
+
icon?: IconProps;
|
149
|
+
}
|
150
|
+
export declare type PrimaryAction<T> = PrimaryTextAction<T> | PrimaryIconAction<T>;
|
151
|
+
export declare type DropdownAction<T> = {
|
152
|
+
items: RowAction<T>[];
|
153
|
+
tooltip?: TooltipProps;
|
154
|
+
};
|
155
|
+
export interface BulkAction<T> extends Omit<ButtonProps, 'onClick' | 'text'> {
|
156
|
+
onClick: (rows: T[]) => void;
|
157
|
+
text: string | JSX.Element;
|
158
|
+
}
|
159
|
+
export interface AllSelectedCTA {
|
160
|
+
description?: string;
|
161
|
+
onClick: () => void;
|
162
|
+
text: string;
|
163
|
+
}
|
164
|
+
export declare type OnSort<T> = (sortParams: {
|
165
|
+
sortBy: keyof T;
|
166
|
+
direction: false | SortDirection;
|
167
|
+
}) => void;
|
168
|
+
export declare type CustomSorted<T> = {
|
169
|
+
[key in keyof T]: false | SortDirection;
|
170
|
+
};
|
171
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ColumnDef, SortDirection } from '@tanstack/react-table';
|
2
|
+
import { CellProps } from './types';
|
3
|
+
import { TableProps } from './types';
|
4
|
+
interface ColumnsHelperProps<T> extends Omit<TableProps<T>, 'data' | 'uniqueId'> {
|
5
|
+
}
|
6
|
+
export declare const useColumnsHelper: <T>({ columns, isSelectable, favorites, isFavoritesSortable, onFavoritesChange, toggles, isTogglesSortable, onTogglesChange, rowActions, enableSettings, settingsDropdownConfig, }: ColumnsHelperProps<T>) => ColumnDef<T, CellProps>[];
|
7
|
+
export declare const getNextSortingDirection: (direction?: false | SortDirection | undefined) => false | SortDirection;
|
8
|
+
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from 'react-table';
|
3
|
+
import { RowActions, TableData } from '../../types';
|
4
|
+
interface Props<T extends TableData> {
|
5
|
+
row: Row<T>;
|
6
|
+
actions?: RowActions<T>;
|
7
|
+
renderActions?: () => JSX.Element;
|
8
|
+
}
|
9
|
+
declare const ActionsCell: <T extends TableData>({ row, actions, renderActions }: Props<T>) => JSX.Element;
|
10
|
+
export default ActionsCell;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from 'react-table';
|
3
|
+
import { RowAction, TableData } from '../../types';
|
4
|
+
interface Props<T extends TableData> {
|
5
|
+
row: Row<T>;
|
6
|
+
actions: RowAction<T>[];
|
7
|
+
rowIsDisabled?: boolean;
|
8
|
+
}
|
9
|
+
declare const DropdownActions: <T extends TableData>({ row, actions, rowIsDisabled }: Props<T>) => JSX.Element;
|
10
|
+
export default DropdownActions;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from 'react-table';
|
3
|
+
import { DropdownItemType } from '../../../dropdown';
|
4
|
+
import { RowAction, TableData } from '../../types';
|
5
|
+
interface Props<T extends TableData> {
|
6
|
+
action: RowAction<T>;
|
7
|
+
row: Row<T>;
|
8
|
+
rowIsDisabled?: boolean;
|
9
|
+
type?: DropdownItemType;
|
10
|
+
}
|
11
|
+
declare const PrimaryAction: <T extends TableData>({ action, row, rowIsDisabled, type, }: Props<T>) => JSX.Element | null;
|
12
|
+
export default PrimaryAction;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
2
|
+
import { HeaderProps, TableToggleAllRowsSelectedProps } from 'react-table';
|
3
|
+
import { TableData } from '../../types';
|
4
|
+
interface Props<T extends TableData> {
|
5
|
+
headerProps: PropsWithChildren<HeaderProps<T>>;
|
6
|
+
selectSinglePage?: boolean;
|
7
|
+
}
|
8
|
+
interface ReturnType extends TableToggleAllRowsSelectedProps {
|
9
|
+
disabled: boolean;
|
10
|
+
}
|
11
|
+
declare const useHeaderCheckboxProps: <T extends TableData>({ headerProps, selectSinglePage, }: Props<T>) => ReturnType;
|
12
|
+
export default useHeaderCheckboxProps;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ColumnInstance } from 'react-table';
|
3
|
+
import { TableData } from '../../types';
|
4
|
+
interface LoadingCellProps<T extends TableData> {
|
5
|
+
column: ColumnInstance<T>;
|
6
|
+
}
|
7
|
+
declare const LoadingCell: <T extends TableData>({ column }: LoadingCellProps<T>) => JSX.Element;
|
8
|
+
export default LoadingCell;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ReactText } from 'react';
|
2
|
+
interface Props extends PageButtonWrapperProps {
|
3
|
+
text: ReactText;
|
4
|
+
onClick: () => void;
|
5
|
+
}
|
6
|
+
declare const PageButton: ({ text, onClick, isActive }: Props) => JSX.Element;
|
7
|
+
export interface PageButtonWrapperProps {
|
8
|
+
isActive: boolean;
|
9
|
+
}
|
10
|
+
export default PageButton;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { UsePaginationInstanceProps } from 'react-table';
|
3
|
+
import { TableData } from '../../types';
|
4
|
+
interface Props<T extends TableData> {
|
5
|
+
pageCount: number;
|
6
|
+
pageIndex: number;
|
7
|
+
gotoPage: UsePaginationInstanceProps<T>['gotoPage'];
|
8
|
+
}
|
9
|
+
declare const PaginationButtons: <T extends TableData>({ pageCount, pageIndex, gotoPage }: Props<T>) => JSX.Element;
|
10
|
+
export default PaginationButtons;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { DefaultTheme } from 'styled-components';
|
2
|
+
import { paletteColor } from '../../../../styles/types';
|
3
|
+
import { PageButtonWrapperProps } from './PageButton';
|
4
|
+
interface GetPageButtonParams extends PageButtonWrapperProps {
|
5
|
+
theme: DefaultTheme;
|
6
|
+
}
|
7
|
+
export interface PageButtonStyles {
|
8
|
+
color: paletteColor;
|
9
|
+
background: paletteColor;
|
10
|
+
hoverColor: paletteColor;
|
11
|
+
hoverBackground: paletteColor;
|
12
|
+
}
|
13
|
+
export declare const getPageButtonStyles: ({ theme, isActive }: GetPageButtonParams) => PageButtonStyles;
|
14
|
+
export {};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Row, UseTableInstanceProps } from 'react-table';
|
3
|
+
import { TableData } from '../../types';
|
4
|
+
interface Props<T extends TableData> {
|
5
|
+
rows: Row<T>[];
|
6
|
+
prepareRow: UseTableInstanceProps<T>['prepareRow'];
|
7
|
+
selectedRowsIds: string[];
|
8
|
+
isLoading: boolean;
|
9
|
+
onRowClick?: (row: Row<T>) => void;
|
10
|
+
rowHasFocus: boolean;
|
11
|
+
rowHeight: number | string;
|
12
|
+
selectableRows?: boolean;
|
13
|
+
setHighlightedRow: React.Dispatch<React.SetStateAction<number>>;
|
14
|
+
tableId: string;
|
15
|
+
}
|
16
|
+
declare const TableBody: <T extends TableData>({ isLoading, onRowClick, prepareRow, rowHasFocus, rowHeight, rows, selectableRows, selectedRowsIds, setHighlightedRow, tableId, }: Props<T>) => JSX.Element;
|
17
|
+
export default TableBody;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { TableBodyTrStyles } from '../../utils';
|
2
|
+
export interface TableBodyTrProps {
|
3
|
+
isSelected?: boolean;
|
4
|
+
isDisabled?: boolean;
|
5
|
+
rowHasFocus: boolean;
|
6
|
+
}
|
7
|
+
declare const TableBodyTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, import("../tableParts/styled").TrProps & TableBodyTrStyles & TableBodyTrProps, keyof TableBodyTrStyles>;
|
8
|
+
export default TableBodyTr;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { HeaderGroup, SortingRule } from 'react-table';
|
3
|
+
import { TableData } from '../../types';
|
4
|
+
interface Props<T extends TableData> {
|
5
|
+
scrollBar: number;
|
6
|
+
headerGroups: HeaderGroup<T>[];
|
7
|
+
headerHeight?: number | string;
|
8
|
+
selectedRowsIds?: string[];
|
9
|
+
sortBy: SortingRule<T>[];
|
10
|
+
}
|
11
|
+
declare const TableHeader: <T extends TableData>({ headerHeight, headerGroups, scrollBar }: Props<T>) => JSX.Element;
|
12
|
+
export default TableHeader;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
declare type alignType = 'left' | 'center' | 'right';
|
3
|
+
interface Props extends React.HTMLAttributes<HTMLTableDataCellElement> {
|
4
|
+
align?: alignType;
|
5
|
+
isLoading?: boolean;
|
6
|
+
}
|
7
|
+
export declare const TableTd: import("styled-components").StyledComponent<({ children, align, isLoading, ...rest }: Props) => JSX.Element, import("styled-components").DefaultTheme, Props, never>;
|
8
|
+
export default TableTd;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
declare type Props = React.HTMLAttributes<HTMLTableHeaderCellElement>;
|
3
|
+
export declare const TableTh: import("styled-components").StyledComponent<({ children, ...rest }: Props) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export default TableTh;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare const TableWrapper: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {}, never>;
|
2
|
+
interface THeadProps {
|
3
|
+
scrollBar: number;
|
4
|
+
}
|
5
|
+
export declare const THead: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, THeadProps, 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>;
|
10
|
+
export interface TrProps {
|
11
|
+
isHeader?: boolean;
|
12
|
+
rowHeight?: number | string;
|
13
|
+
headerHeight?: number | string;
|
14
|
+
}
|
15
|
+
export declare const TableTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, TrProps, never>;
|
16
|
+
export declare const TFoot: import("styled-components").StyledComponent<"tfoot", import("styled-components").DefaultTheme, {}, never>;
|
17
|
+
export {};
|