@fattureincloud/fic-design-system 0.4.17 → 0.4.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/common/hooks/useUpDownKeyNavigation.d.ts +13 -0
- package/dist/common/utils/dsUtils.d.ts +3 -0
- package/dist/components/dropdown/DropdownImpl.d.ts +1 -1
- package/dist/components/dropdown/components/DefaultDropdown.d.ts +7 -2
- package/dist/components/dropdown/components/Item.d.ts +5 -3
- package/dist/components/dropdown/types.d.ts +4 -0
- package/dist/components/dropdown/utils.d.ts +1 -2
- package/dist/components/table/Table.d.ts +6 -4
- package/dist/components/table/components/tableBody/TableBody.d.ts +6 -2
- package/dist/components/table/components/tableBody/TableBodyTr.d.ts +1 -0
- package/dist/components/table/components/tableParts/styled.d.ts +1 -1
- package/dist/components/table/constants.d.ts +2 -0
- package/dist/components/table/hooks/useRowsSelection.d.ts +4 -0
- package/dist/components/table/utils.d.ts +0 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
2
|
+
declare type Callback = (index: number) => void;
|
3
|
+
declare type ReturnType = [number, Dispatch<SetStateAction<number>>, boolean];
|
4
|
+
/**
|
5
|
+
* Manage the Up and Down key to scroll through lists/table rows/dropdown options
|
6
|
+
*
|
7
|
+
* @param selector A pattern used to select a single element and put the focus on it, must contain ":id"
|
8
|
+
* @param onClick Called when the user press enter and an index is selected
|
9
|
+
* @param maxIndex Max number of selectable items
|
10
|
+
* @param initialIndex Starting index, default -1 meaning that nothing is selected (can be 0 to preselected the first item)
|
11
|
+
*/
|
12
|
+
declare const useUpDownKeyNavigation: (containerSelector: string, rowSelector: string, isDisabled: boolean, onClick: Callback, maxIndex: number, initialIndex?: number) => ReturnType;
|
13
|
+
export default useUpDownKeyNavigation;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { DropdownProps } from './types';
|
2
|
-
declare const DropdownImpl: (
|
2
|
+
declare const DropdownImpl: ({ className, content, fullWidth, maxWidth, minWidthAsTrigger, placement, renderContent, renderTrigger, triggerStyles, title, forceOpen, disableArrowNavigation, maxHeight, isSmall, }: DropdownProps) => JSX.Element;
|
3
3
|
export default DropdownImpl;
|
@@ -1,9 +1,14 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import { DropdownItemProps, DropdownProps } from '../types';
|
2
3
|
interface Props {
|
4
|
+
closeDropdown: () => void;
|
5
|
+
componentId: string;
|
3
6
|
content: DropdownItemProps[];
|
7
|
+
disableArrowNavigation: boolean;
|
4
8
|
fullWidth: DropdownProps['fullWidth'];
|
5
9
|
maxWidth: DropdownProps['maxWidth'];
|
6
|
-
|
10
|
+
rowHasFocus: boolean;
|
11
|
+
setHighlightedItem: React.Dispatch<React.SetStateAction<number>>;
|
7
12
|
}
|
8
|
-
declare const DefaultDropdown: ({ closeDropdown, content, fullWidth, maxWidth }: Props) => JSX.Element;
|
13
|
+
declare const DefaultDropdown: ({ closeDropdown, componentId, content, fullWidth, maxWidth, rowHasFocus, setHighlightedItem, }: Props) => JSX.Element;
|
9
14
|
export default DefaultDropdown;
|
@@ -1,9 +1,11 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { DropdownItemProps } from '../types';
|
3
2
|
import { DropdownItemStyles } from '../utils';
|
4
|
-
declare const Item: ({ active, className, icon, onClick, shortcut, text,
|
3
|
+
declare const Item: ({ active, className, componentId, icon, isDisabled, onClick, rowHasFocus, shortcut, text, ...rest }: DropdownItemProps & {
|
4
|
+
componentId?: string | undefined;
|
5
|
+
rowHasFocus?: boolean | undefined;
|
6
|
+
}) => JSX.Element;
|
5
7
|
export interface StyledItemProps extends Pick<DropdownItemProps, 'fullWidth' | 'maxWidth' | 'active' | 'isDisabled' | 'type'> {
|
6
|
-
|
8
|
+
rowHasFocus: boolean;
|
7
9
|
}
|
8
10
|
export declare const StyledItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DropdownItemStyles & StyledItemProps, keyof DropdownItemStyles>;
|
9
11
|
export default Item;
|
@@ -19,6 +19,9 @@ export declare type DropdownProps = {
|
|
19
19
|
placement?: Placement;
|
20
20
|
minWidthAsTrigger?: boolean;
|
21
21
|
forceOpen?: boolean;
|
22
|
+
disableArrowNavigation?: boolean;
|
23
|
+
isSmall?: boolean;
|
24
|
+
maxHeight?: number;
|
22
25
|
};
|
23
26
|
export declare type DropdownItemType = 'default' | 'danger' | 'success' | 'warning' | 'link';
|
24
27
|
export interface DropdownItemProps {
|
@@ -33,6 +36,7 @@ export interface DropdownItemProps {
|
|
33
36
|
children?: React.ReactChild;
|
34
37
|
isDisabled?: boolean;
|
35
38
|
type?: DropdownItemType;
|
39
|
+
onMouseEnter?: () => void;
|
36
40
|
}
|
37
41
|
export interface UserListItemProps {
|
38
42
|
img?: string;
|
@@ -9,7 +9,6 @@ export interface DropdownItemStyles {
|
|
9
9
|
background: paletteColor;
|
10
10
|
color: paletteColor;
|
11
11
|
hoverBackground: paletteColor;
|
12
|
-
cursor: string;
|
13
12
|
}
|
14
|
-
export declare const getDropdownItemStyles: ({ theme, isDisabled, active,
|
13
|
+
export declare const getDropdownItemStyles: ({ theme, isDisabled, active, type, }: GetDropdownItemStylesParams) => DropdownItemStyles;
|
15
14
|
export {};
|
@@ -24,6 +24,7 @@ export interface TableProps<T extends TableData> extends UseTableOptions<T> {
|
|
24
24
|
bodyHeight?: number | string;
|
25
25
|
headerHeight?: number | string;
|
26
26
|
rowHeight?: number | string;
|
27
|
+
disableArrowNavigation?: boolean;
|
27
28
|
}
|
28
29
|
/**
|
29
30
|
* Component Props:
|
@@ -45,9 +46,10 @@ export interface TableProps<T extends TableData> extends UseTableOptions<T> {
|
|
45
46
|
* @param {boolean} isLoading Apply loading style to all cells
|
46
47
|
* @param {object} actions Configuration to render actions column
|
47
48
|
* @param {function} renderActions Used to customize actions column
|
48
|
-
* @param {number|string} bodyHeight Set tbody height, default 300px
|
49
|
-
* @param {number|string} headerHeight Set thead and th height, default 40px
|
50
|
-
* @param {number|string} rowHeight Set row height, default 40px
|
49
|
+
* @param {number|string} bodyHeight Set tbody height, default 300px
|
50
|
+
* @param {number|string} headerHeight Set thead and th height, default 40px
|
51
|
+
* @param {number|string} rowHeight Set row height, default 40px
|
52
|
+
* @param {boolean} disableArrowNavigation Used to turn off Up/Down row selection and Enter click
|
51
53
|
*/
|
52
|
-
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, rowHeight, selectableRows, sortable, withCheckbox, pageSize, }: TableProps<T>) => JSX.Element;
|
54
|
+
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, rowHeight, selectableRows, sortable, withCheckbox, pageSize, disableArrowNavigation, }: TableProps<T>) => JSX.Element;
|
53
55
|
export default Table;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import { Row, UseTableInstanceProps } from 'react-table';
|
2
3
|
import { TableData } from '../../types';
|
3
4
|
interface Props<T extends TableData> {
|
@@ -6,8 +7,11 @@ interface Props<T extends TableData> {
|
|
6
7
|
selectedRowsIds: string[];
|
7
8
|
isLoading: boolean;
|
8
9
|
onRowClick?: (row: Row<T>) => void;
|
9
|
-
|
10
|
+
rowHasFocus: boolean;
|
11
|
+
rowHeight: number | string;
|
10
12
|
selectableRows?: boolean;
|
13
|
+
setHighlightedRow: React.Dispatch<React.SetStateAction<number>>;
|
14
|
+
tableId: string;
|
11
15
|
}
|
12
|
-
declare const TableBody: <T extends TableData>({ isLoading, onRowClick, prepareRow, rowHeight, rows, selectableRows, selectedRowsIds, }: Props<T>) => JSX.Element;
|
16
|
+
declare const TableBody: <T extends TableData>({ isLoading, onRowClick, prepareRow, rowHasFocus, rowHeight, rows, selectableRows, selectedRowsIds, setHighlightedRow, tableId, }: Props<T>) => JSX.Element;
|
13
17
|
export default TableBody;
|
@@ -2,6 +2,7 @@ import { TableBodyTrStyles } from '../../utils';
|
|
2
2
|
export interface TableBodyTrProps {
|
3
3
|
isSelected?: boolean;
|
4
4
|
isDisabled?: boolean;
|
5
|
+
rowHasFocus: boolean;
|
5
6
|
}
|
6
7
|
declare const TableBodyTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, import("../tableParts/styled").TrProps & TableBodyTrStyles & TableBodyTrProps, keyof TableBodyTrStyles>;
|
7
8
|
export default TableBodyTr;
|
@@ -4,7 +4,7 @@ interface THeadProps {
|
|
4
4
|
}
|
5
5
|
export declare const THead: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, THeadProps, never>;
|
6
6
|
interface TableBodyProps {
|
7
|
-
bodyHeight
|
7
|
+
bodyHeight: number | string;
|
8
8
|
}
|
9
9
|
export declare const TBody: import("styled-components").StyledComponent<"tbody", import("styled-components").DefaultTheme, TableBodyProps, never>;
|
10
10
|
export interface TrProps {
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { Row } from 'react-table';
|
2
|
+
import { OnSelectionChange, TableData } from '../types';
|
3
|
+
declare const useRowsSelection: <T extends TableData>(selectedFlatRows: Row<T>[], preSelectAllRows: boolean, onSelectionChange: OnSelectionChange<T> | undefined, allRows: Row<T>[]) => string[];
|
4
|
+
export default useRowsSelection;
|
@@ -12,6 +12,5 @@ export interface TableBodyTrStyles {
|
|
12
12
|
hoverBackground: paletteColor;
|
13
13
|
}
|
14
14
|
export declare const getTableBodyTrStyles: ({ theme, isDisabled, isSelected, }: GetTableBodyTrStylesParams) => TableBodyTrStyles;
|
15
|
-
export declare const isNumber: (n: number | string | undefined) => boolean;
|
16
15
|
export declare const getIdsFromRows: <T extends TableData>(rows: Row<T>[] | undefined) => string[];
|
17
16
|
export {};
|
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import Spinner from 'common/components/Spinner';
|
1
2
|
import { Accordion } from './components/accordions';
|
2
3
|
import { Avatar } from './components/avatar';
|
3
4
|
import { Badge, BadgeProps } from './components/badge';
|
@@ -39,4 +40,4 @@ import { Tooltip, TooltipPalette, TooltipProps } from './components/tooltip';
|
|
39
40
|
import { autocompleteYellow } from './styles/defaultPalette/colors/others';
|
40
41
|
import { Theme } from './styles/theme';
|
41
42
|
import { Palette, paletteColor } from './styles/types';
|
42
|
-
export { autocompleteYellow, paletteColor, Avatar, Banner, BannerProps, Button, ButtonProps, IconButton, IconButtonProps, Icon, IconProps, IconPalette, 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, Tooltip, TooltipProps, TooltipPalette, Accordion, Progressbar, Drawer, Chip, RadioButton, RadioButtonGroup, InlineMessage, Badge, BadgeProps, Dropdown, DropdownItemProps, DropdownPalette, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, SidebarItem, sidebarItemHeight, SidebarItemPalette, SidebarItemProps, CustomSidebarItemProps, TabsItem, Stepper, StepperProps, StepperPalette, Tip, ShortcutTip, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, WithBadge, Pagination, Toast, ToastProps, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, InputText, InputTextProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, };
|
43
|
+
export { autocompleteYellow, paletteColor, Avatar, Banner, BannerProps, Button, ButtonProps, IconButton, IconButtonProps, Icon, IconProps, IconPalette, 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, Tooltip, TooltipProps, TooltipPalette, Accordion, Progressbar, Drawer, Chip, RadioButton, RadioButtonGroup, InlineMessage, Badge, BadgeProps, Dropdown, DropdownItemProps, DropdownPalette, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, SidebarItem, sidebarItemHeight, SidebarItemPalette, SidebarItemProps, CustomSidebarItemProps, TabsItem, Stepper, StepperProps, StepperPalette, Tip, ShortcutTip, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, WithBadge, Pagination, Toast, ToastProps, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, InputText, InputTextProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };
|