@fattureincloud/fic-design-system 0.4.17 → 0.4.18
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/types.d.ts +2 -0
- package/dist/components/table/constants.d.ts +2 -0
- package/dist/components/table/hooks/useRowsSelection.d.ts +4 -0
- package/dist/index.esm.js +4 -4
- 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;
|
@@ -19,6 +19,8 @@ export declare type DropdownProps = {
|
|
19
19
|
placement?: Placement;
|
20
20
|
minWidthAsTrigger?: boolean;
|
21
21
|
forceOpen?: boolean;
|
22
|
+
isSmall?: boolean;
|
23
|
+
maxHeight?: number;
|
22
24
|
};
|
23
25
|
export declare type DropdownItemType = 'default' | 'danger' | 'success' | 'warning' | 'link';
|
24
26
|
export interface DropdownItemProps {
|
@@ -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;
|