@fattureincloud/fic-design-system 0.6.6 → 0.7.1
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/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,14 @@
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
2
|
+
import { Row } from 'react-table';
|
3
|
+
import { TableData } from '../types';
|
4
|
+
interface Props {
|
5
|
+
initialFilter?: string;
|
6
|
+
}
|
7
|
+
interface ReturnType<DataType extends TableData> {
|
8
|
+
filter: string;
|
9
|
+
setFilter: Dispatch<SetStateAction<string>>;
|
10
|
+
selection: Row<DataType>[];
|
11
|
+
setSelection: Dispatch<SetStateAction<Row<DataType>[]>>;
|
12
|
+
}
|
13
|
+
declare const useTableValues: <DataType extends TableData>({ initialFilter }?: Props) => ReturnType<DataType>;
|
14
|
+
export default useTableValues;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Column, Row } from 'react-table';
|
2
|
+
import useTableValues from './hooks/useTableValues';
|
3
|
+
import Table from './Table';
|
4
|
+
import { TableProps } from './Table';
|
5
|
+
import tablePalette, { TablePalette } from './tablePalette';
|
6
|
+
import { ManualPagination, OnSelectionChange, OnSort, RowActions, TableData } from './types';
|
7
|
+
export { Table, TableProps, TableData, tablePalette, useTableValues, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Row, Column, };
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const rolesArray: readonly ["master", "admin", undefined];
|
3
|
+
export declare type roleType = typeof rolesArray[number];
|
4
|
+
interface Props {
|
5
|
+
role: roleType;
|
6
|
+
}
|
7
|
+
declare const Role: ({ role }: Props) => JSX.Element | null;
|
8
|
+
export default Role;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { roleType } from './Role';
|
2
|
+
export interface CustomPersonData {
|
3
|
+
img: string;
|
4
|
+
name: string;
|
5
|
+
role?: roleType;
|
6
|
+
}
|
7
|
+
export interface DataType {
|
8
|
+
person: CustomPersonData;
|
9
|
+
name: string;
|
10
|
+
address: string;
|
11
|
+
date: string;
|
12
|
+
order: number;
|
13
|
+
isDisabled?: boolean;
|
14
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
2
|
+
import { DataType } from './stories/components/types';
|
3
|
+
import { TableProps } from './Table';
|
4
|
+
export declare const Template: Story<TableProps<DataType>>;
|
5
|
+
declare const TableStories: Meta<TableProps<DataType>>;
|
6
|
+
export default TableStories;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { colorsPalette } from '../../common/types/colorsPalette';
|
2
|
+
import { ButtonProps, IconButtonProps } from '../buttons';
|
3
|
+
import { DropdownItemType } from '../dropdown';
|
4
|
+
declare type TableHeaderPalette = colorsPalette;
|
5
|
+
declare type rowStatus = 'normal' | 'hover' | 'selected' | 'disabled';
|
6
|
+
declare type TableRowsPalette = {
|
7
|
+
[k in rowStatus]: colorsPalette;
|
8
|
+
};
|
9
|
+
interface SelectedRowsCountPalette extends colorsPalette {
|
10
|
+
resetButtonColor: ButtonProps['color'];
|
11
|
+
}
|
12
|
+
declare type paginationItemStatus = 'normal' | 'hover' | 'active';
|
13
|
+
declare type PaginationPalette = {
|
14
|
+
numbers: {
|
15
|
+
[k in paginationItemStatus]: colorsPalette;
|
16
|
+
};
|
17
|
+
buttons: ButtonProps['color'];
|
18
|
+
};
|
19
|
+
declare type ActionsPalette = {
|
20
|
+
colors: {
|
21
|
+
[k in DropdownItemType]: ButtonProps['color'];
|
22
|
+
};
|
23
|
+
dropdownTriggerColor: IconButtonProps['color'];
|
24
|
+
};
|
25
|
+
export interface TablePalette {
|
26
|
+
header: TableHeaderPalette;
|
27
|
+
rows: TableRowsPalette;
|
28
|
+
selectedRowsCount: SelectedRowsCountPalette;
|
29
|
+
actions: ActionsPalette;
|
30
|
+
pagination: PaginationPalette;
|
31
|
+
}
|
32
|
+
declare const tablePalette: TablePalette;
|
33
|
+
export default tablePalette;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Row, SortingRule } from 'react-table';
|
2
|
+
import { DropdownItemType } from '../dropdown';
|
3
|
+
import { IconProps } from '../icon';
|
4
|
+
export interface TableData {
|
5
|
+
isDisabled?: boolean;
|
6
|
+
}
|
7
|
+
export interface CustomColumn {
|
8
|
+
align?: 'left' | 'center' | 'right';
|
9
|
+
}
|
10
|
+
export interface RowActions<T extends TableData> {
|
11
|
+
primary?: RowAction<T>;
|
12
|
+
dropdown?: RowAction<T>[];
|
13
|
+
}
|
14
|
+
export interface RowAction<T extends TableData> {
|
15
|
+
icon?: IconProps;
|
16
|
+
type?: DropdownItemType;
|
17
|
+
text: string;
|
18
|
+
onClick: (row: Row<T>) => void;
|
19
|
+
isDisabled?: boolean;
|
20
|
+
}
|
21
|
+
interface ManualPaginationConfig {
|
22
|
+
pageCount: number;
|
23
|
+
setCurrentPage: (page: number) => void;
|
24
|
+
}
|
25
|
+
export declare type ManualPagination = ManualPaginationConfig | undefined;
|
26
|
+
export declare type OnSort<T extends TableData> = (sortBy: Array<SortingRule<T>>) => void;
|
27
|
+
export declare type OnSelectionChange<T extends TableData> = (rows: Row<T>[], addedRows: Row<T>[], removedRows: Row<T>[]) => void;
|
28
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Row, TableData } from 'index';
|
2
|
+
import { DefaultTheme } from 'styled-components';
|
3
|
+
import { paletteColor } from '../../styles/types';
|
4
|
+
import { TableBodyTrProps } from './components/tableBody/TableBodyTr';
|
5
|
+
interface GetTableBodyTrStylesParams extends TableBodyTrProps {
|
6
|
+
theme: DefaultTheme;
|
7
|
+
}
|
8
|
+
export interface TableBodyTrStyles {
|
9
|
+
background: paletteColor;
|
10
|
+
color: paletteColor;
|
11
|
+
hoverColor: paletteColor;
|
12
|
+
hoverBackground: paletteColor;
|
13
|
+
}
|
14
|
+
export declare const getTableBodyTrStyles: ({ theme, isDisabled, isSelected, }: GetTableBodyTrStylesParams) => TableBodyTrStyles;
|
15
|
+
export declare const getIdsFromRows: <T extends TableData>(rows: Row<T>[] | undefined) => string[];
|
16
|
+
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 {};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Row, UseTableOptions } from 'react-table';
|
3
|
+
import { EmptyTablePageProps } from './components/EmptyState';
|
4
|
+
import { ManualPagination, OnSelectionChange, OnSort, RowActions, TableData } from './types';
|
5
|
+
export interface TableProps<T extends TableData> extends UseTableOptions<T> {
|
6
|
+
sortable?: boolean;
|
7
|
+
onSort?: OnSort<T>;
|
8
|
+
noPagination?: boolean;
|
9
|
+
manualPagination?: ManualPagination;
|
10
|
+
onScroll?: () => void;
|
11
|
+
pageSize?: number;
|
12
|
+
selectableRows?: boolean;
|
13
|
+
preSelectAllRows?: boolean;
|
14
|
+
onSelectionChange?: OnSelectionChange<T>;
|
15
|
+
onRowClick?: (row: Row<T>) => void;
|
16
|
+
globalFilter?: string;
|
17
|
+
hideHeader?: boolean;
|
18
|
+
EmptyPage?: EmptyTablePageProps['EmptyPage'];
|
19
|
+
Footer?: JSX.Element;
|
20
|
+
withCheckbox?: boolean;
|
21
|
+
isLoading?: boolean;
|
22
|
+
actions?: RowActions<T>;
|
23
|
+
renderActions?: () => JSX.Element;
|
24
|
+
actionsHeader?: string | JSX.Element;
|
25
|
+
bodyHeight?: number | string;
|
26
|
+
headerHeight?: number | string;
|
27
|
+
rowHeight?: number | string;
|
28
|
+
disableArrowNavigation?: boolean;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Component Props:
|
32
|
+
* @param {boolean} sortable Makes all columns sortable, sort can be disabled for a single column inside columns definition
|
33
|
+
* @param {function} onSort Callback called on column sort change
|
34
|
+
* @param {boolean} noPagination Hide table paginator and disabled pagination
|
35
|
+
* @param {number} pageSize Define the page size to use in every page
|
36
|
+
* @param {object} manualPagination If you want to manage the pagination by yourself
|
37
|
+
* @param {function} onScroll If pagination is disabled, this callback is called when user scroll to the bottom of the table
|
38
|
+
* @param {boolean} selectableRows Allow to select rows
|
39
|
+
* @param {boolean} preSelectAllRows Pre-select all rows
|
40
|
+
* @param {function} onSelectionChange Callback called when rows selection changes
|
41
|
+
* @param {function} onRowClick Callback called on row click
|
42
|
+
* @param {string} globalFilter Filter all columns by value
|
43
|
+
* @param {boolean} hideHeader Hide the table header
|
44
|
+
* @param {object} EmptyPage Configuration to show a custom component when table has no rows
|
45
|
+
* @param {JSX.Element} Footer Custom footer component
|
46
|
+
* @param {boolean} withCheckbox Show a column with checkboxes on left side of the table
|
47
|
+
* @param {boolean} isLoading Apply loading style to all cells
|
48
|
+
* @param {object} actions Configuration to render actions column
|
49
|
+
* @param {function} renderActions Used to customize actions column
|
50
|
+
* @param {string | JSX.Element} actionsHeader Used to customize actions header
|
51
|
+
* @param {number|string} bodyHeight Set tbody height, default 300px
|
52
|
+
* @param {number|string} headerHeight Set thead and th height, default 40px
|
53
|
+
* @param {number|string} rowHeight Set row height, default 40px
|
54
|
+
* @param {boolean} disableArrowNavigation Used to turn off Up/Down row selection and Enter click
|
55
|
+
*/
|
56
|
+
declare const Table: <T extends TableData>({ actions, bodyHeight, columns, data, EmptyPage, Footer, globalFilter: externalGlobalFilter, headerHeight, hideHeader, isLoading, manualPagination, noPagination, onRowClick, onScroll, onSelectionChange, onSort, preSelectAllRows, renderActions, actionsHeader, rowHeight, selectableRows, sortable, withCheckbox, pageSize, disableArrowNavigation, }: TableProps<T>) => JSX.Element;
|
57
|
+
export default Table;
|
@@ -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,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { UsePaginationInstanceProps } from 'react-table';
|
3
|
+
import { TableData } from '../types';
|
4
|
+
interface Props<T extends TableData> extends Omit<UsePaginationInstanceProps<T>, 'page' | 'pageOptions' | 'setPageSize'> {
|
5
|
+
pageIndex: number;
|
6
|
+
}
|
7
|
+
declare const Pagination: <T extends TableData>({ canPreviousPage, nextPage, previousPage, canNextPage, gotoPage, pageCount, pageIndex, }: Props<T>) => JSX.Element;
|
8
|
+
export default Pagination;
|
@@ -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,9 +22,10 @@ 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 { BulkAction, CellProps, ColumnDefType, ColumnsType, NewTable, RowAction, RowActions as NewRowActions } from './components/newTable';
|
26
|
+
import { Column, ManualPagination, OnSelectionChange, OnSort, Row, RowActions, Table, TableData, TablePalette, TableProps, useTableValues } from './components/oldTable';
|
25
27
|
import { PageEmptySet } from './components/pageEmptySet';
|
26
28
|
import { Stepper, StepperPalette, StepperProps } from './components/stepper';
|
27
|
-
import { Column, ManualPagination, OnSelectionChange, OnSort, Row, RowActions, Table, TableData, TablePalette, TableProps, useTableValues } from './components/table';
|
28
29
|
import { DropdownTabs, ScrollableTabs, TabsItem } from './components/tabs';
|
29
30
|
import { Tag, TagPalette, TagProps, tagTypes } from './components/tag';
|
30
31
|
import { ThemeProvider } from './components/themeProvider';
|
@@ -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,
|
49
|
+
export { NewTable, Table, ColumnsType, ColumnDefType, CellProps, BulkAction, NewRowActions, RowAction, autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, ButtonPalette, IconButton, IconButtonProps, IconButtonPalette, Icon, IconProps, IconPalette, iconColors, IconBackground, IconBackgroundPalette, 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, };
|