@fattureincloud/fic-design-system 0.6.1 → 0.6.2-temp-table
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/common/components/Spinner.d.ts +5 -1
- package/dist/components/buttons/button/styled.d.ts +1 -1
- 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/newTable/Table.d.ts +32 -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 +170 -0
- package/dist/components/newTable/utils.d.ts +8 -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 → Table.d.ts} +0 -0
- package/dist/components/table/components/ActionsCell.d.ts +10 -0
- package/dist/components/table/components/{pagination.d.ts → Pagination.d.ts} +0 -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 +2 -1
- 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/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
@@ -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,170 @@
|
|
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';
|
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
|
+
}
|
40
|
+
interface SettingsDropdownConfig {
|
41
|
+
settingsTooltip?: TooltipProps;
|
42
|
+
displaySettingsLabel?: string;
|
43
|
+
visibleColumnsLabel?: string;
|
44
|
+
rowHeightLabel?: string;
|
45
|
+
unspecifiedRowsLabel?: string;
|
46
|
+
smallRowsLabel?: string;
|
47
|
+
largeRowsLabel?: string;
|
48
|
+
}
|
49
|
+
export declare enum RowSize {
|
50
|
+
UNSPECIFIED = 0,
|
51
|
+
SMALL,
|
52
|
+
LARGE
|
53
|
+
}
|
54
|
+
export declare enum ColumnDefType {
|
55
|
+
ACCESSOR = "accessor",
|
56
|
+
DISPLAY = "display",
|
57
|
+
GROUP = "group",
|
58
|
+
ACTION = "action"
|
59
|
+
}
|
60
|
+
interface ExtraColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
|
61
|
+
isEditable: boolean;
|
62
|
+
onChange: (text: string, row: Row<T>) => void;
|
63
|
+
}
|
64
|
+
interface InitalColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
|
65
|
+
isEditable?: false;
|
66
|
+
onChange?: never;
|
67
|
+
}
|
68
|
+
export declare type AccessorColumnDef<T> = InitalColumnDef<T> | ExtraColumnDef<T>;
|
69
|
+
export declare enum ActionType {
|
70
|
+
CHECKBOX = "checkbox",
|
71
|
+
TOGGLE = "toggle",
|
72
|
+
FAVORITE = "favorite",
|
73
|
+
ROW_ACTIONS = "row_actions",
|
74
|
+
SETTINGS = "settings"
|
75
|
+
}
|
76
|
+
export declare type ActionColumnDef<T> = {
|
77
|
+
onActionChange?: (id: string) => void;
|
78
|
+
actionType: ActionType;
|
79
|
+
favorites?: string[];
|
80
|
+
toggles?: string[];
|
81
|
+
enableSorting?: boolean;
|
82
|
+
enableSettings?: boolean;
|
83
|
+
rowActions?: RowActions<T>;
|
84
|
+
settingsDropdownConfig?: SettingsDropdownConfig;
|
85
|
+
} & IdentifiedColumnDef<T, CellProps>;
|
86
|
+
export declare type AdditionalColumnDef = {
|
87
|
+
unitSymbol?: string;
|
88
|
+
minWidth?: number;
|
89
|
+
headerTooltip?: TooltipProps;
|
90
|
+
};
|
91
|
+
export declare type ColumnsType<T> = ({
|
92
|
+
columnDefType: ColumnDefType.ACCESSOR;
|
93
|
+
columnDef: AccessorColumnDef<T> & AdditionalColumnDef;
|
94
|
+
} & BaseColumnsType<T>) | ({
|
95
|
+
columnDefType: ColumnDefType.DISPLAY;
|
96
|
+
columnDef: DisplayColumnDef<T, unknown> & AdditionalColumnDef;
|
97
|
+
} & BaseColumnsType<T>) | ({
|
98
|
+
columnDefType: ColumnDefType.ACTION;
|
99
|
+
columnDef: ActionColumnDef<T> & AdditionalColumnDef;
|
100
|
+
} & BaseColumnsType<T>) | ({
|
101
|
+
columnDefType: ColumnDefType.GROUP;
|
102
|
+
columnDef: GroupColumnDef<T, unknown>;
|
103
|
+
} & BaseColumnsType<T>);
|
104
|
+
interface BaseColumnsType<T> {
|
105
|
+
key: keyof T | Lowercase<keyof typeof ActionType>;
|
106
|
+
}
|
107
|
+
interface CustomCellWithAvatar extends BasicCustomCell {
|
108
|
+
avatar?: AvatarProps;
|
109
|
+
leadingIcon?: never;
|
110
|
+
}
|
111
|
+
interface CustomCellWithIcon extends BasicCustomCell {
|
112
|
+
avatar?: never;
|
113
|
+
leadingIcon?: IconProps;
|
114
|
+
}
|
115
|
+
export interface BasicCustomCell {
|
116
|
+
unitSymbol?: string;
|
117
|
+
trailingMicroTag?: MicroTagProps;
|
118
|
+
headline?: boolean;
|
119
|
+
content?: string | number;
|
120
|
+
tag?: TagProps;
|
121
|
+
isFavorite?: boolean;
|
122
|
+
isToggled?: boolean;
|
123
|
+
}
|
124
|
+
export declare type CustomCellProps = CustomCellWithIcon | CustomCellWithAvatar;
|
125
|
+
export declare type CellProps = CustomCellProps | string | number;
|
126
|
+
export interface RowActions<T> {
|
127
|
+
headerTitle?: string | number;
|
128
|
+
primary?: PrimaryAction<T>;
|
129
|
+
dropdown?: DropdownAction<T>;
|
130
|
+
}
|
131
|
+
export interface RowAction<T> {
|
132
|
+
text: string;
|
133
|
+
icon?: IconProps;
|
134
|
+
type?: DropdownItemType;
|
135
|
+
onClick: (row: Row<T>) => void;
|
136
|
+
}
|
137
|
+
declare type BasicPrimaryAction<T> = {
|
138
|
+
tooltip?: TooltipProps;
|
139
|
+
onClick: (row: Row<T>) => void;
|
140
|
+
};
|
141
|
+
interface PrimaryTextAction<T> extends BasicPrimaryAction<T> {
|
142
|
+
text?: string | number;
|
143
|
+
icon?: never;
|
144
|
+
}
|
145
|
+
interface PrimaryIconAction<T> extends BasicPrimaryAction<T> {
|
146
|
+
text?: never;
|
147
|
+
icon?: IconProps;
|
148
|
+
}
|
149
|
+
export declare type PrimaryAction<T> = PrimaryTextAction<T> | PrimaryIconAction<T>;
|
150
|
+
export declare type DropdownAction<T> = {
|
151
|
+
items: RowAction<T>[];
|
152
|
+
tooltip?: TooltipProps;
|
153
|
+
};
|
154
|
+
export interface BulkAction<T> extends Omit<ButtonProps, 'onClick' | 'text'> {
|
155
|
+
onClick: (rows: T[]) => void;
|
156
|
+
text: string | JSX.Element;
|
157
|
+
}
|
158
|
+
export interface AllSelectedCTA {
|
159
|
+
description?: string;
|
160
|
+
onClick: () => void;
|
161
|
+
text: string;
|
162
|
+
}
|
163
|
+
export declare type OnSort<T> = (sortParams: {
|
164
|
+
sortBy: keyof T;
|
165
|
+
direction: false | SortDirection;
|
166
|
+
}) => void;
|
167
|
+
export declare type CustomSorted<T> = {
|
168
|
+
[key in keyof T]: false | SortDirection;
|
169
|
+
};
|
170
|
+
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 {};
|
@@ -10,7 +10,6 @@ import { PaginationProps } from './types';
|
|
10
10
|
* @param {number} currentPage Used to set the current page number
|
11
11
|
* @param {string} prevText Define previous label text
|
12
12
|
* @param {string} nextText Define next label text
|
13
|
-
* @param {PaginationType} color Used to set the theme of the component
|
14
13
|
*/
|
15
14
|
declare const Pagination: (props: PaginationProps) => JSX.Element;
|
16
15
|
export default Pagination;
|
@@ -1,7 +1,6 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { Meta, Story } from '@storybook/react';
|
3
2
|
import { PaginationProps } from './types';
|
4
3
|
export declare const Template: Story<PaginationProps>;
|
5
|
-
export declare const Normal:
|
4
|
+
export declare const Normal: Story<PaginationProps>;
|
6
5
|
declare const PaginationStories: Meta<PaginationProps>;
|
7
6
|
export default PaginationStories;
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { PaginationType } from './';
|
2
1
|
export declare const PaginationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
-
export declare const PaginationElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
4
|
-
|
5
|
-
}, never>;
|
2
|
+
export declare const PaginationElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const PaginationNumberElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const PaginationButtonElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -15,11 +15,21 @@ export declare type PaginationProps = {
|
|
15
15
|
currentPage: number;
|
16
16
|
prevText: string;
|
17
17
|
nextText: string;
|
18
|
-
color?: PaginationType;
|
19
18
|
};
|
19
|
+
declare type PaginationNumbersStatus = 'normal' | 'hover' | 'active';
|
20
|
+
declare type PaginationButtonsStatus = 'normal' | 'disabled';
|
20
21
|
export declare type PaginationPalette = {
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
numbers: {
|
23
|
+
[k in PaginationNumbersStatus]: {
|
24
|
+
backgroundColor: paletteColor;
|
25
|
+
color: paletteColor;
|
26
|
+
};
|
27
|
+
};
|
28
|
+
buttons: {
|
29
|
+
[k in PaginationButtonsStatus]: {
|
30
|
+
backgroundColor: paletteColor;
|
31
|
+
color: paletteColor;
|
32
|
+
};
|
24
33
|
};
|
25
34
|
};
|
35
|
+
export {};
|
File without changes
|
@@ -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;
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Row, UseTableInstanceProps } from 'react-table';
|
2
|
+
import { TableData } from '../types';
|
3
|
+
interface Props<T extends TableData> {
|
4
|
+
rows: Row<T>[];
|
5
|
+
prepareRow: UseTableInstanceProps<T>['prepareRow'];
|
6
|
+
selectedRowsIds: string[];
|
7
|
+
isLoading: boolean;
|
8
|
+
}
|
9
|
+
declare const TableBody: <T extends TableData>({ isLoading, rows, prepareRow, selectedRowsIds }: Props<T>) => JSX.Element;
|
10
|
+
export interface TableBodyTrProps {
|
11
|
+
isSelected?: boolean;
|
12
|
+
isDisabled?: boolean;
|
13
|
+
}
|
14
|
+
export default TableBody;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { HeaderGroup } from 'react-table';
|
2
|
+
import { TableData } from '../types';
|
3
|
+
interface Props<T extends TableData> {
|
4
|
+
headerGroups: HeaderGroup<T>[];
|
5
|
+
}
|
6
|
+
declare const TableHeader: <T extends TableData>({ headerGroups }: Props<T>) => JSX.Element;
|
7
|
+
export default TableHeader;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ColumnInstance } from 'react-table';
|
2
|
+
import { TableData } from '../../types';
|
3
|
+
interface Props<T extends TableData> {
|
4
|
+
allColumns: ColumnInstance<T>[];
|
5
|
+
}
|
6
|
+
declare const TableBodyLoader: <T extends TableData>({ allColumns }: Props<T>) => JSX.Element;
|
7
|
+
export default TableBodyLoader;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { TableBodyTrStyles } from '../../utils';
|
2
|
+
import { TableBodyTrProps } from '../TableBody';
|
3
|
+
export declare const TableBodyTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, import("../tableParts/styled").TrProps & TableBodyTrStyles & TableBodyTrProps, keyof TableBodyTrStyles>;
|
@@ -2,6 +2,8 @@ import React, { ReactNode } from 'react';
|
|
2
2
|
import { ToastPosition } from 'react-toastify/dist/types';
|
3
3
|
import { IconProps } from '../../icon';
|
4
4
|
export declare type toastType = 'standard' | 'error' | 'info' | 'warning' | 'success';
|
5
|
+
export declare type toastLibraryType = 'dark' | 'error' | 'info' | 'warning' | 'success';
|
6
|
+
export declare const typeMap: Record<toastType, toastLibraryType>;
|
5
7
|
export interface ToastProps {
|
6
8
|
type?: toastType;
|
7
9
|
content?: ReactNode;
|
@@ -11,7 +11,9 @@ export interface TooltipProps extends MessageProps {
|
|
11
11
|
onMouseLeave?: MouseEventHandler;
|
12
12
|
showAlways?: boolean;
|
13
13
|
hideAfterSeconds?: number;
|
14
|
+
showAfterSeconds?: number;
|
14
15
|
callbackAfterTimeout?: () => void;
|
16
|
+
onOpen?: (isOpen: boolean) => void;
|
15
17
|
}
|
16
|
-
declare const Tooltip: ({ message, placement, className, children, type, onMouseEnter, onMouseLeave, showAlways, hideAfterSeconds, callbackAfterTimeout, }: TooltipProps) => JSX.Element;
|
18
|
+
declare const Tooltip: ({ message, placement, className, children, type, onMouseEnter, onMouseLeave, showAlways, showAfterSeconds, hideAfterSeconds, callbackAfterTimeout, onOpen, }: TooltipProps) => JSX.Element;
|
17
19
|
export default Tooltip;
|
package/dist/index.d.ts
CHANGED
@@ -22,6 +22,7 @@ import { MicroTag, MicroTagPalette, MicroTagProps } from './components/microTag'
|
|
22
22
|
import { Modal, ModalSearchable, StepModal, StepModalBody, StepModalCommonProps, StepModalFooter, StepModalFooterProps, StepModalHeader, StepModalHeaderProps, StepModalProps } from './components/modals';
|
23
23
|
import { ConfirmationModal } from './components/modals/confirmationModal';
|
24
24
|
import { ModalBody } from './components/modals/modalStyled';
|
25
|
+
import { ColumnDefType, ColumnsType, NewTable, CellProps } from './components/newTable';
|
25
26
|
import { PageEmptySet } from './components/pageEmptySet';
|
26
27
|
import { Stepper, StepperPalette, StepperProps } from './components/stepper';
|
27
28
|
import { Column, ManualPagination, OnSelectionChange, OnSort, Row, RowActions, Table, TableData, TablePalette, TableProps, useTableValues } from './components/table';
|
@@ -45,4 +46,4 @@ export { Segment, SegmentButton, SegmentButtonPalette, SegmentButtonProps } from
|
|
45
46
|
export { ShortcutTip, ShortcutTipProps, Tip, TipPalette, TipProps, TipType } from './components/tip';
|
46
47
|
export { bwColor } from './styles/types';
|
47
48
|
export { Card, CardColor, CardPalette, CardProps, CardElevation, CardType } from './components/card';
|
48
|
-
export { autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, ButtonPalette, IconButton, IconButtonProps, IconButtonPalette, Icon, IconProps, IconPalette, iconColors, IconBackground, IconBackgroundPalette, Table, TableProps, TableData, useTableValues, Row, Column, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Checkbox, useCheckboxValue, CheckboxProps, CheckboxPalette, CheckboxStatus, Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, useSelectSimpleValue, isSimpleValue, simpleValue, CreatableSelectProps, useSelectValue, useSelectMultiValues, SelectPalette, SelectComponentsType, OptionType, PageEmptySet, Modal, ModalBody, ModalSearchable, StepModal, StepModalBody, StepModalCommonProps, StepModalFooter, StepModalFooterProps, StepModalHeader, StepModalHeaderProps, StepModalProps, Tooltip, TooltipProps, TooltipPalette, Accordion, Drawer, Radio, useRadioValue, RadioProps, RadioPalette, RadioStatus, RadioGroup, RadioGroupProps, RadioGroupOptions, InlineMessage, InlineMessageProps, InlineMessagePalette, InlineMessageType, Dropdown, DropdownItemProps, DropdownPalette, DropdownItemType, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, TabsItem, Stepper, StepperProps, StepperPalette, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, Toast, ToastProps, toastPalette, ToastPalette, ToastType, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, tagTypes, InputText, InputCode, InputTelephone, InputTextProps, InputCodeProps, InputTelephoneProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };
|
49
|
+
export { NewTable, ColumnsType, ColumnDefType, CellProps, autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, ButtonPalette, IconButton, IconButtonProps, IconButtonPalette, Icon, IconProps, IconPalette, iconColors, IconBackground, IconBackgroundPalette, Table, TableProps, TableData, useTableValues, Row, Column, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Checkbox, useCheckboxValue, CheckboxProps, CheckboxPalette, CheckboxStatus, Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, useSelectSimpleValue, isSimpleValue, simpleValue, CreatableSelectProps, useSelectValue, useSelectMultiValues, SelectPalette, SelectComponentsType, OptionType, PageEmptySet, Modal, ModalBody, ModalSearchable, StepModal, StepModalBody, StepModalCommonProps, StepModalFooter, StepModalFooterProps, StepModalHeader, StepModalHeaderProps, StepModalProps, Tooltip, TooltipProps, TooltipPalette, Accordion, Drawer, Radio, useRadioValue, RadioProps, RadioPalette, RadioStatus, RadioGroup, RadioGroupProps, RadioGroupOptions, InlineMessage, InlineMessageProps, InlineMessagePalette, InlineMessageType, Dropdown, DropdownItemProps, DropdownPalette, DropdownItemType, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, TabsItem, Stepper, StepperProps, StepperPalette, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, Toast, ToastProps, toastPalette, ToastPalette, ToastType, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, tagTypes, InputText, InputCode, InputTelephone, InputTextProps, InputCodeProps, InputTelephoneProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };
|