@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.
@@ -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;
@@ -0,0 +1,3 @@
1
+ export declare const isNumber: (n: number | string | undefined) => boolean;
2
+ export declare const parseDimension: (d: number | string) => string;
3
+ export declare const generateRandomId: () => string;
@@ -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,2 @@
1
+ export declare const DEFAULT_BODY_HEIGHT = 300;
2
+ export declare const DEFAULT_ROW_HEIGHT = 40;
@@ -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;