@bluemarble/bm-components 1.19.0 → 2.0.0
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.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.js +617 -366
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +758 -507
- package/dist/index.mjs.map +1 -1
- package/package.json +36 -36
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode, FC, Provider } from 'react';
|
|
2
|
+
import React__default, { PropsWithChildren, ReactNode, FC, Provider } from 'react';
|
|
3
3
|
import * as _mui_material from '@mui/material';
|
|
4
4
|
import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, StackProps, IconButtonProps, TypographyProps, AlertColor } from '@mui/material';
|
|
5
5
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
6
|
-
import
|
|
6
|
+
import { FactoryOpts } from 'imask';
|
|
7
7
|
import { IconType } from 'react-icons';
|
|
8
8
|
import { NextApiRequest, NextApiResponse, GetServerSidePropsContext } from 'next';
|
|
9
|
-
import {
|
|
9
|
+
import { ZodType, ZodSchema } from 'zod';
|
|
10
10
|
import { AxiosInstance } from 'axios';
|
|
11
11
|
|
|
12
12
|
interface ColumnTitleProps {
|
|
@@ -38,7 +38,7 @@ interface GridProps$1<T> {
|
|
|
38
38
|
noFilters?: boolean;
|
|
39
39
|
primaryKey?: string;
|
|
40
40
|
}
|
|
41
|
-
declare const Grid: <ObjectType>(props:
|
|
41
|
+
declare const Grid: <ObjectType>(props: PropsWithChildren<GridProps$1<ObjectType>>) => React__default.JSX.Element;
|
|
42
42
|
|
|
43
43
|
declare function filterData<T>(filters: FilterProps$1[], defaultData: {
|
|
44
44
|
current: T[];
|
|
@@ -54,7 +54,7 @@ interface EditableTableCellProps extends TableCellProps {
|
|
|
54
54
|
type?: TextFieldProps['type'];
|
|
55
55
|
fullWidth?: boolean;
|
|
56
56
|
rowData?: Record<string, any>;
|
|
57
|
-
mask?:
|
|
57
|
+
mask?: FactoryOpts;
|
|
58
58
|
bordered?: boolean;
|
|
59
59
|
rowIndex?: string | number;
|
|
60
60
|
formatCellValue?: (value: string) => string;
|
|
@@ -83,7 +83,7 @@ interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
|
83
83
|
label: string;
|
|
84
84
|
withFormik?: boolean;
|
|
85
85
|
value?: string;
|
|
86
|
-
mask:
|
|
86
|
+
mask: FactoryOpts;
|
|
87
87
|
onChangeValue?: (value: string, unmaskedValue: string) => void;
|
|
88
88
|
}
|
|
89
89
|
declare function InputMask({ withFormik, ...rest }: InputMaskProps): React__default.JSX.Element;
|
|
@@ -96,7 +96,6 @@ type SelectProps<T> = MuiSelectPropsWithouVariant<T> & {
|
|
|
96
96
|
name: string;
|
|
97
97
|
label: string;
|
|
98
98
|
withFormik?: boolean;
|
|
99
|
-
variant?: SelectProps$1<T>['variant'];
|
|
100
99
|
FormControlProps?: Partial<FormControlProps>;
|
|
101
100
|
InputLabelProps?: Partial<CustomInputLabelProps>;
|
|
102
101
|
helperText?: string;
|
|
@@ -227,6 +226,7 @@ interface SortedByProps$1 {
|
|
|
227
226
|
}
|
|
228
227
|
interface SearchOptions$1 {
|
|
229
228
|
caseSensitive?: boolean;
|
|
229
|
+
ignoreAccentMark?: boolean;
|
|
230
230
|
exact?: boolean;
|
|
231
231
|
value: string;
|
|
232
232
|
ignoredKeys?: string[];
|
|
@@ -255,8 +255,8 @@ declare function useGrid<T extends Record<string, any>>({ columns, filters, sear
|
|
|
255
255
|
onSortBy: (prop: string) => void;
|
|
256
256
|
onPageChange: (pageNumber: number) => void;
|
|
257
257
|
setRowsPerPage: (rows: number) => void;
|
|
258
|
-
appendSort: (prop: string, direction:
|
|
259
|
-
setSort: (prop: string, direction:
|
|
258
|
+
appendSort: (prop: string, direction: "desc" | "asc") => void;
|
|
259
|
+
setSort: (prop: string, direction: "desc" | "asc") => void;
|
|
260
260
|
clearSort: () => void;
|
|
261
261
|
};
|
|
262
262
|
|
|
@@ -375,7 +375,7 @@ interface IBaseDialogContext {
|
|
|
375
375
|
declare function useBaseDialog(): IBaseDialogContext;
|
|
376
376
|
declare function useBaseDialogInstance(): {
|
|
377
377
|
name: symbol;
|
|
378
|
-
actions:
|
|
378
|
+
actions: ReturnType<typeof useBaseDialog>;
|
|
379
379
|
};
|
|
380
380
|
|
|
381
381
|
interface IBaseDialogInstanceProviderProps {
|
|
@@ -398,8 +398,8 @@ interface IBaseDialogTriggerProps extends Omit<ButtonProps, 'name'> {
|
|
|
398
398
|
declare const BaseDialogTrigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
|
|
399
399
|
declare const BaseDialogCreate: (name?: symbol) => {
|
|
400
400
|
name: symbol;
|
|
401
|
-
Trigger: (props: Omit<IBaseDialogTriggerProps,
|
|
402
|
-
Root: (props: Omit<IBaseDialogInstanceProviderProps,
|
|
401
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => React__default.JSX.Element;
|
|
402
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => React__default.JSX.Element;
|
|
403
403
|
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
404
404
|
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
405
405
|
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
@@ -407,8 +407,8 @@ declare const BaseDialogCreate: (name?: symbol) => {
|
|
|
407
407
|
declare const BaseDialog: {
|
|
408
408
|
Create: (name?: symbol) => {
|
|
409
409
|
name: symbol;
|
|
410
|
-
Trigger: (props: Omit<IBaseDialogTriggerProps,
|
|
411
|
-
Root: (props: Omit<IBaseDialogInstanceProviderProps,
|
|
410
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => React__default.JSX.Element;
|
|
411
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => React__default.JSX.Element;
|
|
412
412
|
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
413
413
|
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
414
414
|
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
@@ -448,7 +448,7 @@ declare class ApiHelper<T> {
|
|
|
448
448
|
constructor(props?: ConstructorProps$1<T>);
|
|
449
449
|
setMiddlewares(middlewares: any[]): this;
|
|
450
450
|
createMethods(methods: MethodProps<T>): (req: NextApiRequest, res: NextApiResponse) => Promise<void | NextApiResponse<any>>;
|
|
451
|
-
static parserErrorWrapper<Output, Def extends
|
|
451
|
+
static parserErrorWrapper<Output, Def extends ZodType>(body: Record<string, any>, parser: ZodSchema<Output, Def>): Output;
|
|
452
452
|
static parseQueyFilters<T extends Record<string, any>>(filters: T): T;
|
|
453
453
|
static create({ onFinally }: {
|
|
454
454
|
onFinally: any;
|
|
@@ -538,7 +538,7 @@ declare class AuthHelper {
|
|
|
538
538
|
redirect?: undefined;
|
|
539
539
|
}>;
|
|
540
540
|
private generateJwtAndRefreshToken;
|
|
541
|
-
invalidateCookies: (res: NextApiResponse) => NextApiResponse
|
|
541
|
+
invalidateCookies: (res: NextApiResponse) => NextApiResponse;
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
type SortedDirectionProps = 'asc' | 'desc';
|
|
@@ -591,7 +591,7 @@ declare function useAsyncGrid<T extends Record<string, any>>({ columns, filters,
|
|
|
591
591
|
setRowsPerPage: (rows: number) => void;
|
|
592
592
|
rowsPerPageOptions: number[];
|
|
593
593
|
rowsPerPage: number;
|
|
594
|
-
setSort: (prop: string, direction:
|
|
594
|
+
setSort: (prop: string, direction: "desc" | "asc") => void;
|
|
595
595
|
isLoading: boolean;
|
|
596
596
|
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
597
597
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode, FC, Provider } from 'react';
|
|
2
|
+
import React__default, { PropsWithChildren, ReactNode, FC, Provider } from 'react';
|
|
3
3
|
import * as _mui_material from '@mui/material';
|
|
4
4
|
import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, StackProps, IconButtonProps, TypographyProps, AlertColor } from '@mui/material';
|
|
5
5
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
6
|
-
import
|
|
6
|
+
import { FactoryOpts } from 'imask';
|
|
7
7
|
import { IconType } from 'react-icons';
|
|
8
8
|
import { NextApiRequest, NextApiResponse, GetServerSidePropsContext } from 'next';
|
|
9
|
-
import {
|
|
9
|
+
import { ZodType, ZodSchema } from 'zod';
|
|
10
10
|
import { AxiosInstance } from 'axios';
|
|
11
11
|
|
|
12
12
|
interface ColumnTitleProps {
|
|
@@ -38,7 +38,7 @@ interface GridProps$1<T> {
|
|
|
38
38
|
noFilters?: boolean;
|
|
39
39
|
primaryKey?: string;
|
|
40
40
|
}
|
|
41
|
-
declare const Grid: <ObjectType>(props:
|
|
41
|
+
declare const Grid: <ObjectType>(props: PropsWithChildren<GridProps$1<ObjectType>>) => React__default.JSX.Element;
|
|
42
42
|
|
|
43
43
|
declare function filterData<T>(filters: FilterProps$1[], defaultData: {
|
|
44
44
|
current: T[];
|
|
@@ -54,7 +54,7 @@ interface EditableTableCellProps extends TableCellProps {
|
|
|
54
54
|
type?: TextFieldProps['type'];
|
|
55
55
|
fullWidth?: boolean;
|
|
56
56
|
rowData?: Record<string, any>;
|
|
57
|
-
mask?:
|
|
57
|
+
mask?: FactoryOpts;
|
|
58
58
|
bordered?: boolean;
|
|
59
59
|
rowIndex?: string | number;
|
|
60
60
|
formatCellValue?: (value: string) => string;
|
|
@@ -83,7 +83,7 @@ interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
|
83
83
|
label: string;
|
|
84
84
|
withFormik?: boolean;
|
|
85
85
|
value?: string;
|
|
86
|
-
mask:
|
|
86
|
+
mask: FactoryOpts;
|
|
87
87
|
onChangeValue?: (value: string, unmaskedValue: string) => void;
|
|
88
88
|
}
|
|
89
89
|
declare function InputMask({ withFormik, ...rest }: InputMaskProps): React__default.JSX.Element;
|
|
@@ -96,7 +96,6 @@ type SelectProps<T> = MuiSelectPropsWithouVariant<T> & {
|
|
|
96
96
|
name: string;
|
|
97
97
|
label: string;
|
|
98
98
|
withFormik?: boolean;
|
|
99
|
-
variant?: SelectProps$1<T>['variant'];
|
|
100
99
|
FormControlProps?: Partial<FormControlProps>;
|
|
101
100
|
InputLabelProps?: Partial<CustomInputLabelProps>;
|
|
102
101
|
helperText?: string;
|
|
@@ -227,6 +226,7 @@ interface SortedByProps$1 {
|
|
|
227
226
|
}
|
|
228
227
|
interface SearchOptions$1 {
|
|
229
228
|
caseSensitive?: boolean;
|
|
229
|
+
ignoreAccentMark?: boolean;
|
|
230
230
|
exact?: boolean;
|
|
231
231
|
value: string;
|
|
232
232
|
ignoredKeys?: string[];
|
|
@@ -255,8 +255,8 @@ declare function useGrid<T extends Record<string, any>>({ columns, filters, sear
|
|
|
255
255
|
onSortBy: (prop: string) => void;
|
|
256
256
|
onPageChange: (pageNumber: number) => void;
|
|
257
257
|
setRowsPerPage: (rows: number) => void;
|
|
258
|
-
appendSort: (prop: string, direction:
|
|
259
|
-
setSort: (prop: string, direction:
|
|
258
|
+
appendSort: (prop: string, direction: "desc" | "asc") => void;
|
|
259
|
+
setSort: (prop: string, direction: "desc" | "asc") => void;
|
|
260
260
|
clearSort: () => void;
|
|
261
261
|
};
|
|
262
262
|
|
|
@@ -375,7 +375,7 @@ interface IBaseDialogContext {
|
|
|
375
375
|
declare function useBaseDialog(): IBaseDialogContext;
|
|
376
376
|
declare function useBaseDialogInstance(): {
|
|
377
377
|
name: symbol;
|
|
378
|
-
actions:
|
|
378
|
+
actions: ReturnType<typeof useBaseDialog>;
|
|
379
379
|
};
|
|
380
380
|
|
|
381
381
|
interface IBaseDialogInstanceProviderProps {
|
|
@@ -398,8 +398,8 @@ interface IBaseDialogTriggerProps extends Omit<ButtonProps, 'name'> {
|
|
|
398
398
|
declare const BaseDialogTrigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
|
|
399
399
|
declare const BaseDialogCreate: (name?: symbol) => {
|
|
400
400
|
name: symbol;
|
|
401
|
-
Trigger: (props: Omit<IBaseDialogTriggerProps,
|
|
402
|
-
Root: (props: Omit<IBaseDialogInstanceProviderProps,
|
|
401
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => React__default.JSX.Element;
|
|
402
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => React__default.JSX.Element;
|
|
403
403
|
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
404
404
|
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
405
405
|
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
@@ -407,8 +407,8 @@ declare const BaseDialogCreate: (name?: symbol) => {
|
|
|
407
407
|
declare const BaseDialog: {
|
|
408
408
|
Create: (name?: symbol) => {
|
|
409
409
|
name: symbol;
|
|
410
|
-
Trigger: (props: Omit<IBaseDialogTriggerProps,
|
|
411
|
-
Root: (props: Omit<IBaseDialogInstanceProviderProps,
|
|
410
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => React__default.JSX.Element;
|
|
411
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => React__default.JSX.Element;
|
|
412
412
|
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
413
413
|
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
414
414
|
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
@@ -448,7 +448,7 @@ declare class ApiHelper<T> {
|
|
|
448
448
|
constructor(props?: ConstructorProps$1<T>);
|
|
449
449
|
setMiddlewares(middlewares: any[]): this;
|
|
450
450
|
createMethods(methods: MethodProps<T>): (req: NextApiRequest, res: NextApiResponse) => Promise<void | NextApiResponse<any>>;
|
|
451
|
-
static parserErrorWrapper<Output, Def extends
|
|
451
|
+
static parserErrorWrapper<Output, Def extends ZodType>(body: Record<string, any>, parser: ZodSchema<Output, Def>): Output;
|
|
452
452
|
static parseQueyFilters<T extends Record<string, any>>(filters: T): T;
|
|
453
453
|
static create({ onFinally }: {
|
|
454
454
|
onFinally: any;
|
|
@@ -538,7 +538,7 @@ declare class AuthHelper {
|
|
|
538
538
|
redirect?: undefined;
|
|
539
539
|
}>;
|
|
540
540
|
private generateJwtAndRefreshToken;
|
|
541
|
-
invalidateCookies: (res: NextApiResponse) => NextApiResponse
|
|
541
|
+
invalidateCookies: (res: NextApiResponse) => NextApiResponse;
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
type SortedDirectionProps = 'asc' | 'desc';
|
|
@@ -591,7 +591,7 @@ declare function useAsyncGrid<T extends Record<string, any>>({ columns, filters,
|
|
|
591
591
|
setRowsPerPage: (rows: number) => void;
|
|
592
592
|
rowsPerPageOptions: number[];
|
|
593
593
|
rowsPerPage: number;
|
|
594
|
-
setSort: (prop: string, direction:
|
|
594
|
+
setSort: (prop: string, direction: "desc" | "asc") => void;
|
|
595
595
|
isLoading: boolean;
|
|
596
596
|
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
597
597
|
};
|