@fattureincloud/fic-design-system 0.6.0 → 0.6.2-temp-table
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/components/Spinner.d.ts +5 -1
- package/dist/components/banner/utils.d.ts +8 -0
- package/dist/components/buttons/button/styled.d.ts +1 -1
- package/dist/components/chips/chips.d.ts +7 -0
- package/dist/components/chips/chips.stories.d.ts +6 -0
- package/dist/components/chips/components/styledChipWrapper.d.ts +4 -0
- package/dist/components/chips/index.d.ts +2 -0
- package/dist/components/chips/types.d.ts +11 -0
- package/dist/components/dropdown/DropdownImpl.d.ts +1 -1
- package/dist/components/dropdown/types.d.ts +1 -0
- package/dist/components/floatingBadge/{FloatingBadge.d.ts → floatingBadge.d.ts} +0 -0
- package/dist/components/floatingBadge/{WithBadge.d.ts → withBadge.d.ts} +0 -0
- package/dist/components/form/checkbox/components/Input.d.ts +9 -0
- package/dist/components/form/checkbox/components/Label.d.ts +8 -0
- package/dist/components/form/datepicker/StyledDatePicker.d.ts +1 -0
- package/dist/components/form/datepicker/hooks/useDatePickerValues.d.ts +13 -0
- package/dist/components/form/inputText/InputCode.d.ts +4 -0
- package/dist/components/form/inputText/InputTelephone.d.ts +4 -0
- package/dist/components/form/inputText/InputText.d.ts +24 -2
- package/dist/components/form/inputText/components/styled.d.ts +6 -0
- package/dist/components/form/inputText/countriesTelephonePrefixes.d.ts +7 -0
- package/dist/components/form/inputText/hooks/useCodeInputHooks.d.ts +11 -0
- package/dist/components/form/inputText/index.d.ts +4 -2
- package/dist/components/form/inputText/inputText.stories.d.ts +5 -5
- package/dist/components/form/inputText/types.d.ts +3 -4
- package/dist/components/form/select/components/Placeholder.d.ts +4 -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/groupRadioButton/index.d.ts +23 -0
- package/dist/components/groupRadioButton/radio-group.stories.d.ts +6 -0
- package/dist/components/inlineMessages/components/styledInlineMessageWrapper.d.ts +8 -0
- package/dist/components/inlineMessages/index.d.ts +2 -0
- package/dist/components/inlineMessages/inlineMessages.d.ts +4 -0
- package/dist/components/inlineMessages/inlineMessages.stories.d.ts +7 -0
- package/dist/components/inlineMessages/types.d.ts +29 -0
- 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/paginationStyledWrapper.d.ts +1 -0
- package/dist/components/pagination/styled.d.ts +3 -4
- package/dist/components/pagination/types.d.ts +14 -4
- package/dist/components/progressbar/components/styledProgressbarWrapper.d.ts +2 -0
- package/dist/components/progressbar/{ProgressBar.d.ts → progressbar.d.ts} +0 -0
- package/dist/components/progressbar/{progressBar.stories.d.ts → progressbar.stories.d.ts} +0 -0
- package/dist/components/radioButton/components/label.d.ts +2 -0
- package/dist/components/radioButton/components/radio.d.ts +2 -0
- package/dist/components/radioButton/index.d.ts +2 -0
- package/dist/components/radioButton/radio.stories.d.ts +6 -0
- package/dist/components/radioButton/typings/radioButton.d.ts +21 -0
- package/dist/components/table/components/ActionsCell.d.ts +10 -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/tip/components/styledTip.d.ts +4 -0
- package/dist/components/tip/{ShortcutTip.d.ts → shortcutTip.d.ts} +0 -0
- package/dist/components/tip/{Tip.d.ts → tip.d.ts} +0 -0
- package/dist/components/toast/ToastContainer.d.ts +9 -0
- package/dist/components/toast/components/{ToastContent.d.ts → toastContent.d.ts} +0 -0
- package/dist/components/toast/{Toast.d.ts → toast.d.ts} +0 -0
- package/dist/components/toast/typings/toast.d.ts +34 -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/package.json +2 -1
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from '@tanstack/react-table';
|
3
|
+
import { TableProps } from '../../types';
|
4
|
+
interface BodyProps<T> extends Pick<TableProps<T>, 'rowSize'> {
|
5
|
+
rows: Row<T>[];
|
6
|
+
isLoading?: boolean;
|
7
|
+
}
|
8
|
+
declare const Body: <T>({ rows, rowSize, isLoading }: BodyProps<T>) => JSX.Element;
|
9
|
+
export default Body;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { AllSelectedCTA, BulkAction } from '../../types';
|
3
|
+
interface BulkBarProps<T> {
|
4
|
+
selectedRowData: T[];
|
5
|
+
bulkBarActions?: BulkAction<T>[];
|
6
|
+
allSelectedCTA?: AllSelectedCTA;
|
7
|
+
}
|
8
|
+
declare const BulkBar: <T>({ selectedRowData, bulkBarActions, allSelectedCTA }: BulkBarProps<T>) => JSX.Element;
|
9
|
+
export default BulkBar;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare const BulkBarWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
2
|
+
shown?: boolean | undefined;
|
3
|
+
allSelectedShown?: boolean | undefined;
|
4
|
+
}, never>;
|
5
|
+
export declare const BulkBarContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
6
|
+
export declare const AllSelectedCTAContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
7
|
+
shown?: boolean | undefined;
|
8
|
+
}, never>;
|
9
|
+
export declare const BulkActionsWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
10
|
+
export declare const SelectionCounter: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Cell as TCell, Row } from '@tanstack/react-table';
|
3
|
+
import { RowSize } from '../../types';
|
4
|
+
interface Props<T> {
|
5
|
+
cell: TCell<T, unknown>;
|
6
|
+
row: Row<T>;
|
7
|
+
hover?: boolean;
|
8
|
+
rowSize?: RowSize;
|
9
|
+
isLoading?: boolean;
|
10
|
+
}
|
11
|
+
declare const Cell: <T>({ cell, row, hover, rowSize, isLoading }: Props<T>) => JSX.Element;
|
12
|
+
export default Cell;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Column, Row } from '@tanstack/react-table';
|
3
|
+
import { ActionColumnDef, ActionType } from '../../../types';
|
4
|
+
interface Props<T> extends ActionColumnDef<T> {
|
5
|
+
row: Row<T>;
|
6
|
+
actionType: ActionType;
|
7
|
+
isFavorite?: boolean;
|
8
|
+
isToggled?: boolean;
|
9
|
+
column: Column<T, unknown>;
|
10
|
+
}
|
11
|
+
declare const CustomActionCell: <T>({ actionType, row, isFavorite, isToggled, onActionChange, rowActions, column, }: Props<T>) => JSX.Element;
|
12
|
+
export default CustomActionCell;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from '@tanstack/react-table';
|
3
|
+
import { RowAction } from '../../../types';
|
4
|
+
interface Props<T> {
|
5
|
+
row: Row<T>;
|
6
|
+
dropdown: RowAction<T>[];
|
7
|
+
onOpen?: (isOpen: boolean) => void;
|
8
|
+
}
|
9
|
+
declare const DropdownActionCell: <T>({ dropdown, row, onOpen }: Props<T>) => JSX.Element;
|
10
|
+
export default DropdownActionCell;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from '@tanstack/react-table';
|
3
|
+
import { PrimaryAction } from '../../../types';
|
4
|
+
interface Props<T> {
|
5
|
+
row: Row<T>;
|
6
|
+
primary: PrimaryAction<T>;
|
7
|
+
}
|
8
|
+
declare const PrimaryActionCell: <T>({ primary, row }: Props<T>) => JSX.Element;
|
9
|
+
export default PrimaryActionCell;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const ActionCell: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const TextBtn: import("styled-components").StyledComponent<({ className, color, fullWidth, href, iconLeft, iconRight, isDisabled, isLoading, onClick, size, target, text, type, }: import("../../../../buttons").ButtonProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const IconBtn: import("styled-components").StyledComponent<({ className, color, icon, isDisabled, onClick, type }: import("../../../../buttons").IconButtonProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { CellContext, Row } from '@tanstack/react-table';
|
3
|
+
import { AccessorColumnDef, ActionColumnDef, AdditionalColumnDef, CustomCellProps, RowSize } from '../../../types';
|
4
|
+
declare type Props<CellProps> = {
|
5
|
+
row: Row<CellProps>;
|
6
|
+
context: CellContext<CellProps, unknown>;
|
7
|
+
hover?: boolean;
|
8
|
+
rowSize?: RowSize;
|
9
|
+
} & CustomCellProps & AccessorColumnDef<CellProps> & ActionColumnDef<CellProps> & AdditionalColumnDef;
|
10
|
+
declare const CustomCell: <CellProps>({ content, isEditable, tag, unitSymbol, headline, leadingIcon, avatar, actionType, row, rowSize, onActionChange, isFavorite, isToggled, hover, onChange, trailingMicroTag, minWidth, rowActions, context, }: Props<CellProps>) => JSX.Element;
|
11
|
+
export default CustomCell;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from '@tanstack/react-table';
|
3
|
+
import { AccessorColumnDef, AdditionalColumnDef, CustomCellProps } from '../../../types';
|
4
|
+
declare type CustomInputProps<CellProps> = {
|
5
|
+
row: Row<CellProps>;
|
6
|
+
hover?: boolean;
|
7
|
+
} & CustomCellProps & Omit<AccessorColumnDef<CellProps>, 'isEditable'> & AdditionalColumnDef;
|
8
|
+
declare const CustomInput: <CellProps>({ hover, onChange, row, unitSymbol, content, }: CustomInputProps<CellProps>) => JSX.Element;
|
9
|
+
export default CustomInput;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row } from '@tanstack/react-table';
|
3
|
+
import { AccessorColumnDef, CustomCellProps } from '../../../types';
|
4
|
+
declare type TextAreaPopupProps<CellProps> = {
|
5
|
+
row: Row<CellProps>;
|
6
|
+
onBlur: () => void;
|
7
|
+
} & CustomCellProps & Omit<AccessorColumnDef<CellProps>, 'isEditable'>;
|
8
|
+
declare const TextAreaPopup: <CellProps>({ onChange, row, content, onBlur }: TextAreaPopupProps<CellProps>) => JSX.Element;
|
9
|
+
export default TextAreaPopup;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const TEXTAREA_HEIGHT = 100;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as CustomCell } from './CustomCell';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const InputsWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const TextAreaWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const IconsWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
5
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../../../../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {
|
6
|
+
confirm?: boolean | undefined;
|
7
|
+
}, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as useCellValues } from './useCellValues';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Cell as TCell, Row } from '@tanstack/react-table';
|
2
|
+
import { ActionType, CustomCellProps, RowActions } from '../../../types';
|
3
|
+
interface CellValues<T> {
|
4
|
+
isFavorite: boolean;
|
5
|
+
isToggled: boolean;
|
6
|
+
isEditable: boolean;
|
7
|
+
content?: string | number;
|
8
|
+
unitSymbol?: string;
|
9
|
+
actionType: ActionType;
|
10
|
+
values: CustomCellProps;
|
11
|
+
onActionChange?: (id: string) => void;
|
12
|
+
minWidth?: number;
|
13
|
+
rowActions?: RowActions<T>;
|
14
|
+
}
|
15
|
+
declare const useCellValues: <T>(cell: TCell<T, unknown>, row: Row<T>) => CellValues<T>;
|
16
|
+
export default useCellValues;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as LoadingCell } from './LoadingCell';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export declare const Td: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {}, never>;
|
2
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const LeadingIconContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const AvatarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
5
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
6
|
+
hasMeasureUnit?: boolean | undefined;
|
7
|
+
}, never>;
|
8
|
+
export declare const Content: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
9
|
+
hasMeasureUnit?: boolean | undefined;
|
10
|
+
headline?: boolean | undefined;
|
11
|
+
truncate?: boolean | undefined;
|
12
|
+
}, never>;
|
13
|
+
export declare const UnitContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
14
|
+
headline?: boolean | undefined;
|
15
|
+
}, never>;
|
16
|
+
export declare const MicroTagContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
17
|
+
export declare const InputTextWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
18
|
+
hasMeasureUnit?: boolean | undefined;
|
19
|
+
}, never>;
|
20
|
+
export declare const ContentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -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,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;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|