@bluemarble/bm-components 0.0.49 → 0.0.51
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/esm/index.js +132 -118
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Autocomplete/index.d.ts +3 -3
- package/dist/esm/types/components/BaseGrid/Pagination/index.d.ts +1 -1
- package/dist/esm/types/components/BaseGrid/index.d.ts +4 -4
- package/dist/esm/types/components/Checkbox/index.d.ts +3 -3
- package/dist/esm/types/components/Dialog/index.d.ts +16 -0
- package/dist/esm/types/components/EditableGrid/GridCell.d.ts +3 -3
- package/dist/esm/types/components/EditableGrid/GridInput/index.d.ts +4 -4
- package/dist/esm/types/components/EditableGrid/GridInputAutocomplete/index.d.ts +1 -1
- package/dist/esm/types/components/EditableGrid/GridInputText/index.d.ts +2 -2
- package/dist/esm/types/components/EditableGrid/GridSelect/index.d.ts +1 -1
- package/dist/esm/types/components/EditableGrid/NewRow/index.d.ts +2 -2
- package/dist/esm/types/components/EditableGrid/index.d.ts +7 -7
- package/dist/esm/types/components/Grid/AutoCreatedRows.d.ts +2 -2
- package/dist/esm/types/components/Grid/EditableTableCell/DefaultInput.d.ts +3 -3
- package/dist/esm/types/components/Grid/EditableTableCell/InputMask.d.ts +3 -3
- package/dist/esm/types/components/Grid/EditableTableCell/index.d.ts +2 -2
- package/dist/esm/types/components/Grid/Filters.d.ts +1 -1
- package/dist/esm/types/components/Grid/Grid.d.ts +3 -3
- package/dist/esm/types/components/Grid/Header.d.ts +3 -3
- package/dist/esm/types/components/Grid/Td.d.ts +2 -2
- package/dist/esm/types/components/Grid/Tr.d.ts +3 -3
- package/dist/esm/types/components/Grid/index.d.ts +6 -6
- package/dist/esm/types/components/Grid/utils.d.ts +1 -1
- package/dist/esm/types/components/Input/index.d.ts +2 -2
- package/dist/esm/types/components/InputMask/index.d.ts +2 -2
- package/dist/esm/types/components/LargeButton/index.d.ts +2 -2
- package/dist/esm/types/components/Modal/index.d.ts +1 -1
- package/dist/esm/types/components/Radio/index.d.ts +3 -3
- package/dist/esm/types/components/Select/index.d.ts +3 -3
- package/dist/esm/types/components/Switch/index.d.ts +3 -3
- package/dist/esm/types/components/TabPanel/index.d.ts +2 -2
- package/dist/esm/types/components/hooks/useEditableGrid.d.ts +1 -1
- package/dist/esm/types/components/hooks/useFilter.d.ts +1 -1
- package/dist/esm/types/components/hooks/useGrid.d.ts +3 -3
- package/dist/esm/types/components/index.d.ts +18 -17
- package/dist/esm/types/components/utils/GetInputLabel.d.ts +4 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/index.d.ts +29 -12
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { AutocompleteProps as MuiAutocompleteProps, AutocompleteRenderInputParams } from
|
|
3
|
-
declare type MuiAutocompleteBaseProps<T> = Omit<MuiAutocompleteProps<T, boolean, undefined, boolean>,
|
|
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
4
|
interface AutocompleteWithoutProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
5
5
|
name?: never;
|
|
6
6
|
withFormik: false;
|
|
@@ -8,5 +8,5 @@ declare type GridPaginationProps = {
|
|
|
8
8
|
onPageChange: (prop: number) => void;
|
|
9
9
|
setRowsPerPage: (prop: number) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare const GridPagination: ({ currentPage, totalNumberOfPages, onPageChange, rowsPerPageOptions, setRowsPerPage, rowsPerPage, dense
|
|
11
|
+
export declare const GridPagination: ({ currentPage, totalNumberOfPages, onPageChange, rowsPerPageOptions, setRowsPerPage, rowsPerPage, dense }: GridPaginationProps) => JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { PaperProps, SxProps, TableBodyProps, TableHeadProps, TableProps } from
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PaperProps, SxProps, TableBodyProps, TableHeadProps, TableProps } from '@mui/material';
|
|
3
3
|
export interface ColumnsProps {
|
|
4
4
|
label: string;
|
|
5
5
|
name?: string;
|
|
@@ -12,7 +12,7 @@ interface GridProps {
|
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
fixedColumns?: boolean;
|
|
14
14
|
sortedBy: string;
|
|
15
|
-
sortedDirection:
|
|
15
|
+
sortedDirection: 'asc' | 'desc';
|
|
16
16
|
dense?: boolean;
|
|
17
17
|
onSortBy: (prop: string) => void;
|
|
18
18
|
paperProps?: PaperProps;
|
|
@@ -28,5 +28,5 @@ interface GridProps {
|
|
|
28
28
|
onPageChange: (pageNumber: number) => void;
|
|
29
29
|
setRowsPerPage: (rows: number) => void;
|
|
30
30
|
}
|
|
31
|
-
export declare function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions
|
|
31
|
+
export declare function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions }: GridProps): JSX.Element;
|
|
32
32
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CheckboxProps as MuiCheckboxProps, FormControlLabelProps } from
|
|
2
|
+
import { CheckboxProps as MuiCheckboxProps, FormControlLabelProps } from '@mui/material';
|
|
3
3
|
declare type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
|
|
4
4
|
interface CheckboxWithFormik extends MuiCheckboxProps {
|
|
5
5
|
name: string;
|
|
@@ -14,6 +14,6 @@ interface CheckboxWithoutFormik extends MuiCheckboxProps {
|
|
|
14
14
|
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
15
15
|
}
|
|
16
16
|
export declare const Checkbox: ({ withFormik, name, ...props }: CheckboxProps) => JSX.Element;
|
|
17
|
-
export declare const BaseCheckbox: ({ label, FormControlLabelProps, ...props }: Omit<CheckboxWithoutFormik,
|
|
18
|
-
export declare const FormikCheckbox: ({ label, name, FormControlLabelProps, ...props }: Omit<CheckboxWithFormik,
|
|
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
19
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TableCellProps } from
|
|
3
|
-
import { ColumnsProps } from
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
3
|
+
import { ColumnsProps } from '.';
|
|
4
4
|
interface GridCellProps {
|
|
5
5
|
focusedIndex: {
|
|
6
6
|
x: number;
|
|
@@ -20,5 +20,5 @@ interface GridCellProps {
|
|
|
20
20
|
validationErrors?: string[];
|
|
21
21
|
column: ColumnsProps<any>;
|
|
22
22
|
}
|
|
23
|
-
export declare const GridCell: ({ value, focusedIndex, canEditTable, columnIndex, rowIndex, isEditing, onInputChange, bordered, onClick, onDoubleClick, setCanSave, tableCellProps, validationErrors, column
|
|
23
|
+
export declare const GridCell: ({ value, focusedIndex, canEditTable, columnIndex, rowIndex, isEditing, onInputChange, bordered, onClick, onDoubleClick, setCanSave, tableCellProps, validationErrors, column }: GridCellProps) => JSX.Element;
|
|
24
24
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseTextFieldProps } from
|
|
3
|
-
import { InputSelectCellProps } from
|
|
2
|
+
import { BaseTextFieldProps } from '@mui/material';
|
|
3
|
+
import { InputSelectCellProps } from '../GridSelect';
|
|
4
4
|
export interface GridInputProps extends BaseTextFieldProps {
|
|
5
5
|
onDefaultValue?: (value: string) => string;
|
|
6
6
|
}
|
|
@@ -8,8 +8,8 @@ export interface InputCellProps {
|
|
|
8
8
|
currentValue: string;
|
|
9
9
|
defaultValue?: string;
|
|
10
10
|
inputProps?: GridInputProps;
|
|
11
|
-
type?: GridInputProps[
|
|
12
|
-
select?: Omit<InputSelectCellProps,
|
|
11
|
+
type?: GridInputProps['type'] | 'select';
|
|
12
|
+
select?: Omit<InputSelectCellProps, 'setCanSave' | 'onInputChange'>;
|
|
13
13
|
onInputChange: (value: string) => void;
|
|
14
14
|
setCanSave: (value: boolean) => void;
|
|
15
15
|
}
|
|
@@ -8,4 +8,4 @@ export interface InputAutocompleteCellProps {
|
|
|
8
8
|
currentValue?: string;
|
|
9
9
|
defaultValue?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const InputAutocompleteCell: ({ options, label, value, onInputChange, currentValue, defaultValue: ExternalDefaultValue
|
|
11
|
+
export declare const InputAutocompleteCell: ({ options, label, value, onInputChange, currentValue, defaultValue: ExternalDefaultValue }: InputAutocompleteCellProps) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InputCellProps } from
|
|
3
|
-
export declare const InputTextCell: ({ defaultValue, currentValue, inputProps, onInputChange
|
|
2
|
+
import { InputCellProps } from '../GridInput';
|
|
3
|
+
export declare const InputTextCell: ({ defaultValue, currentValue, inputProps, onInputChange }: InputCellProps) => JSX.Element;
|
|
@@ -7,4 +7,4 @@ export interface InputSelectCellProps {
|
|
|
7
7
|
onInputChange: (value: string) => void;
|
|
8
8
|
currentValue?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const InputSelectCell: ({ options, label, value, setCanSave, onInputChange, currentValue
|
|
10
|
+
export declare const InputSelectCell: ({ options, label, value, setCanSave, onInputChange, currentValue }: InputSelectCellProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ColumnsProps } from
|
|
2
|
+
import { ColumnsProps } from '..';
|
|
3
3
|
interface NewRowProps {
|
|
4
4
|
columns: ColumnsProps<any>[];
|
|
5
5
|
hasCheckbox: boolean;
|
|
@@ -9,5 +9,5 @@ interface NewRowProps {
|
|
|
9
9
|
};
|
|
10
10
|
onSaveNewRow?: (prop: any) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare const NewRow: ({ columns, hasCheckbox, maxPositions, onSaveNewRow
|
|
12
|
+
export declare const NewRow: ({ columns, hasCheckbox, maxPositions, onSaveNewRow }: NewRowProps) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TableCellProps } from
|
|
3
|
-
import { GridInputProps } from
|
|
4
|
-
import { InputSelectCellProps } from
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
3
|
+
import { GridInputProps } from './GridInput';
|
|
4
|
+
import { InputSelectCellProps } from './GridSelect';
|
|
5
5
|
export interface onSaveOptions<T> {
|
|
6
6
|
prop: keyof T;
|
|
7
7
|
newValue: string;
|
|
@@ -9,12 +9,12 @@ export interface onSaveOptions<T> {
|
|
|
9
9
|
}
|
|
10
10
|
export interface ColumnsProps<T> {
|
|
11
11
|
id?: string | number;
|
|
12
|
-
name: keyof T |
|
|
12
|
+
name: keyof T | '';
|
|
13
13
|
label: string;
|
|
14
14
|
visible?: boolean;
|
|
15
|
-
type?: GridInputProps[
|
|
15
|
+
type?: GridInputProps['type'] | 'select' | 'autocomplete';
|
|
16
16
|
inputProps?: GridInputProps;
|
|
17
|
-
select?: Omit<InputSelectCellProps,
|
|
17
|
+
select?: Omit<InputSelectCellProps, 'setCanSave' | 'onInputChange'>;
|
|
18
18
|
formatLabelValue?: (value: string) => string;
|
|
19
19
|
required?: boolean;
|
|
20
20
|
TableCellProps?: TableCellProps;
|
|
@@ -48,5 +48,5 @@ interface EditableGridProps<T> {
|
|
|
48
48
|
canInsertNewRow: boolean;
|
|
49
49
|
setCanInsertNewRow: (value: boolean) => void;
|
|
50
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
|
|
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
52
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ColumnTitleProps } from
|
|
2
|
+
import { ColumnTitleProps } from './Grid';
|
|
3
3
|
interface AutoCreatedRows {
|
|
4
4
|
columns: ColumnTitleProps[];
|
|
5
5
|
tableData: any[];
|
|
6
6
|
primaryKey: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const AutoCreatedRows: ({ tableData, columns, primaryKey
|
|
8
|
+
export declare const AutoCreatedRows: ({ tableData, columns, primaryKey }: AutoCreatedRows) => JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TextFieldProps } from
|
|
3
|
-
import { OnSaveProps } from
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
import { OnSaveProps } from '.';
|
|
4
4
|
export interface DefaultInputProps {
|
|
5
5
|
name: string;
|
|
6
6
|
rowData: Record<string, any>;
|
|
7
7
|
isEditing: boolean;
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
TextFieldProps?: TextFieldProps;
|
|
10
|
-
type?: TextFieldProps[
|
|
10
|
+
type?: TextFieldProps['type'];
|
|
11
11
|
formatInputDefautvalue?: (value: string) => string;
|
|
12
12
|
setIsEditing(value: boolean): void;
|
|
13
13
|
onUpdateValue: (value: string) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DefaultInputProps } from
|
|
3
|
-
import IMask from
|
|
4
|
-
interface InputMaskProps extends Omit<DefaultInputProps,
|
|
2
|
+
import { DefaultInputProps } from './DefaultInput';
|
|
3
|
+
import IMask from 'imask';
|
|
4
|
+
interface InputMaskProps extends Omit<DefaultInputProps, 'onUpdateValue'> {
|
|
5
5
|
mask: IMask.AnyMaskedOptions;
|
|
6
6
|
}
|
|
7
7
|
export declare const InputMask: (allProps: InputMaskProps) => JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TableCellProps, TextFieldProps } from
|
|
2
|
+
import { TableCellProps, TextFieldProps } from '@mui/material';
|
|
3
3
|
interface EditableTableCellProps extends TableCellProps {
|
|
4
4
|
name: string;
|
|
5
5
|
TextFieldProps?: TextFieldProps;
|
|
6
|
-
type?: TextFieldProps[
|
|
6
|
+
type?: TextFieldProps['type'];
|
|
7
7
|
fullWidth?: boolean;
|
|
8
8
|
rowData?: Record<string, any>;
|
|
9
9
|
mask?: IMask.AnyMaskedOptions;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { PropsWithChildren, ReactNode } from
|
|
2
|
-
import { TableCellProps } from
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
3
3
|
export interface ColumnTitleProps {
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
|
6
6
|
transformer?: (value: string | number | Date) => string;
|
|
7
|
-
sx?: TableCellProps[
|
|
7
|
+
sx?: TableCellProps['sx'];
|
|
8
8
|
}
|
|
9
9
|
export interface FilterProps {
|
|
10
10
|
column: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ColumnTitleProps } from
|
|
2
|
+
import { ColumnTitleProps } from './Grid';
|
|
3
3
|
interface GridHeaderProps {
|
|
4
4
|
titles?: ColumnTitleProps[];
|
|
5
5
|
orderBy: string;
|
|
6
|
-
order:
|
|
6
|
+
order: 'desc' | 'asc' | undefined;
|
|
7
7
|
setOrder(value: string | undefined): void;
|
|
8
8
|
setOrderBy(value: string): void;
|
|
9
9
|
}
|
|
10
|
-
export declare const GridHeader: ({ setOrder, setOrderBy, order, orderBy, titles
|
|
10
|
+
export declare const GridHeader: ({ setOrder, setOrderBy, order, orderBy, titles }: GridHeaderProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { TableCellProps } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
3
3
|
export declare const Td: React.MemoExoticComponent<({ children, ...props }: TableCellProps) => JSX.Element>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { TableRowProps } from
|
|
3
|
-
import { OnSaveProps } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableRowProps } from '@mui/material';
|
|
3
|
+
import { OnSaveProps } from './EditableTableCell';
|
|
4
4
|
interface CustomTableRowProps extends TableRowProps {
|
|
5
5
|
striped?: boolean;
|
|
6
6
|
bordered?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default } from
|
|
2
|
-
export { ColumnTitleProps, IFilter, FilterProps } from
|
|
3
|
-
export { filterData } from
|
|
4
|
-
export { Tr } from
|
|
5
|
-
export { Td } from
|
|
6
|
-
export { EditableTableCell } from
|
|
1
|
+
export { default } from './Grid';
|
|
2
|
+
export { ColumnTitleProps, IFilter, FilterProps } from './Grid';
|
|
3
|
+
export { filterData } from './utils';
|
|
4
|
+
export { Tr } from './Tr';
|
|
5
|
+
export { Td } from './Td';
|
|
6
|
+
export { EditableTableCell } from './EditableTableCell';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import IMask from
|
|
3
|
-
import { StandardTextFieldProps } from
|
|
2
|
+
import IMask from 'imask';
|
|
3
|
+
import { StandardTextFieldProps } from '@mui/material';
|
|
4
4
|
interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
5
5
|
name: string;
|
|
6
6
|
label: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { ButtonProps, CircularProgressProps } from
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps, CircularProgressProps } from '@mui/material';
|
|
3
3
|
interface LargeButtonProps extends ButtonProps {
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
children: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { RadioGroupProps } from
|
|
2
|
+
import { RadioGroupProps } from '@mui/material';
|
|
3
3
|
declare type RadioOptionProps = {
|
|
4
4
|
value: string | number | boolean;
|
|
5
5
|
label: string;
|
|
@@ -18,6 +18,6 @@ interface RadioWithoutFormik extends RadioGroupProps {
|
|
|
18
18
|
withFormik: false;
|
|
19
19
|
}
|
|
20
20
|
export declare const Radio: ({ name, withFormik, ...rest }: RadioOptionsProps) => JSX.Element;
|
|
21
|
-
export declare const BaseRadio: ({ label, options, ...rest }: Omit<RadioWithoutFormik,
|
|
22
|
-
export declare const FormikRadio: ({ label, name, options, ...rest }: Omit<RadioWithFormik,
|
|
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
23
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FC } from
|
|
2
|
-
import { FormControlProps, InputLabelProps, SelectProps as MuiSelectProps } from
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormControlProps, InputLabelProps, SelectProps as MuiSelectProps } from '@mui/material';
|
|
3
3
|
interface CustomInputLabelProps extends InputLabelProps {
|
|
4
|
-
size?:
|
|
4
|
+
size?: 'small';
|
|
5
5
|
}
|
|
6
6
|
interface SelectProps extends MuiSelectProps {
|
|
7
7
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SwitchProps as MuiSwitchProps, FormControlLabelProps } from
|
|
2
|
+
import { SwitchProps as MuiSwitchProps, FormControlLabelProps } from '@mui/material';
|
|
3
3
|
declare type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
|
|
4
4
|
interface SwitchWithFormik extends MuiSwitchProps {
|
|
5
5
|
name: string;
|
|
@@ -14,6 +14,6 @@ interface SwitchWithoutFormik extends MuiSwitchProps {
|
|
|
14
14
|
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
15
15
|
}
|
|
16
16
|
export declare const Switch: ({ withFormik, name, ...props }: SwitchProps) => JSX.Element;
|
|
17
|
-
export declare const BaseSwitch: ({ label, FormControlLabelProps, ...props }: Omit<SwitchWithoutFormik,
|
|
18
|
-
export declare const FormikSwitch: ({ label, name, FormControlLabelProps, ...props }: Omit<SwitchWithFormik,
|
|
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
19
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ColumnsProps } from
|
|
2
|
-
import { FilterProps } from
|
|
1
|
+
import { ColumnsProps } from '../BaseGrid';
|
|
2
|
+
import { FilterProps } from './useFilter';
|
|
3
3
|
interface UseGridProps {
|
|
4
4
|
columns: ColumnsProps[];
|
|
5
5
|
filters?: FilterProps[];
|
|
6
6
|
rowsPerPageOptions?: number[];
|
|
7
7
|
}
|
|
8
|
-
export declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions
|
|
8
|
+
export declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
9
9
|
data: any[];
|
|
10
10
|
set: (data: T[]) => void;
|
|
11
11
|
onSortBy: (prop: string) => void;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export { default as Grid, IFilter, ColumnTitleProps, filterData, Tr, Td, EditableTableCell
|
|
2
|
-
export { Input } from
|
|
3
|
-
export { InputMask } from
|
|
4
|
-
export { Select } from
|
|
5
|
-
export { Autocomplete } from
|
|
6
|
-
export { Checkbox } from
|
|
7
|
-
export { Switch } from
|
|
8
|
-
export { Radio } from
|
|
9
|
-
export { LargeButton } from
|
|
10
|
-
export { TabPanel, getTabProps, TabPanelProps } from
|
|
11
|
-
export { ColumnsProps, BaseGrid } from
|
|
12
|
-
export { useGrid } from
|
|
13
|
-
export { FilterCompareType, FilterProps, createFilter, useFilter
|
|
14
|
-
export { useEvent } from
|
|
15
|
-
export { useLoading } from
|
|
16
|
-
export { Modal } from
|
|
17
|
-
export { GetInputLabel } from
|
|
1
|
+
export { default as Grid, IFilter, ColumnTitleProps, filterData, Tr, Td, EditableTableCell } from './Grid';
|
|
2
|
+
export { Input } from './Input';
|
|
3
|
+
export { InputMask } from './InputMask';
|
|
4
|
+
export { Select } from './Select';
|
|
5
|
+
export { Autocomplete } from './Autocomplete';
|
|
6
|
+
export { Checkbox } from './Checkbox';
|
|
7
|
+
export { Switch } from './Switch';
|
|
8
|
+
export { Radio } from './Radio';
|
|
9
|
+
export { LargeButton } from './LargeButton';
|
|
10
|
+
export { TabPanel, getTabProps, TabPanelProps } from './TabPanel';
|
|
11
|
+
export { ColumnsProps, BaseGrid } from './BaseGrid';
|
|
12
|
+
export { useGrid } from './hooks/useGrid';
|
|
13
|
+
export { FilterCompareType, FilterProps, createFilter, useFilter } from './hooks/useFilter';
|
|
14
|
+
export { useEvent } from './hooks/useEvent';
|
|
15
|
+
export { useLoading } from './hooks/useLoading';
|
|
16
|
+
export { Modal } from './Modal';
|
|
17
|
+
export { GetInputLabel } from './utils/GetInputLabel';
|
|
18
|
+
export { Dialog } from './Dialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './components';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React, { ReactNode, FC } from 'react';
|
|
3
|
-
import { TableCellProps, TextFieldProps, TableRowProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteRenderInputParams, AutocompleteProps as AutocompleteProps$1, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, SxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps as ModalProps$1 } from '@mui/material';
|
|
3
|
+
import { TableCellProps, TextFieldProps, TableRowProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteRenderInputParams, AutocompleteProps as AutocompleteProps$1, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, SxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps as ModalProps$1, DialogProps } from '@mui/material';
|
|
4
4
|
import IMask$1 from 'imask';
|
|
5
5
|
|
|
6
6
|
interface ColumnTitleProps {
|
|
7
7
|
name: string;
|
|
8
8
|
label: string;
|
|
9
9
|
transformer?: (value: string | number | Date) => string;
|
|
10
|
-
sx?: TableCellProps[
|
|
10
|
+
sx?: TableCellProps['sx'];
|
|
11
11
|
}
|
|
12
12
|
interface FilterProps$1 {
|
|
13
13
|
column: string;
|
|
@@ -41,7 +41,7 @@ declare function filterData<T>(filters: FilterProps$1[], defaultData: {
|
|
|
41
41
|
interface EditableTableCellProps extends TableCellProps {
|
|
42
42
|
name: string;
|
|
43
43
|
TextFieldProps?: TextFieldProps;
|
|
44
|
-
type?: TextFieldProps[
|
|
44
|
+
type?: TextFieldProps['type'];
|
|
45
45
|
fullWidth?: boolean;
|
|
46
46
|
rowData?: Record<string, any>;
|
|
47
47
|
mask?: IMask.AnyMaskedOptions;
|
|
@@ -90,7 +90,7 @@ interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
|
90
90
|
declare function InputMask({ withFormik, ...rest }: InputMaskProps): JSX.Element;
|
|
91
91
|
|
|
92
92
|
interface CustomInputLabelProps extends InputLabelProps {
|
|
93
|
-
size?:
|
|
93
|
+
size?: 'small';
|
|
94
94
|
}
|
|
95
95
|
interface SelectProps extends SelectProps$1 {
|
|
96
96
|
name: string;
|
|
@@ -102,7 +102,7 @@ interface SelectProps extends SelectProps$1 {
|
|
|
102
102
|
}
|
|
103
103
|
declare const Select: FC<SelectProps>;
|
|
104
104
|
|
|
105
|
-
declare type MuiAutocompleteBaseProps<T> = Omit<AutocompleteProps$1<T, boolean, undefined, boolean>,
|
|
105
|
+
declare type MuiAutocompleteBaseProps<T> = Omit<AutocompleteProps$1<T, boolean, undefined, boolean>, 'renderInput' | 'getOptionLabel'>;
|
|
106
106
|
interface AutocompleteWithoutProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
107
107
|
name?: never;
|
|
108
108
|
withFormik: false;
|
|
@@ -185,7 +185,7 @@ declare const LargeButton: ({ loading, children, CircularProgressProps, sx, ...r
|
|
|
185
185
|
|
|
186
186
|
declare function getTabProps(index: string): {
|
|
187
187
|
id: string;
|
|
188
|
-
|
|
188
|
+
'aria-controls': string;
|
|
189
189
|
};
|
|
190
190
|
interface TabPanelProps {
|
|
191
191
|
children: React.ReactNode;
|
|
@@ -206,7 +206,7 @@ interface GridProps {
|
|
|
206
206
|
children: ReactNode;
|
|
207
207
|
fixedColumns?: boolean;
|
|
208
208
|
sortedBy: string;
|
|
209
|
-
sortedDirection:
|
|
209
|
+
sortedDirection: 'asc' | 'desc';
|
|
210
210
|
dense?: boolean;
|
|
211
211
|
onSortBy: (prop: string) => void;
|
|
212
212
|
paperProps?: PaperProps;
|
|
@@ -222,9 +222,9 @@ interface GridProps {
|
|
|
222
222
|
onPageChange: (pageNumber: number) => void;
|
|
223
223
|
setRowsPerPage: (rows: number) => void;
|
|
224
224
|
}
|
|
225
|
-
declare function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions
|
|
225
|
+
declare function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions }: GridProps): JSX.Element;
|
|
226
226
|
|
|
227
|
-
declare type FilterCompareType =
|
|
227
|
+
declare type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'in';
|
|
228
228
|
declare type FilterProps = {
|
|
229
229
|
id?: string;
|
|
230
230
|
prop: string;
|
|
@@ -247,7 +247,7 @@ interface UseGridProps {
|
|
|
247
247
|
filters?: FilterProps[];
|
|
248
248
|
rowsPerPageOptions?: number[];
|
|
249
249
|
}
|
|
250
|
-
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions
|
|
250
|
+
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
251
251
|
data: any[];
|
|
252
252
|
set: (data: T[]) => void;
|
|
253
253
|
onSortBy: (prop: string) => void;
|
|
@@ -276,6 +276,23 @@ declare type ModalProps = {
|
|
|
276
276
|
} & ModalProps$1;
|
|
277
277
|
declare const Modal: ({ open, onClose, ...rest }: ModalProps) => JSX.Element;
|
|
278
278
|
|
|
279
|
-
declare function GetInputLabel<T, K extends T[number][
|
|
279
|
+
declare function GetInputLabel<T, K extends T[number]['name']>(columns: T): (columnName: K) => {
|
|
280
|
+
label: any;
|
|
281
|
+
name: any;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
interface DialogOptionsProps {
|
|
285
|
+
label: string;
|
|
286
|
+
focus?: boolean;
|
|
287
|
+
cb(label: string): void;
|
|
288
|
+
}
|
|
289
|
+
interface DialogCustomProps extends DialogProps {
|
|
290
|
+
open: boolean;
|
|
291
|
+
title: string;
|
|
292
|
+
body: string;
|
|
293
|
+
options: DialogOptionsProps[];
|
|
294
|
+
loading: boolean;
|
|
295
|
+
}
|
|
296
|
+
declare const Dialog: ({ open, title, loading, body, options, ...rest }: DialogCustomProps) => JSX.Element;
|
|
280
297
|
|
|
281
|
-
export { Autocomplete, BaseGrid, Checkbox, ColumnTitleProps, ColumnsProps, EditableTableCell, FilterCompareType, FilterProps, GetInputLabel, Grid, IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, Switch, TabPanel, TabPanelProps, Td, Tr, createFilter, filterData, getTabProps, useEvent, useFilter, useGrid, useLoading };
|
|
298
|
+
export { Autocomplete, BaseGrid, Checkbox, ColumnTitleProps, ColumnsProps, Dialog, EditableTableCell, FilterCompareType, FilterProps, GetInputLabel, Grid, IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, Switch, TabPanel, TabPanelProps, Td, Tr, createFilter, filterData, getTabProps, useEvent, useFilter, useGrid, useLoading };
|