@bluemarble/bm-components 0.0.6 → 0.0.9

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.
Files changed (50) hide show
  1. package/dist/esm/index.js +8584 -27226
  2. package/dist/esm/index.js.map +1 -1
  3. package/dist/esm/types/components/Autocomplete/index.d.ts +20 -0
  4. package/dist/esm/types/components/Checkbox/index.d.ts +19 -0
  5. package/dist/esm/types/components/Form/index.d.ts +8 -0
  6. package/dist/esm/types/components/Grid/AutoCreatedRows.d.ts +1 -0
  7. package/dist/esm/types/components/Grid/EditableTableCell/DefaultInput.d.ts +17 -0
  8. package/dist/esm/types/components/Grid/EditableTableCell/InputMask.d.ts +8 -0
  9. package/dist/esm/types/components/Grid/EditableTableCell/index.d.ts +24 -0
  10. package/dist/esm/types/components/Grid/Grid.d.ts +2 -2
  11. package/dist/esm/types/components/Grid/Header.d.ts +1 -0
  12. package/dist/esm/types/components/Grid/Td.d.ts +2 -20
  13. package/dist/esm/types/components/Grid/Tr.d.ts +6 -0
  14. package/dist/esm/types/components/Grid/hooks/useGrid.d.ts +20 -0
  15. package/dist/esm/types/components/Grid/index.d.ts +2 -1
  16. package/dist/esm/types/components/GridV2/index.d.ts +6 -0
  17. package/dist/esm/types/components/Input/index.d.ts +11 -0
  18. package/dist/esm/types/components/InputMask/index.d.ts +13 -0
  19. package/dist/esm/types/components/LargeButton/index.d.ts +8 -0
  20. package/dist/esm/types/components/Radio/index.d.ts +23 -0
  21. package/dist/esm/types/components/Select/index.d.ts +17 -0
  22. package/dist/esm/types/components/Switch/index.d.ts +19 -0
  23. package/dist/esm/types/components/index.d.ts +9 -0
  24. package/dist/esm/types/playground/src/App.d.ts +2 -0
  25. package/dist/esm/types/playground/src/main.d.ts +1 -0
  26. package/dist/esm/types/playground/src/theme.d.ts +1 -0
  27. package/dist/esm/types/playground/vite.config.d.ts +2 -0
  28. package/dist/esm/types/src/components/Autocomplete/index.d.ts +20 -0
  29. package/dist/esm/types/src/components/Checkbox/index.d.ts +18 -0
  30. package/dist/esm/types/src/components/Grid/AutoCreatedRows.d.ts +8 -0
  31. package/dist/esm/types/src/components/Grid/EditableTableCell/DefaultInput.d.ts +16 -0
  32. package/dist/esm/types/src/components/Grid/EditableTableCell/InputMask.d.ts +7 -0
  33. package/dist/esm/types/src/components/Grid/EditableTableCell/index.d.ts +23 -0
  34. package/dist/esm/types/src/components/Grid/Filters.d.ts +12 -0
  35. package/dist/esm/types/src/components/Grid/Grid.d.ts +32 -0
  36. package/dist/esm/types/src/components/Grid/Header.d.ts +10 -0
  37. package/dist/esm/types/src/components/Grid/Td.d.ts +3 -0
  38. package/dist/esm/types/src/components/Grid/Tr.d.ts +13 -0
  39. package/dist/esm/types/src/components/Grid/index.d.ts +6 -0
  40. package/dist/esm/types/src/components/Grid/utils.d.ts +5 -0
  41. package/dist/esm/types/src/components/Input/index.d.ts +12 -0
  42. package/dist/esm/types/src/components/InputMask/index.d.ts +12 -0
  43. package/dist/esm/types/src/components/LargeButton/index.d.ts +8 -0
  44. package/dist/esm/types/src/components/Radio/index.d.ts +22 -0
  45. package/dist/esm/types/src/components/Select/index.d.ts +17 -0
  46. package/dist/esm/types/src/components/Switch/index.d.ts +18 -0
  47. package/dist/esm/types/src/components/index.d.ts +9 -0
  48. package/dist/esm/types/src/index.d.ts +1 -0
  49. package/dist/index.d.ts +133 -14
  50. package/package.json +13 -6
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from "react";
2
+ import { Autocomplete as MuiAutocomplete, AutocompleteProps as MuiAutocompleteProps, AutocompleteRenderInputParams } from "@mui/material";
3
+ declare type MuiAutocomplete<T> = Omit<MuiAutocompleteProps<T, boolean, undefined, boolean>, "renderInput">;
4
+ declare type AutocompleteProps<T> = AutocompleteWithoutProps<T> | AutocompleteWithFormikProps<T>;
5
+ interface AutocompleteWithoutProps<T> extends MuiAutocomplete<T> {
6
+ name?: never;
7
+ withFormik: false;
8
+ getOptionValue?: never;
9
+ label?: string;
10
+ renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
11
+ }
12
+ interface AutocompleteWithFormikProps<T> extends MuiAutocomplete<T> {
13
+ name: string;
14
+ withFormik?: true;
15
+ label?: string;
16
+ renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
17
+ getOptionValue: (option: T) => string | number;
18
+ }
19
+ export declare function Autocomplete<T>({ withFormik, name, getOptionValue, ...rest }: AutocompleteProps<T>): JSX.Element;
20
+ export {};
@@ -0,0 +1,19 @@
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 {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { FormikProps, FormikHelpers } from "formik";
3
+ interface FormProps<T> extends Partial<FormikProps<T>> {
4
+ children: ReactNode;
5
+ onSubmit: (fields: T, formikHelpers: FormikHelpers<T>) => void;
6
+ }
7
+ export declare function Form<T>({ children, initialValues, onSubmit, ...props }: FormProps<T>): JSX.Element;
8
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ColumnTitleProps } from "./Grid";
2
3
  interface AutoCreatedRows {
3
4
  columns: ColumnTitleProps[];
@@ -0,0 +1,17 @@
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;
@@ -0,0 +1,8 @@
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 {};
@@ -0,0 +1,24 @@
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,7 +1,7 @@
1
1
  import React, { PropsWithChildren, ReactNode } from "react";
2
2
  import { TableCellProps } from "@mui/material";
3
- export interface ColumnTitleProps {
4
- name: string;
3
+ export interface ColumnTitleProps<T = {}> {
4
+ name: keyof T | "-";
5
5
  label: string;
6
6
  transformer?: (value: string | number | Date) => string;
7
7
  sx?: TableCellProps["sx"];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ColumnTitleProps } from "./Grid";
2
3
  interface GridHeaderProps {
3
4
  titles?: ColumnTitleProps[];
@@ -1,21 +1,3 @@
1
- import React, { FocusEvent } from "react";
2
- import { TableCellProps, TextFieldProps } from "@mui/material";
3
- import IMask from "imask";
4
- interface EditableTableCellProps extends TableCellProps {
5
- name: string;
6
- TextFieldProps?: TextFieldProps;
7
- type?: TextFieldProps["type"];
8
- fullWidth?: boolean;
9
- data?: Record<string, any>;
10
- mask?: IMask.AnyMaskedOptions;
11
- onSave: (props: OnSaveProps) => void;
12
- }
13
- interface OnSaveProps {
14
- name: string;
15
- event: FocusEvent;
16
- value: string;
17
- data: Record<string, any>;
18
- }
19
- export declare const EditableTableCell: (allProps: EditableTableCellProps) => JSX.Element;
1
+ import React from "react";
2
+ import { TableCellProps } from "@mui/material";
20
3
  export declare const Td: React.MemoExoticComponent<({ children, ...props }: TableCellProps) => JSX.Element>;
21
- export {};
@@ -1,7 +1,13 @@
1
1
  import React from "react";
2
2
  import { TableRowProps } from "@mui/material";
3
+ import { OnSaveProps } from "./EditableTableCell";
3
4
  interface CustomTableRowProps extends TableRowProps {
4
5
  striped?: boolean;
6
+ bordered?: boolean;
7
+ index?: number;
8
+ rowData?: Record<string, any>;
9
+ onSave?: (props: OnSaveProps) => void;
10
+ children: React.ReactElement[];
5
11
  }
6
12
  export declare const Tr: React.MemoExoticComponent<(props: CustomTableRowProps) => JSX.Element>;
7
13
  export {};
@@ -0,0 +1,20 @@
1
+ import { MutableRefObject } from "react";
2
+ import { FilterProps } from "../Grid";
3
+ interface useGridResponseOptions<T> {
4
+ tableData: T[];
5
+ defaultData: FilterProps[];
6
+ setDefaultData: MutableRefObject<T[]>;
7
+ selectedFilters: (options: Array<T>) => void;
8
+ setSelectedFilters: (options: Array<T>) => void;
9
+ getAllProps: () => {
10
+ tableData: T[];
11
+ defaultData: FilterProps[];
12
+ setDefaultData: MutableRefObject<T[]>;
13
+ selectedFilters: (options: Array<T>) => void;
14
+ setSelectedFilters: (options: Array<T>) => void;
15
+ getAllProps: (options: FilterProps[]) => void;
16
+ };
17
+ }
18
+ declare type useGridResponseProps<T> = [Array<T>, useGridResponseOptions<T>];
19
+ export declare function useGrid<T>(): useGridResponseProps<T>;
20
+ export {};
@@ -2,4 +2,5 @@ export { default } from "./Grid";
2
2
  export { ColumnTitleProps, IFilter, FilterProps } from "./Grid";
3
3
  export { filterData } from "./utils";
4
4
  export { Tr } from "./Tr";
5
- export { Td, EditableTableCell } from "./Td";
5
+ export { Td } from "./Td";
6
+ export { EditableTableCell } from "./EditableTableCell";
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from "react";
2
+ import { TableOptions } from "react-table";
3
+ interface GridV2Props<T extends Record<string, unknown>> extends TableOptions<T> {
4
+ }
5
+ export declare function GridV2<T extends Record<string, any>>({ columns, data, }: PropsWithChildren<GridV2Props<T>>): JSX.Element;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { StandardTextFieldProps } from "@mui/material";
3
+ interface InputProps extends StandardTextFieldProps {
4
+ name: string;
5
+ label: string;
6
+ withFormik?: boolean;
7
+ }
8
+ export declare const Input: FC<InputProps>;
9
+ export declare const BaseInput: (props: InputProps) => JSX.Element;
10
+ export declare const FormikInput: FC<InputProps>;
11
+ export {};
@@ -0,0 +1,13 @@
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
+ mask: IMask.AnyMaskedOptions;
9
+ onChangeValue?: (value: string, unmaskedValue: string) => void;
10
+ }
11
+ export declare function InputMask({ withFormik, ...rest }: InputMaskProps): JSX.Element;
12
+ export declare function FormikInputMask({ mask, defaultValue, name, ...rest }: InputMaskProps): JSX.Element;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { ButtonProps } from "@mui/material";
3
+ interface LargeButtonProps extends ButtonProps {
4
+ loading?: boolean;
5
+ children: ReactNode;
6
+ }
7
+ export declare const LargeButton: ({ loading, children, ...rest }: LargeButtonProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,23 @@
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 {};
@@ -0,0 +1,17 @@
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
+ }
14
+ export declare const Select: FC<SelectProps>;
15
+ export declare const BaseSelect: FC<SelectProps>;
16
+ export declare const FormikSelect: FC<SelectProps>;
17
+ export {};
@@ -0,0 +1,19 @@
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 +1,10 @@
1
1
  export { default as Grid, IFilter, ColumnTitleProps, FilterProps, filterData, Tr, Td, EditableTableCell, } from "./Grid";
2
+ export { GridV2 } from "./GridV2";
3
+ export { Input } from "./Input";
4
+ export { InputMask } from "./InputMask";
5
+ export { Select } from "./Select";
6
+ export { Autocomplete } from "./Autocomplete";
7
+ export { Checkbox } from "./Checkbox";
8
+ export { Switch } from "./Switch";
9
+ export { Radio } from "./Radio";
10
+ export { LargeButton } from "./LargeButton";
@@ -0,0 +1,2 @@
1
+ declare function App(): JSX.Element;
2
+ export default App;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const theme: import("@mui/material").Theme;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfigExport;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from "react";
2
+ import { Autocomplete as MuiAutocomplete, AutocompleteProps as MuiAutocompleteProps, AutocompleteRenderInputParams } from "@mui/material";
3
+ declare type MuiAutocomplete<T> = Omit<MuiAutocompleteProps<T, boolean, undefined, boolean>, "renderInput">;
4
+ declare type AutocompleteProps<T> = AutocompleteWithoutProps<T> | AutocompleteWithFormikProps<T>;
5
+ interface AutocompleteWithoutProps<T> extends MuiAutocomplete<T> {
6
+ name?: never;
7
+ withFormik: false;
8
+ getOptionValue?: never;
9
+ label?: string;
10
+ renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
11
+ }
12
+ interface AutocompleteWithFormikProps<T> extends MuiAutocomplete<T> {
13
+ name: string;
14
+ withFormik?: true;
15
+ label?: string;
16
+ renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
17
+ getOptionValue: (option: T) => string | number;
18
+ }
19
+ export declare function Autocomplete<T>({ withFormik, name, getOptionValue, ...rest }: AutocompleteProps<T>): JSX.Element;
20
+ export {};
@@ -0,0 +1,18 @@
1
+ import { CheckboxProps as MuiCheckboxProps, FormControlLabelProps } from "@mui/material";
2
+ declare type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
3
+ interface CheckboxWithFormik extends MuiCheckboxProps {
4
+ name: string;
5
+ label?: string;
6
+ withFormik?: true;
7
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
8
+ }
9
+ interface CheckboxWithoutFormik extends MuiCheckboxProps {
10
+ name?: never;
11
+ label?: string;
12
+ withFormik: false;
13
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
14
+ }
15
+ export declare const Checkbox: ({ withFormik, name, ...props }: CheckboxProps) => JSX.Element;
16
+ export declare const BaseCheckbox: ({ label, FormControlLabelProps, ...props }: Omit<CheckboxWithoutFormik, "withFormik">) => JSX.Element;
17
+ export declare const FormikCheckbox: ({ label, name, FormControlLabelProps, ...props }: Omit<CheckboxWithFormik, "withFormik">) => JSX.Element;
18
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ColumnTitleProps } from "./Grid";
2
+ interface AutoCreatedRows {
3
+ columns: ColumnTitleProps[];
4
+ tableData: any[];
5
+ primaryKey: string;
6
+ }
7
+ export declare const AutoCreatedRows: ({ tableData, columns, primaryKey, }: AutoCreatedRows) => JSX.Element;
8
+ export {};
@@ -0,0 +1,16 @@
1
+ import { TextFieldProps } from "@mui/material";
2
+ import { OnSaveProps } from ".";
3
+ export interface DefaultInputProps {
4
+ name: string;
5
+ rowData: Record<string, any>;
6
+ isEditing: boolean;
7
+ fullWidth?: boolean;
8
+ TextFieldProps?: TextFieldProps;
9
+ type?: TextFieldProps["type"];
10
+ formatInputDefautvalue?: (value: string) => string;
11
+ setIsEditing(value: boolean): void;
12
+ onUpdateValue: (value: string) => void;
13
+ onSave: (props: OnSaveProps) => void;
14
+ handleCancelEditing: () => void;
15
+ }
16
+ export declare const DefaultInput: (allProps: DefaultInputProps) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { DefaultInputProps } from "./DefaultInput";
2
+ import IMask from "imask";
3
+ interface InputMaskProps extends Omit<DefaultInputProps, "onUpdateValue"> {
4
+ mask: IMask.AnyMaskedOptions;
5
+ }
6
+ export declare const InputMask: (allProps: InputMaskProps) => JSX.Element;
7
+ export {};
@@ -0,0 +1,23 @@
1
+ import { TableCellProps, TextFieldProps } from "@mui/material";
2
+ interface EditableTableCellProps extends TableCellProps {
3
+ name: string;
4
+ TextFieldProps?: TextFieldProps;
5
+ type?: TextFieldProps["type"];
6
+ fullWidth?: boolean;
7
+ rowData?: Record<string, any>;
8
+ mask?: IMask.AnyMaskedOptions;
9
+ bordered?: boolean;
10
+ rowIndex?: string | number;
11
+ formatCellValue?: (value: string) => string;
12
+ formatInputDefautvalue?: (value: string) => string;
13
+ onSave?: (props: OnSaveProps) => void;
14
+ onCancel?: () => void;
15
+ }
16
+ export interface OnSaveProps {
17
+ name: string;
18
+ event: FocusEvent;
19
+ value: string;
20
+ data: Record<string, any>;
21
+ }
22
+ export declare const EditableTableCell: (allProps: EditableTableCellProps) => JSX.Element;
23
+ export {};
@@ -0,0 +1,12 @@
1
+ import { FC, MutableRefObject, ReactNode } from "react";
2
+ interface FiltersProps {
3
+ selectedFilters: Record<string, any>[];
4
+ handleCloseFilter: (item: any) => void;
5
+ customButtons: ReactNode;
6
+ noFilterButtons?: boolean;
7
+ searchAnchorEl: MutableRefObject<HTMLElement | null>;
8
+ setOpenSearch: (value: boolean) => void;
9
+ setAnchorEl: (item: HTMLElement) => void;
10
+ }
11
+ export declare const FiltersBar: FC<FiltersProps>;
12
+ export {};
@@ -0,0 +1,32 @@
1
+ import React, { PropsWithChildren, ReactNode } from "react";
2
+ import { TableCellProps } from "@mui/material";
3
+ export interface ColumnTitleProps<T = {}> {
4
+ name: keyof T | "-";
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
+ primaryKey?: string;
30
+ }
31
+ declare const Grid: <ObjectType>(props: React.PropsWithChildren<GridProps<ObjectType>>) => JSX.Element;
32
+ export default Grid;
@@ -0,0 +1,10 @@
1
+ import { ColumnTitleProps } from "./Grid";
2
+ interface GridHeaderProps {
3
+ titles?: ColumnTitleProps[];
4
+ orderBy: string;
5
+ order: "desc" | "asc" | undefined;
6
+ setOrder(value: string | undefined): void;
7
+ setOrderBy(value: string): void;
8
+ }
9
+ export declare const GridHeader: ({ setOrder, setOrderBy, order, orderBy, titles, }: GridHeaderProps) => JSX.Element;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { TableCellProps } from "@mui/material";
3
+ export declare const Td: React.MemoExoticComponent<({ children, ...props }: TableCellProps) => JSX.Element>;
@@ -0,0 +1,13 @@
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.ReactElement[];
11
+ }
12
+ export declare const Tr: React.MemoExoticComponent<(props: CustomTableRowProps) => JSX.Element>;
13
+ export {};
@@ -0,0 +1,6 @@
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";
@@ -0,0 +1,5 @@
1
+ import { FilterProps } from "./Grid";
2
+ export declare function filterData<T>(filters: FilterProps[], defaultData: {
3
+ current: T[];
4
+ }): T[];
5
+ export declare function getPropertyValue(obj: Record<string, any>, property: string): string;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { StandardTextFieldProps } from "@mui/material";
3
+ interface InputProps extends StandardTextFieldProps {
4
+ name: string;
5
+ label: string;
6
+ withFormik?: boolean;
7
+ formik?: any;
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 {};
@@ -0,0 +1,12 @@
1
+ import IMask from "imask";
2
+ import { StandardTextFieldProps } from "@mui/material";
3
+ interface InputMaskProps extends Partial<StandardTextFieldProps> {
4
+ name: string;
5
+ label: string;
6
+ withFormik?: boolean;
7
+ mask: IMask.AnyMaskedOptions;
8
+ onChangeValue?: (value: string, unmaskedValue: string) => void;
9
+ }
10
+ export declare function InputMask({ withFormik, ...rest }: InputMaskProps): JSX.Element;
11
+ export declare function FormikInputMask({ mask, defaultValue, name, ...rest }: InputMaskProps): JSX.Element;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { ButtonProps } from "@mui/material";
3
+ interface LargeButtonProps extends ButtonProps {
4
+ loading?: boolean;
5
+ children: ReactNode;
6
+ }
7
+ export declare const LargeButton: ({ loading, children, ...rest }: LargeButtonProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,22 @@
1
+ import { RadioGroupProps } from "@mui/material";
2
+ declare type RadioOptionProps = {
3
+ value: string | number | boolean;
4
+ label: string;
5
+ };
6
+ declare type RadioOptionsProps = RadioWithFormik | RadioWithoutFormik;
7
+ interface RadioWithFormik extends RadioGroupProps {
8
+ name: string;
9
+ label?: string;
10
+ options: RadioOptionProps[];
11
+ withFormik?: true;
12
+ }
13
+ interface RadioWithoutFormik extends RadioGroupProps {
14
+ name?: never;
15
+ label?: string;
16
+ options: RadioOptionProps[];
17
+ withFormik: false;
18
+ }
19
+ export declare const Radio: ({ name, withFormik, ...rest }: RadioOptionsProps) => JSX.Element;
20
+ export declare const BaseRadio: ({ label, options, ...rest }: Omit<RadioWithoutFormik, "withFormik">) => JSX.Element;
21
+ export declare const FormikRadio: ({ label, name, options, ...rest }: Omit<RadioWithFormik, "withFormik">) => JSX.Element;
22
+ export {};
@@ -0,0 +1,17 @@
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
+ }
14
+ export declare const Select: FC<SelectProps>;
15
+ export declare const BaseSelect: FC<SelectProps>;
16
+ export declare const FormikSelect: FC<SelectProps>;
17
+ export {};
@@ -0,0 +1,18 @@
1
+ import { SwitchProps as MuiSwitchProps, FormControlLabelProps } from "@mui/material";
2
+ declare type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
3
+ interface SwitchWithFormik extends MuiSwitchProps {
4
+ name: string;
5
+ label?: string;
6
+ withFormik?: true;
7
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
8
+ }
9
+ interface SwitchWithoutFormik extends MuiSwitchProps {
10
+ name?: never;
11
+ label?: string;
12
+ withFormik: false;
13
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
14
+ }
15
+ export declare const Switch: ({ withFormik, name, ...props }: SwitchProps) => JSX.Element;
16
+ export declare const BaseSwitch: ({ label, FormControlLabelProps, ...props }: Omit<SwitchWithoutFormik, "withFormik">) => JSX.Element;
17
+ export declare const FormikSwitch: ({ label, name, FormControlLabelProps, ...props }: Omit<SwitchWithFormik, "withFormik">) => JSX.Element;
18
+ export {};
@@ -0,0 +1,9 @@
1
+ export { default as Grid, IFilter, ColumnTitleProps, FilterProps, 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";
@@ -0,0 +1 @@
1
+ export * from "./components";