@bluemarble/bm-components 0.0.65 → 0.0.71
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 +522 -593
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/hooks/useGrid.d.ts +9 -10
- package/dist/esm/types/components/index.d.ts +1 -3
- package/dist/index.d.ts +11 -39
- package/package.json +1 -2
- package/dist/esm/types/components/utils/DateFormat.d.ts +0 -14
- package/dist/esm/types/components/utils/RouteHelper.d.ts +0 -13
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { ColumnsProps } from '../BaseGrid';
|
|
2
2
|
import { FilterProps } from './useFilter';
|
|
3
|
-
|
|
3
|
+
interface UseGridProps {
|
|
4
4
|
columns: ColumnsProps[];
|
|
5
5
|
filters?: FilterProps[];
|
|
6
6
|
rowsPerPageOptions?: number[];
|
|
7
|
-
}
|
|
8
|
-
export declare
|
|
9
|
-
data:
|
|
10
|
-
defaultData: T[];
|
|
7
|
+
}
|
|
8
|
+
export declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
9
|
+
data: any[];
|
|
11
10
|
set: (data: T[]) => void;
|
|
12
|
-
columns: ColumnsProps[];
|
|
13
|
-
sortedBy: string;
|
|
14
|
-
sortedDirection: 'desc' | 'asc';
|
|
15
11
|
onSortBy: (prop: string) => void;
|
|
12
|
+
sortedBy: string;
|
|
13
|
+
defaultData: T[];
|
|
14
|
+
sortedDirection: "desc" | "asc";
|
|
15
|
+
columns: ColumnsProps[];
|
|
16
16
|
currentPage: number;
|
|
17
17
|
totalNumberOfPages: number;
|
|
18
18
|
onPageChange: (pageNumber: number) => void;
|
|
19
|
-
setRowsPerPage: (
|
|
19
|
+
setRowsPerPage: (rows: number) => void;
|
|
20
20
|
rowsPerPageOptions: number[];
|
|
21
21
|
rowsPerPage: number;
|
|
22
22
|
};
|
|
23
|
-
export declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): UseGridResponseProps<T>;
|
|
24
23
|
export {};
|
|
@@ -9,12 +9,10 @@ export { Radio } from './Radio';
|
|
|
9
9
|
export { LargeButton } from './LargeButton';
|
|
10
10
|
export { TabPanel, getTabProps, TabPanelProps } from './TabPanel';
|
|
11
11
|
export { ColumnsProps, BaseGrid } from './BaseGrid';
|
|
12
|
-
export { useGrid
|
|
12
|
+
export { useGrid } from './hooks/useGrid';
|
|
13
13
|
export { FilterCompareType, FilterProps, createFilter, useFilter } from './hooks/useFilter';
|
|
14
14
|
export { useEvent } from './hooks/useEvent';
|
|
15
15
|
export { useLoading } from './hooks/useLoading';
|
|
16
16
|
export { Modal } from './Modal';
|
|
17
17
|
export { GetInputLabel } from './utils/GetInputLabel';
|
|
18
18
|
export { Dialog } from './Dialog';
|
|
19
|
-
export { DateFormat } from './utils/DateFormat';
|
|
20
|
-
export { RouteHelper } from './utils/RouteHelper';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import React, { ReactNode, FC } from 'react';
|
|
3
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
|
-
import moment from 'moment';
|
|
6
|
-
import { NextApiHandler } from 'next';
|
|
7
5
|
|
|
8
6
|
interface ColumnTitleProps {
|
|
9
7
|
name: string;
|
|
@@ -244,27 +242,26 @@ declare function createFilter<T extends Record<string, any>>(filters: FilterProp
|
|
|
244
242
|
apply: (item: T) => boolean;
|
|
245
243
|
};
|
|
246
244
|
|
|
247
|
-
|
|
245
|
+
interface UseGridProps {
|
|
248
246
|
columns: ColumnsProps[];
|
|
249
247
|
filters?: FilterProps[];
|
|
250
248
|
rowsPerPageOptions?: number[];
|
|
251
|
-
}
|
|
252
|
-
declare
|
|
253
|
-
data:
|
|
254
|
-
defaultData: T[];
|
|
249
|
+
}
|
|
250
|
+
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
251
|
+
data: any[];
|
|
255
252
|
set: (data: T[]) => void;
|
|
256
|
-
columns: ColumnsProps[];
|
|
257
|
-
sortedBy: string;
|
|
258
|
-
sortedDirection: 'desc' | 'asc';
|
|
259
253
|
onSortBy: (prop: string) => void;
|
|
254
|
+
sortedBy: string;
|
|
255
|
+
defaultData: T[];
|
|
256
|
+
sortedDirection: "desc" | "asc";
|
|
257
|
+
columns: ColumnsProps[];
|
|
260
258
|
currentPage: number;
|
|
261
259
|
totalNumberOfPages: number;
|
|
262
260
|
onPageChange: (pageNumber: number) => void;
|
|
263
|
-
setRowsPerPage: (
|
|
261
|
+
setRowsPerPage: (rows: number) => void;
|
|
264
262
|
rowsPerPageOptions: number[];
|
|
265
263
|
rowsPerPage: number;
|
|
266
|
-
};
|
|
267
|
-
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): UseGridResponseProps<T>;
|
|
264
|
+
};
|
|
268
265
|
|
|
269
266
|
declare function useEvent(event: keyof WindowEventMap, handler: (ev: any) => void, passive?: boolean): void;
|
|
270
267
|
|
|
@@ -298,29 +295,4 @@ interface DialogCustomProps extends DialogProps {
|
|
|
298
295
|
}
|
|
299
296
|
declare const Dialog: ({ open, title, loading, body, options, ...rest }: DialogCustomProps) => JSX.Element;
|
|
300
297
|
|
|
301
|
-
|
|
302
|
-
from: {
|
|
303
|
-
db: moment.Moment & {
|
|
304
|
-
toDateOrUndefined(): Date | undefined;
|
|
305
|
-
};
|
|
306
|
-
client: moment.Moment & {
|
|
307
|
-
toDateOrUndefined(): Date | undefined;
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
now: () => moment.Moment;
|
|
311
|
-
utc: (newUTC: number) => (newDate: any) => any;
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
declare type MethodsProps = {
|
|
315
|
-
GET?: NextApiHandler;
|
|
316
|
-
POST?: NextApiHandler;
|
|
317
|
-
PUT?: NextApiHandler;
|
|
318
|
-
DELETE?: NextApiHandler;
|
|
319
|
-
PATCH?: NextApiHandler;
|
|
320
|
-
HEAD?: NextApiHandler;
|
|
321
|
-
OPTIONS?: NextApiHandler;
|
|
322
|
-
};
|
|
323
|
-
declare type Middleware = (handler: NextApiHandler) => NextApiHandler;
|
|
324
|
-
declare function RouteHelper(methods: MethodsProps, middlewares?: Middleware[]): (req: NextApiRequest, res: NextApiResponse) => any;
|
|
325
|
-
|
|
326
|
-
export { Autocomplete, BaseGrid, Checkbox, ColumnTitleProps, ColumnsProps, DateFormat, Dialog, EditableTableCell, FilterCompareType, FilterProps, GetInputLabel, Grid, IFilter, Input, InputMask, LargeButton, Modal, Radio, RouteHelper, Select, Switch, TabPanel, TabPanelProps, Td, Tr, UseGridResponseProps, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluemarble/bm-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.71",
|
|
4
4
|
"description": "BM components",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@rollup/plugin-commonjs": "^21.0.3",
|
|
35
35
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
36
36
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
37
|
-
"@types/next": "^9.0.0",
|
|
38
37
|
"@types/react": "^17.0.43",
|
|
39
38
|
"eslint": "^8.12.0",
|
|
40
39
|
"prettier": "^2.6.2",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import 'moment/locale/pt-br';
|
|
3
|
-
export declare function DateFormat(date?: any): {
|
|
4
|
-
from: {
|
|
5
|
-
db: moment.Moment & {
|
|
6
|
-
toDateOrUndefined(): Date | undefined;
|
|
7
|
-
};
|
|
8
|
-
client: moment.Moment & {
|
|
9
|
-
toDateOrUndefined(): Date | undefined;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
now: () => moment.Moment;
|
|
13
|
-
utc: (newUTC: number) => (newDate: any) => any;
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NextApiHandler } from 'next';
|
|
2
|
-
declare type MethodsProps = {
|
|
3
|
-
GET?: NextApiHandler;
|
|
4
|
-
POST?: NextApiHandler;
|
|
5
|
-
PUT?: NextApiHandler;
|
|
6
|
-
DELETE?: NextApiHandler;
|
|
7
|
-
PATCH?: NextApiHandler;
|
|
8
|
-
HEAD?: NextApiHandler;
|
|
9
|
-
OPTIONS?: NextApiHandler;
|
|
10
|
-
};
|
|
11
|
-
declare type Middleware = (handler: NextApiHandler) => NextApiHandler;
|
|
12
|
-
export declare function RouteHelper(methods: MethodsProps, middlewares?: Middleware[]): (req: NextApiRequest, res: NextApiResponse) => any;
|
|
13
|
-
export {};
|