@bluemarble/bm-components 0.0.91 → 0.0.92
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/{index.d.ts → index.d.mts} +2 -3
- package/dist/index.mjs +4203 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +23 -14
- package/dist/esm/index.js +0 -15369
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/Autocomplete/index.d.ts +0 -27
- package/dist/esm/types/components/BaseGrid/Pagination/index.d.ts +0 -12
- package/dist/esm/types/components/BaseGrid/index.d.ts +0 -37
- package/dist/esm/types/components/BaseGrid/styles.d.ts +0 -26
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -19
- package/dist/esm/types/components/Dialog/index.d.ts +0 -16
- package/dist/esm/types/components/EditableGrid/GridCell.d.ts +0 -24
- package/dist/esm/types/components/EditableGrid/GridInput/index.d.ts +0 -16
- package/dist/esm/types/components/EditableGrid/GridInputAutocomplete/index.d.ts +0 -11
- package/dist/esm/types/components/EditableGrid/GridInputText/index.d.ts +0 -3
- package/dist/esm/types/components/EditableGrid/GridSelect/index.d.ts +0 -10
- package/dist/esm/types/components/EditableGrid/NewRow/index.d.ts +0 -13
- package/dist/esm/types/components/EditableGrid/index.d.ts +0 -52
- package/dist/esm/types/components/Grid/AutoCreatedRows.d.ts +0 -9
- package/dist/esm/types/components/Grid/EditableTableCell/DefaultInput.d.ts +0 -17
- package/dist/esm/types/components/Grid/EditableTableCell/InputMask.d.ts +0 -8
- package/dist/esm/types/components/Grid/EditableTableCell/index.d.ts +0 -24
- package/dist/esm/types/components/Grid/Filters.d.ts +0 -13
- package/dist/esm/types/components/Grid/Grid.d.ts +0 -33
- package/dist/esm/types/components/Grid/Header.d.ts +0 -11
- package/dist/esm/types/components/Grid/Td.d.ts +0 -3
- package/dist/esm/types/components/Grid/Tr.d.ts +0 -13
- package/dist/esm/types/components/Grid/index.d.ts +0 -6
- package/dist/esm/types/components/Grid/utils.d.ts +0 -5
- package/dist/esm/types/components/Input/index.d.ts +0 -12
- package/dist/esm/types/components/InputMask/index.d.ts +0 -14
- package/dist/esm/types/components/LargeButton/index.d.ts +0 -9
- package/dist/esm/types/components/Modal/index.d.ts +0 -8
- package/dist/esm/types/components/Radio/index.d.ts +0 -23
- package/dist/esm/types/components/Select/index.d.ts +0 -18
- package/dist/esm/types/components/Switch/index.d.ts +0 -19
- package/dist/esm/types/components/TabPanel/index.d.ts +0 -11
- package/dist/esm/types/components/hooks/useEditableGrid.d.ts +0 -23
- package/dist/esm/types/components/hooks/useEvent.d.ts +0 -1
- package/dist/esm/types/components/hooks/useFilter.d.ts +0 -17
- package/dist/esm/types/components/hooks/useGrid.d.ts +0 -30
- package/dist/esm/types/components/hooks/useLoading.d.ts +0 -4
- package/dist/esm/types/components/index.d.ts +0 -18
- package/dist/esm/types/components/utils/GetInputLabel.d.ts +0 -4
- package/dist/esm/types/components/utils/getObjectValue.d.ts +0 -1
- package/dist/esm/types/index.d.ts +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AutocompleteProps as MuiAutocompleteProps, AutocompleteRenderInputParams } from '@mui/material';
|
|
3
|
-
declare type MuiAutocompleteBaseProps<T> = Omit<MuiAutocompleteProps<T, boolean, undefined, boolean>, 'renderInput' | 'getOptionLabel'>;
|
|
4
|
-
interface AutocompleteWithoutProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
5
|
-
name?: never;
|
|
6
|
-
withFormik: false;
|
|
7
|
-
getOptionValue?: never;
|
|
8
|
-
label?: string;
|
|
9
|
-
getOptionLabel: (option: T) => string;
|
|
10
|
-
renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
|
|
11
|
-
}
|
|
12
|
-
interface AutocompleteWithFormikProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
13
|
-
name: string;
|
|
14
|
-
withFormik?: true;
|
|
15
|
-
label?: string;
|
|
16
|
-
option?: {
|
|
17
|
-
label?: keyof T;
|
|
18
|
-
value?: keyof T;
|
|
19
|
-
key?: string;
|
|
20
|
-
};
|
|
21
|
-
renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
|
|
22
|
-
getOptionLabel?: (option: T) => string;
|
|
23
|
-
getOptionValue?: (option: T) => string | number;
|
|
24
|
-
}
|
|
25
|
-
declare type AutocompleteProps<T> = AutocompleteWithoutProps<T> | AutocompleteWithFormikProps<T>;
|
|
26
|
-
export declare function Autocomplete<T>({ withFormik, name, getOptionValue, ...rest }: AutocompleteProps<T>): JSX.Element;
|
|
27
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type GridPaginationProps = {
|
|
3
|
-
dense: boolean;
|
|
4
|
-
currentPage: number;
|
|
5
|
-
totalNumberOfPages: number;
|
|
6
|
-
rowsPerPageOptions: number[];
|
|
7
|
-
rowsPerPage: number;
|
|
8
|
-
onPageChange: (prop: number) => void;
|
|
9
|
-
setRowsPerPage: (prop: number) => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const GridPagination: ({ currentPage, totalNumberOfPages, onPageChange, rowsPerPageOptions, setRowsPerPage, rowsPerPage, dense }: GridPaginationProps) => JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PaperProps, SxProps, TableBodyProps, TableHeadProps, TableProps } from '@mui/material';
|
|
3
|
-
export interface ColumnsProps {
|
|
4
|
-
label: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
width?: number;
|
|
7
|
-
sx?: SxProps;
|
|
8
|
-
canSort?: boolean;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
interface GridProps {
|
|
12
|
-
columns: ColumnsProps[];
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
prependColumn?: ReactNode;
|
|
15
|
-
appendColumn?: ReactNode;
|
|
16
|
-
fixedColumns?: boolean;
|
|
17
|
-
sortedBy: string;
|
|
18
|
-
sortedDirection: 'asc' | 'desc';
|
|
19
|
-
dense?: boolean;
|
|
20
|
-
onSortBy: (prop: string) => void;
|
|
21
|
-
paperProps?: PaperProps;
|
|
22
|
-
tableProps?: TableProps;
|
|
23
|
-
tableHeadProps?: TableHeadProps;
|
|
24
|
-
tableBodyProps?: TableBodyProps;
|
|
25
|
-
striped?: boolean;
|
|
26
|
-
bordered?: boolean;
|
|
27
|
-
currentPage: number;
|
|
28
|
-
totalNumberOfPages: number;
|
|
29
|
-
rowsPerPageOptions: number[];
|
|
30
|
-
rowsPerPage: number;
|
|
31
|
-
onPageChange: (pageNumber: number) => void;
|
|
32
|
-
setRowsPerPage: (rows: number) => void;
|
|
33
|
-
isLoading?: boolean;
|
|
34
|
-
hideFooter?: boolean;
|
|
35
|
-
}
|
|
36
|
-
export declare function BaseGrid({ columns, children, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions, hideFooter, prependColumn, appendColumn, isLoading }: GridProps): JSX.Element;
|
|
37
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare const styles: {
|
|
2
|
-
rowGap: (dense: boolean) => {
|
|
3
|
-
py: number;
|
|
4
|
-
};
|
|
5
|
-
bordered: (active: boolean) => {
|
|
6
|
-
'tr td:not(:last-child), tr th:not(:last-child)'?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
'tr td:not(:last-child), tr th:not(:last-child)': {
|
|
9
|
-
borderRight: string;
|
|
10
|
-
borderColor: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
striped: (active: boolean) => {
|
|
14
|
-
'tr:nth-of-type(even)'?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
'tr:nth-of-type(even)': {
|
|
17
|
-
transition: string;
|
|
18
|
-
bgcolor: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
lastRowBorder: (active: boolean) => {
|
|
22
|
-
'tbody tr:last-child td': {
|
|
23
|
-
borderBottomWidth: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CheckboxProps as MuiCheckboxProps, FormControlLabelProps } from '@mui/material';
|
|
3
|
-
declare type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
|
|
4
|
-
interface CheckboxWithFormik extends MuiCheckboxProps {
|
|
5
|
-
name: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
withFormik?: true;
|
|
8
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
9
|
-
}
|
|
10
|
-
interface CheckboxWithoutFormik extends MuiCheckboxProps {
|
|
11
|
-
name?: never;
|
|
12
|
-
label?: string;
|
|
13
|
-
withFormik: false;
|
|
14
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
15
|
-
}
|
|
16
|
-
export declare const Checkbox: ({ withFormik, name, ...props }: CheckboxProps) => JSX.Element;
|
|
17
|
-
export declare const BaseCheckbox: ({ label, FormControlLabelProps, ...props }: Omit<CheckboxWithoutFormik, 'withFormik'>) => JSX.Element;
|
|
18
|
-
export declare const FormikCheckbox: ({ label, name, FormControlLabelProps, ...props }: Omit<CheckboxWithFormik, 'withFormik'>) => JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DialogProps } from "@mui/material";
|
|
3
|
-
interface DialogOptionsProps {
|
|
4
|
-
label: string;
|
|
5
|
-
focus?: boolean;
|
|
6
|
-
cb(label: string): void;
|
|
7
|
-
}
|
|
8
|
-
interface DialogCustomProps extends DialogProps {
|
|
9
|
-
open: boolean;
|
|
10
|
-
title: string;
|
|
11
|
-
body: string;
|
|
12
|
-
options: DialogOptionsProps[];
|
|
13
|
-
loading: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare const Dialog: ({ open, title, loading, body, options, ...rest }: DialogCustomProps) => JSX.Element;
|
|
16
|
-
export { Dialog };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TableCellProps } from '@mui/material';
|
|
3
|
-
import { ColumnsProps } from '.';
|
|
4
|
-
interface GridCellProps {
|
|
5
|
-
focusedIndex: {
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
};
|
|
9
|
-
rowIndex: number;
|
|
10
|
-
columnIndex: number;
|
|
11
|
-
isEditing: boolean;
|
|
12
|
-
value: any;
|
|
13
|
-
bordered?: boolean;
|
|
14
|
-
onClick: () => void;
|
|
15
|
-
onDoubleClick: () => void;
|
|
16
|
-
onInputChange: (value: string) => void;
|
|
17
|
-
setCanSave: (value: boolean) => void;
|
|
18
|
-
canEditTable: boolean;
|
|
19
|
-
tableCellProps?: TableCellProps;
|
|
20
|
-
validationErrors?: string[];
|
|
21
|
-
column: ColumnsProps<any>;
|
|
22
|
-
}
|
|
23
|
-
export declare const GridCell: ({ value, focusedIndex, canEditTable, columnIndex, rowIndex, isEditing, onInputChange, bordered, onClick, onDoubleClick, setCanSave, tableCellProps, validationErrors, column }: GridCellProps) => JSX.Element;
|
|
24
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BaseTextFieldProps } from '@mui/material';
|
|
3
|
-
import { InputSelectCellProps } from '../GridSelect';
|
|
4
|
-
export interface GridInputProps extends BaseTextFieldProps {
|
|
5
|
-
onDefaultValue?: (value: string) => string;
|
|
6
|
-
}
|
|
7
|
-
export interface InputCellProps {
|
|
8
|
-
currentValue: string;
|
|
9
|
-
defaultValue?: string;
|
|
10
|
-
inputProps?: GridInputProps;
|
|
11
|
-
type?: GridInputProps['type'] | 'select';
|
|
12
|
-
select?: Omit<InputSelectCellProps, 'setCanSave' | 'onInputChange'>;
|
|
13
|
-
onInputChange: (value: string) => void;
|
|
14
|
-
setCanSave: (value: boolean) => void;
|
|
15
|
-
}
|
|
16
|
-
export declare const InputCell: (props: InputCellProps) => JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface InputAutocompleteCellProps {
|
|
3
|
-
options: any[];
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
setCanSave: (value: boolean) => void;
|
|
7
|
-
onInputChange: (value: string) => void;
|
|
8
|
-
currentValue?: string;
|
|
9
|
-
defaultValue?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const InputAutocompleteCell: ({ options, label, value, onInputChange, currentValue, defaultValue: ExternalDefaultValue }: InputAutocompleteCellProps) => JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface InputSelectCellProps {
|
|
3
|
-
options: any[];
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
setCanSave: (value: boolean) => void;
|
|
7
|
-
onInputChange: (value: string) => void;
|
|
8
|
-
currentValue?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const InputSelectCell: ({ options, label, value, setCanSave, onInputChange, currentValue }: InputSelectCellProps) => JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ColumnsProps } from '..';
|
|
3
|
-
interface NewRowProps {
|
|
4
|
-
columns: ColumnsProps<any>[];
|
|
5
|
-
hasCheckbox: boolean;
|
|
6
|
-
maxPositions: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
10
|
-
onSaveNewRow?: (prop: any) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const NewRow: ({ columns, hasCheckbox, maxPositions, onSaveNewRow }: NewRowProps) => JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TableCellProps } from '@mui/material';
|
|
3
|
-
import { GridInputProps } from './GridInput';
|
|
4
|
-
import { InputSelectCellProps } from './GridSelect';
|
|
5
|
-
export interface onSaveOptions<T> {
|
|
6
|
-
prop: keyof T;
|
|
7
|
-
newValue: string;
|
|
8
|
-
index: number;
|
|
9
|
-
}
|
|
10
|
-
export interface ColumnsProps<T> {
|
|
11
|
-
id?: string | number;
|
|
12
|
-
name: keyof T | '';
|
|
13
|
-
label: string;
|
|
14
|
-
visible?: boolean;
|
|
15
|
-
type?: GridInputProps['type'] | 'select' | 'autocomplete';
|
|
16
|
-
inputProps?: GridInputProps;
|
|
17
|
-
select?: Omit<InputSelectCellProps, 'setCanSave' | 'onInputChange'>;
|
|
18
|
-
formatLabelValue?: (value: string) => string;
|
|
19
|
-
required?: boolean;
|
|
20
|
-
TableCellProps?: TableCellProps;
|
|
21
|
-
newRow?: {
|
|
22
|
-
defaultValue?: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
interface EditableGridProps<T> {
|
|
26
|
-
columns: ColumnsProps<T>[];
|
|
27
|
-
data: Array<T>;
|
|
28
|
-
primaryKey: keyof T;
|
|
29
|
-
focusedIndex: {
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
};
|
|
33
|
-
isEditing: boolean;
|
|
34
|
-
bordered?: boolean;
|
|
35
|
-
onSave: (item: T, options: onSaveOptions<T>) => void;
|
|
36
|
-
setFocusedIndex: (props: {
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
}) => void;
|
|
40
|
-
setIsEditing: (value: boolean) => void;
|
|
41
|
-
canEditTable: boolean;
|
|
42
|
-
setCanEditTable: (value: boolean) => void;
|
|
43
|
-
selectedRows: number[];
|
|
44
|
-
setSelectedRows: (value: number[]) => void;
|
|
45
|
-
checkbox?: boolean;
|
|
46
|
-
checkMultiple?: boolean;
|
|
47
|
-
onSaveNewRow?: (newRow: T) => void;
|
|
48
|
-
canInsertNewRow: boolean;
|
|
49
|
-
setCanInsertNewRow: (value: boolean) => void;
|
|
50
|
-
}
|
|
51
|
-
export declare function EditableGrid<T extends Record<string, any>>({ columns, data, primaryKey, onSave, setFocusedIndex, setIsEditing, focusedIndex, isEditing, bordered, canEditTable, setCanEditTable, selectedRows, setSelectedRows, checkbox, checkMultiple, onSaveNewRow, canInsertNewRow }: EditableGridProps<T>): JSX.Element;
|
|
52
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ColumnTitleProps } from './Grid';
|
|
3
|
-
interface AutoCreatedRows {
|
|
4
|
-
columns: ColumnTitleProps[];
|
|
5
|
-
tableData: any[];
|
|
6
|
-
primaryKey: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const AutoCreatedRows: ({ tableData, columns, primaryKey }: AutoCreatedRows) => JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TextFieldProps } from '@mui/material';
|
|
3
|
-
import { OnSaveProps } from '.';
|
|
4
|
-
export interface DefaultInputProps {
|
|
5
|
-
name: string;
|
|
6
|
-
rowData: Record<string, any>;
|
|
7
|
-
isEditing: boolean;
|
|
8
|
-
fullWidth?: boolean;
|
|
9
|
-
TextFieldProps?: TextFieldProps;
|
|
10
|
-
type?: TextFieldProps['type'];
|
|
11
|
-
formatInputDefautvalue?: (value: string) => string;
|
|
12
|
-
setIsEditing(value: boolean): void;
|
|
13
|
-
onUpdateValue: (value: string) => void;
|
|
14
|
-
onSave: (props: OnSaveProps) => void;
|
|
15
|
-
handleCancelEditing: () => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const DefaultInput: (allProps: DefaultInputProps) => JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DefaultInputProps } from './DefaultInput';
|
|
3
|
-
import IMask from 'imask';
|
|
4
|
-
interface InputMaskProps extends Omit<DefaultInputProps, 'onUpdateValue'> {
|
|
5
|
-
mask: IMask.AnyMaskedOptions;
|
|
6
|
-
}
|
|
7
|
-
export declare const InputMask: (allProps: InputMaskProps) => JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TableCellProps, TextFieldProps } from '@mui/material';
|
|
3
|
-
interface EditableTableCellProps extends TableCellProps {
|
|
4
|
-
name: string;
|
|
5
|
-
TextFieldProps?: TextFieldProps;
|
|
6
|
-
type?: TextFieldProps['type'];
|
|
7
|
-
fullWidth?: boolean;
|
|
8
|
-
rowData?: Record<string, any>;
|
|
9
|
-
mask?: IMask.AnyMaskedOptions;
|
|
10
|
-
bordered?: boolean;
|
|
11
|
-
rowIndex?: string | number;
|
|
12
|
-
formatCellValue?: (value: string) => string;
|
|
13
|
-
formatInputDefautvalue?: (value: string) => string;
|
|
14
|
-
onSave?: (props: OnSaveProps) => void;
|
|
15
|
-
onCancel?: () => void;
|
|
16
|
-
}
|
|
17
|
-
export interface OnSaveProps {
|
|
18
|
-
name: string;
|
|
19
|
-
event: FocusEvent;
|
|
20
|
-
value: string;
|
|
21
|
-
data: Record<string, any>;
|
|
22
|
-
}
|
|
23
|
-
export declare const EditableTableCell: (allProps: EditableTableCellProps) => JSX.Element;
|
|
24
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FC, MutableRefObject, ReactNode } from 'react';
|
|
2
|
-
interface FiltersProps {
|
|
3
|
-
noFilters?: boolean;
|
|
4
|
-
selectedFilters: Record<string, any>[];
|
|
5
|
-
handleCloseFilter: (item: any) => void;
|
|
6
|
-
customButtons: ReactNode;
|
|
7
|
-
noFilterButtons?: boolean;
|
|
8
|
-
searchAnchorEl: MutableRefObject<HTMLElement | null>;
|
|
9
|
-
setOpenSearch: (value: boolean) => void;
|
|
10
|
-
setAnchorEl: (item: HTMLElement) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const FiltersBar: FC<FiltersProps>;
|
|
13
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import { TableCellProps } from '@mui/material';
|
|
3
|
-
export interface ColumnTitleProps {
|
|
4
|
-
name: string;
|
|
5
|
-
label: string;
|
|
6
|
-
transformer?: (value: string | number | Date) => string;
|
|
7
|
-
sx?: TableCellProps['sx'];
|
|
8
|
-
}
|
|
9
|
-
export interface FilterProps {
|
|
10
|
-
column: string;
|
|
11
|
-
value: string;
|
|
12
|
-
transformer?: (value: string | number | Date) => string;
|
|
13
|
-
}
|
|
14
|
-
export declare type IFilter = FilterProps;
|
|
15
|
-
export interface GridProps<T> {
|
|
16
|
-
columnTitles: ColumnTitleProps[];
|
|
17
|
-
defaultData: T[];
|
|
18
|
-
tableData: T[];
|
|
19
|
-
selectedFilters: FilterProps[];
|
|
20
|
-
setSelectedFilters(value: FilterProps[]): void;
|
|
21
|
-
setTableData(value: T[]): void;
|
|
22
|
-
updateFilters(value: Record<string, any>[]): void;
|
|
23
|
-
rowOptions?: number[];
|
|
24
|
-
footer?: ReactNode;
|
|
25
|
-
customButtons?: ReactNode;
|
|
26
|
-
isLoading?: boolean;
|
|
27
|
-
noFilterButtons?: boolean;
|
|
28
|
-
noPagination?: boolean;
|
|
29
|
-
noFilters?: boolean;
|
|
30
|
-
primaryKey?: string;
|
|
31
|
-
}
|
|
32
|
-
declare const Grid: <ObjectType>(props: React.PropsWithChildren<GridProps<ObjectType>>) => JSX.Element;
|
|
33
|
-
export default Grid;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ColumnTitleProps } from './Grid';
|
|
3
|
-
interface GridHeaderProps {
|
|
4
|
-
titles?: ColumnTitleProps[];
|
|
5
|
-
orderBy: string;
|
|
6
|
-
order: 'desc' | 'asc' | undefined;
|
|
7
|
-
setOrder(value: string | undefined): void;
|
|
8
|
-
setOrderBy(value: string): void;
|
|
9
|
-
}
|
|
10
|
-
export declare const GridHeader: ({ setOrder, setOrderBy, order, orderBy, titles }: GridHeaderProps) => JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableRowProps } from '@mui/material';
|
|
3
|
-
import { OnSaveProps } from './EditableTableCell';
|
|
4
|
-
interface CustomTableRowProps extends TableRowProps {
|
|
5
|
-
striped?: boolean;
|
|
6
|
-
bordered?: boolean;
|
|
7
|
-
index?: number;
|
|
8
|
-
rowData?: Record<string, any>;
|
|
9
|
-
onSave?: (props: OnSaveProps) => void;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare const Tr: React.MemoExoticComponent<(props: CustomTableRowProps) => JSX.Element>;
|
|
13
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { StandardTextFieldProps } from '@mui/material';
|
|
3
|
-
interface InputProps extends StandardTextFieldProps {
|
|
4
|
-
name: string;
|
|
5
|
-
label: string;
|
|
6
|
-
shrink?: boolean;
|
|
7
|
-
withFormik?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const Input: FC<InputProps>;
|
|
10
|
-
export declare const BaseInput: (props: InputProps) => JSX.Element;
|
|
11
|
-
export declare const FormikInput: FC<InputProps>;
|
|
12
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import IMask from 'imask';
|
|
3
|
-
import { StandardTextFieldProps } from '@mui/material';
|
|
4
|
-
interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
5
|
-
name: string;
|
|
6
|
-
label: string;
|
|
7
|
-
withFormik?: boolean;
|
|
8
|
-
value?: string;
|
|
9
|
-
mask: IMask.AnyMaskedOptions;
|
|
10
|
-
onChangeValue?: (value: string, unmaskedValue: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function InputMask({ withFormik, ...rest }: InputMaskProps): JSX.Element;
|
|
13
|
-
export declare function FormikInputMask({ mask, defaultValue, name, ...rest }: InputMaskProps): JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ButtonProps, CircularProgressProps } from '@mui/material';
|
|
3
|
-
interface LargeButtonProps extends ButtonProps {
|
|
4
|
-
loading?: boolean;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
CircularProgressProps?: CircularProgressProps;
|
|
7
|
-
}
|
|
8
|
-
export declare const LargeButton: ({ loading, children, CircularProgressProps, sx, ...rest }: LargeButtonProps) => JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ModalProps as MuiModalProps } from '@mui/material';
|
|
3
|
-
declare type ModalProps = {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
} & MuiModalProps;
|
|
7
|
-
export declare const Modal: ({ open, onClose, ...rest }: ModalProps) => JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { RadioGroupProps } from '@mui/material';
|
|
3
|
-
declare type RadioOptionProps = {
|
|
4
|
-
value: string | number | boolean;
|
|
5
|
-
label: string;
|
|
6
|
-
};
|
|
7
|
-
declare type RadioOptionsProps = RadioWithFormik | RadioWithoutFormik;
|
|
8
|
-
interface RadioWithFormik extends RadioGroupProps {
|
|
9
|
-
name: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
options: RadioOptionProps[];
|
|
12
|
-
withFormik?: true;
|
|
13
|
-
}
|
|
14
|
-
interface RadioWithoutFormik extends RadioGroupProps {
|
|
15
|
-
name?: never;
|
|
16
|
-
label?: string;
|
|
17
|
-
options: RadioOptionProps[];
|
|
18
|
-
withFormik: false;
|
|
19
|
-
}
|
|
20
|
-
export declare const Radio: ({ name, withFormik, ...rest }: RadioOptionsProps) => JSX.Element;
|
|
21
|
-
export declare const BaseRadio: ({ label, options, ...rest }: Omit<RadioWithoutFormik, 'withFormik'>) => JSX.Element;
|
|
22
|
-
export declare const FormikRadio: ({ label, name, options, ...rest }: Omit<RadioWithFormik, 'withFormik'>) => JSX.Element;
|
|
23
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { FormControlProps, InputLabelProps, SelectProps as MuiSelectProps } from '@mui/material';
|
|
3
|
-
interface CustomInputLabelProps extends InputLabelProps {
|
|
4
|
-
size?: 'small';
|
|
5
|
-
}
|
|
6
|
-
interface SelectProps extends MuiSelectProps {
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
defaultValue?: string;
|
|
10
|
-
withFormik?: boolean;
|
|
11
|
-
FormControlProps?: Partial<FormControlProps>;
|
|
12
|
-
InputLabelProps?: Partial<CustomInputLabelProps>;
|
|
13
|
-
helperText?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const Select: FC<SelectProps>;
|
|
16
|
-
export declare const BaseSelect: FC<SelectProps>;
|
|
17
|
-
export declare const FormikSelect: FC<SelectProps>;
|
|
18
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SwitchProps as MuiSwitchProps, FormControlLabelProps } from '@mui/material';
|
|
3
|
-
declare type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
|
|
4
|
-
interface SwitchWithFormik extends MuiSwitchProps {
|
|
5
|
-
name: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
withFormik?: true;
|
|
8
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
9
|
-
}
|
|
10
|
-
interface SwitchWithoutFormik extends MuiSwitchProps {
|
|
11
|
-
name?: never;
|
|
12
|
-
label?: string;
|
|
13
|
-
withFormik: false;
|
|
14
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
15
|
-
}
|
|
16
|
-
export declare const Switch: ({ withFormik, name, ...props }: SwitchProps) => JSX.Element;
|
|
17
|
-
export declare const BaseSwitch: ({ label, FormControlLabelProps, ...props }: Omit<SwitchWithoutFormik, 'withFormik'>) => JSX.Element;
|
|
18
|
-
export declare const FormikSwitch: ({ label, name, FormControlLabelProps, ...props }: Omit<SwitchWithFormik, 'withFormik'>) => JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare function getTabProps(index: string): {
|
|
3
|
-
id: string;
|
|
4
|
-
'aria-controls': string;
|
|
5
|
-
};
|
|
6
|
-
export interface TabPanelProps {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
value: number;
|
|
9
|
-
index: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const TabPanel: (props: TabPanelProps) => JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { onSaveOptions } from '../EditableGrid';
|
|
2
|
-
export declare type useEditableGridResponseProps<T> = {
|
|
3
|
-
data: Array<T>;
|
|
4
|
-
focusedIndex: {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
};
|
|
8
|
-
isEditing: boolean;
|
|
9
|
-
setData: (props: Array<T>) => void;
|
|
10
|
-
setIsEditing: (value: boolean) => void;
|
|
11
|
-
setFocusedIndex: (props: {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
}) => void;
|
|
15
|
-
onSave: (newItem: T, props: onSaveOptions<T>) => void;
|
|
16
|
-
canEditTable: boolean;
|
|
17
|
-
setCanEditTable: (value: boolean) => void;
|
|
18
|
-
selectedRows: number[];
|
|
19
|
-
setSelectedRows: (value: number[]) => void;
|
|
20
|
-
canInsertNewRow: boolean;
|
|
21
|
-
setCanInsertNewRow: (value: boolean) => void;
|
|
22
|
-
};
|
|
23
|
-
export declare function useEditableGrid<T>(): useEditableGridResponseProps<T>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useEvent(event: keyof WindowEventMap, handler: (ev: any) => void, passive?: boolean): void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'in' | 'notEqual' | 'notIn';
|
|
2
|
-
export declare type FilterProps = {
|
|
3
|
-
id?: string;
|
|
4
|
-
prop: string;
|
|
5
|
-
value: unknown;
|
|
6
|
-
compareType: FilterCompareType;
|
|
7
|
-
};
|
|
8
|
-
export declare function useFilter(): {
|
|
9
|
-
filters: FilterProps[];
|
|
10
|
-
filterBy: (newFilter: FilterProps) => void;
|
|
11
|
-
removeFilter: (prop: string, isId?: boolean) => void;
|
|
12
|
-
createFilter: typeof createFilter;
|
|
13
|
-
clearAllFilters: () => void;
|
|
14
|
-
};
|
|
15
|
-
export declare function createFilter<T extends Record<string, any>>(filters: FilterProps[]): {
|
|
16
|
-
apply: (item: T) => boolean;
|
|
17
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ColumnsProps } from '../BaseGrid';
|
|
2
|
-
import { FilterProps } from './useFilter';
|
|
3
|
-
interface SearchOptions {
|
|
4
|
-
caseSensitive?: boolean;
|
|
5
|
-
exact?: boolean;
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
interface UseGridProps {
|
|
9
|
-
columns: ColumnsProps[];
|
|
10
|
-
filters?: FilterProps[];
|
|
11
|
-
rowsPerPageOptions?: number[];
|
|
12
|
-
search?: SearchOptions;
|
|
13
|
-
}
|
|
14
|
-
export declare function useGrid<T extends Record<string, any>>({ columns, filters, search, rowsPerPageOptions }: UseGridProps): {
|
|
15
|
-
data: T[];
|
|
16
|
-
set: (data: T[]) => void;
|
|
17
|
-
onSortBy: (prop: string) => void;
|
|
18
|
-
sortedBy: string;
|
|
19
|
-
defaultData: T[];
|
|
20
|
-
sortedDirection: "desc" | "asc";
|
|
21
|
-
columns: ColumnsProps[];
|
|
22
|
-
currentPage: number;
|
|
23
|
-
totalNumberOfPages: number;
|
|
24
|
-
onPageChange: (pageNumber: number) => void;
|
|
25
|
-
setRowsPerPage: (rows: number) => void;
|
|
26
|
-
rowsPerPageOptions: number[];
|
|
27
|
-
rowsPerPage: number;
|
|
28
|
-
setSort: (prop: string, direction: 'desc' | 'asc') => void;
|
|
29
|
-
};
|
|
30
|
-
export {};
|