munza-x-data-grid 2.0.2 → 3.0.0-beta.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/README.md +77 -288
- package/dist/README.md +77 -288
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/button.d.ts +3 -3
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/table.d.ts +10 -10
- package/dist/data-grid.cjs +6 -42
- package/dist/data-grid.js +2116 -6870
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/package/contexts/GridContext.d.ts +16 -0
- package/dist/package/grid/index.d.ts +3 -0
- package/dist/package/index.d.ts +3 -0
- package/dist/package/lib/queryBuilder.d.ts +76 -0
- package/dist/package/table/TMain.d.ts +2 -0
- package/dist/package/types/index.d.ts +8 -0
- package/package.json +88 -64
- package/dist/components/feedback/NoDataFoundMsg.d.ts +0 -2
- package/dist/components/feedback/TableError.d.ts +0 -2
- package/dist/components/feedback/TableErrorMsg.d.ts +0 -2
- package/dist/components/feedback/TableNoData.d.ts +0 -2
- package/dist/components/feedback/TableRowSkeleton.d.ts +0 -7
- package/dist/components/feedback/TableSkeleton.d.ts +0 -2
- package/dist/components/header/HeaderFilter.d.ts +0 -5
- package/dist/components/header/HeaderMenu.d.ts +0 -5
- package/dist/components/header/HeaderSort.d.ts +0 -5
- package/dist/components/pagination/index.d.ts +0 -4
- package/dist/components/table/TBody.d.ts +0 -2
- package/dist/components/table/TCell.d.ts +0 -6
- package/dist/components/table/THead.d.ts +0 -6
- package/dist/components/table/THeader.d.ts +0 -2
- package/dist/components/table/TMain.d.ts +0 -2
- package/dist/components/toolbar/ToolbarFilter.d.ts +0 -5
- package/dist/components/toolbar/index.d.ts +0 -2
- package/dist/components/ui/Input.d.ts +0 -3
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/debounced-input.d.ts +0 -7
- package/dist/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/components/ui/empty.d.ts +0 -11
- package/dist/components/ui/native-select.d.ts +0 -8
- package/dist/components/ui/separator.d.ts +0 -4
- package/dist/contexts/GridContext.d.ts +0 -43
- package/dist/core/Grid.d.ts +0 -3
- package/dist/hooks/useGrid.d.ts +0 -2
- package/dist/hooks/useGridState.d.ts +0 -19
- package/dist/hooks/useQueryArgs.d.ts +0 -12
- package/dist/hooks/useSyncScroll.d.ts +0 -7
- package/dist/index.css +0 -4
- package/dist/index.d.ts +0 -5
- package/dist/utils/buildQueryString.d.ts +0 -2
- package/dist/utils/buildSortString.d.ts +0 -4
- package/dist/utils/getPinStyles.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ColumnDef, Table } from '@tanstack/react-table';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface GridContextProps<T> {
|
|
4
|
+
table: Table<T>;
|
|
5
|
+
}
|
|
6
|
+
interface GridContextProviderProps<T> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
payload?: {
|
|
9
|
+
data: T[];
|
|
10
|
+
total: number;
|
|
11
|
+
};
|
|
12
|
+
columns: ColumnDef<T>[];
|
|
13
|
+
}
|
|
14
|
+
export declare const GridContextProvider: <T>({ children, payload, columns, }: GridContextProviderProps<T>) => React.JSX.Element;
|
|
15
|
+
export declare function useGrid(): GridContextProps<unknown>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* queryBuilder.ts
|
|
3
|
+
*
|
|
4
|
+
* Converts TanStack Table's client-side state (column filters, global filter,
|
|
5
|
+
* sorting, pagination) into a Mongoose/MongoDB-friendly query descriptor.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* const query = buildMongooseQuery({
|
|
9
|
+
* columnFilters,
|
|
10
|
+
* globalFilter,
|
|
11
|
+
* sorting,
|
|
12
|
+
* pagination,
|
|
13
|
+
* searchableFields: ["name", "email"],
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // On the server:
|
|
17
|
+
* const docs = await Model.find(query.filter)
|
|
18
|
+
* .sort(query.sort)
|
|
19
|
+
* .skip(query.skip)
|
|
20
|
+
* .limit(query.limit);
|
|
21
|
+
*
|
|
22
|
+
* const total = await Model.countDocuments(query.filter);
|
|
23
|
+
*/
|
|
24
|
+
export interface ColumnFilter {
|
|
25
|
+
id: string;
|
|
26
|
+
value: unknown;
|
|
27
|
+
}
|
|
28
|
+
export type ColumnFiltersState = ColumnFilter[];
|
|
29
|
+
export interface SortingRule {
|
|
30
|
+
id: string;
|
|
31
|
+
desc: boolean;
|
|
32
|
+
}
|
|
33
|
+
export type SortingState = SortingRule[];
|
|
34
|
+
export interface PaginationState {
|
|
35
|
+
pageIndex: number;
|
|
36
|
+
pageSize: number;
|
|
37
|
+
}
|
|
38
|
+
export type FilterVariant = 'text' | 'exact' | 'range' | 'dateRange' | 'select' | 'multiSelect' | 'boolean';
|
|
39
|
+
export interface ColumnFilterConfig {
|
|
40
|
+
/** How this column's filter value should be interpreted. Defaults to "text". */
|
|
41
|
+
variant?: FilterVariant;
|
|
42
|
+
/**
|
|
43
|
+
* Override the field name used in the Mongo query if it differs from the
|
|
44
|
+
* column id (e.g. column id "authorName" -> field "author.name").
|
|
45
|
+
*/
|
|
46
|
+
field?: string;
|
|
47
|
+
/** Case-insensitive regex for "text" variant. Defaults to true. */
|
|
48
|
+
caseInsensitive?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface QueryBuilderOptions {
|
|
51
|
+
columnFilters?: ColumnFiltersState;
|
|
52
|
+
globalFilter?: string;
|
|
53
|
+
sorting?: SortingState;
|
|
54
|
+
pagination?: PaginationState;
|
|
55
|
+
/**
|
|
56
|
+
* Per-column-id configuration controlling how each filter value is
|
|
57
|
+
* translated into a Mongo operator. Columns not listed here default to
|
|
58
|
+
* variant: "text".
|
|
59
|
+
*/
|
|
60
|
+
columnConfig?: Record<string, ColumnFilterConfig>;
|
|
61
|
+
/**
|
|
62
|
+
* Fields to search when `globalFilter` is set. Produces an $or of
|
|
63
|
+
* case-insensitive regex matches across these fields.
|
|
64
|
+
*/
|
|
65
|
+
searchableFields?: string[];
|
|
66
|
+
/** Map a sort column id to a different Mongo field name if needed. */
|
|
67
|
+
sortFieldMap?: Record<string, string>;
|
|
68
|
+
}
|
|
69
|
+
export interface MongooseQuery {
|
|
70
|
+
filter: Record<string, any>;
|
|
71
|
+
sort: Record<string, 1 | -1>;
|
|
72
|
+
skip: number;
|
|
73
|
+
limit: number;
|
|
74
|
+
}
|
|
75
|
+
export declare function buildMongooseQuery(options: QueryBuilderOptions): MongooseQuery;
|
|
76
|
+
export default buildMongooseQuery;
|
package/package.json
CHANGED
|
@@ -1,64 +1,88 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "munza-x-data-grid",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "
|
|
5
|
-
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
}
|
|
64
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "munza-x-data-grid",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "3.0.0-beta.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.css"
|
|
8
|
+
],
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"main": "./dist/data-grid.cjs",
|
|
14
|
+
"module": "./dist/data-grid.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/data-grid.js",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./style.css": "./dist/index.css"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "tsc -b && vite build",
|
|
26
|
+
"lint": "eslint .",
|
|
27
|
+
"preview": "vite preview"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/jsdev-robin/munza-x-data-grid.git"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/jsdev-robin/munza-x-data-grid/issues"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^18 || ^19",
|
|
38
|
+
"react-dom": "^18 || ^19"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@base-ui/react": "^1.6.0",
|
|
42
|
+
"@fontsource-variable/geist": "^5.2.9",
|
|
43
|
+
"@shadcn/react": "^0.2.1",
|
|
44
|
+
"@tanstack/react-table": "^8.21.3",
|
|
45
|
+
"class-variance-authority": "^0.7.1",
|
|
46
|
+
"clsx": "^2.1.1",
|
|
47
|
+
"cmdk": "^1.1.1",
|
|
48
|
+
"date-fns": "^4.4.0",
|
|
49
|
+
"embla-carousel-react": "^8.6.0",
|
|
50
|
+
"input-otp": "^1.4.2",
|
|
51
|
+
"lucide-react": "^1.23.0",
|
|
52
|
+
"next-themes": "^0.4.6",
|
|
53
|
+
"radix-ui": "^1.6.2",
|
|
54
|
+
"react-day-picker": "^10.0.1",
|
|
55
|
+
"react-resizable-panels": "^4.12.1",
|
|
56
|
+
"recharts": "3.8.0",
|
|
57
|
+
"shadcn": "^4.13.0",
|
|
58
|
+
"sonner": "^2.0.7",
|
|
59
|
+
"tailwind-merge": "^3.6.0",
|
|
60
|
+
"tw-animate-css": "^1.4.0",
|
|
61
|
+
"vaul": "^1.1.2",
|
|
62
|
+
"zustand": "^5.0.14"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@babel/core": "^7.29.7",
|
|
66
|
+
"@eslint/js": "^10.0.1",
|
|
67
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
68
|
+
"@tailwindcss/vite": "^4.3.2",
|
|
69
|
+
"@types/babel__core": "^7.20.5",
|
|
70
|
+
"@types/node": "^24.13.2",
|
|
71
|
+
"@types/react": "^19.2.17",
|
|
72
|
+
"@types/react-dom": "^19.2.3",
|
|
73
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
74
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
75
|
+
"eslint": "^10.6.0",
|
|
76
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
77
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
78
|
+
"globals": "^17.7.0",
|
|
79
|
+
"react": "^19.2.7",
|
|
80
|
+
"react-dom": "^19.2.7",
|
|
81
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
82
|
+
"tailwindcss": "^4.3.2",
|
|
83
|
+
"typescript": "~6.0.2",
|
|
84
|
+
"typescript-eslint": "^8.62.0",
|
|
85
|
+
"vite": "^8.1.1",
|
|
86
|
+
"vite-plugin-dts": "^5.0.3"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Collapsible as CollapsiblePrimitive } from 'radix-ui';
|
|
2
|
-
declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
declare const DebouncedInput: ({ value: initialValue, onChange, debounce, ...props }: {
|
|
3
|
-
value: string | number;
|
|
4
|
-
onChange: (value: string | number) => void;
|
|
5
|
-
debounce?: number;
|
|
6
|
-
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default DebouncedInput;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
-
inset?: boolean;
|
|
10
|
-
variant?: 'default' | 'destructive';
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
13
|
-
inset?: boolean;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
17
|
-
inset?: boolean;
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
20
|
-
inset?: boolean;
|
|
21
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
26
|
-
inset?: boolean;
|
|
27
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
declare function Empty({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare const emptyMediaVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "icon" | null | undefined;
|
|
6
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function EmptyContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {
|
|
3
|
-
size?: 'sm' | 'default';
|
|
4
|
-
};
|
|
5
|
-
declare function NativeSelect({ className, size, ...props }: NativeSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function NativeSelectOption({ className, ...props }: React.ComponentProps<'option'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<'optgroup'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Separator as SeparatorPrimitive } from 'radix-ui';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Separator };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, ColumnFiltersState, OnChangeFn, PaginationState, Row, RowSelectionState, SortingState, Table, TableState } from '@tanstack/react-table';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
export interface GridContextProps<T> {
|
|
4
|
-
table: Table<T>;
|
|
5
|
-
isLoading?: boolean;
|
|
6
|
-
isError?: boolean;
|
|
7
|
-
isFetching?: boolean;
|
|
8
|
-
paneRef1: React.RefObject<HTMLDivElement | null>;
|
|
9
|
-
paneRef2: React.RefObject<HTMLDivElement | null>;
|
|
10
|
-
globalFilter?: string;
|
|
11
|
-
setGlobalFilter?: React.Dispatch<React.SetStateAction<string>>;
|
|
12
|
-
renderSubComponent?: (props: {
|
|
13
|
-
row: Row<T>;
|
|
14
|
-
}) => React.ReactElement;
|
|
15
|
-
refetch?: () => void;
|
|
16
|
-
}
|
|
17
|
-
declare const GridContext: React.Context<GridContextProps<any> | undefined>;
|
|
18
|
-
interface GridContextProviderProps<T> {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
payload?: {
|
|
21
|
-
data: T[];
|
|
22
|
-
total: number;
|
|
23
|
-
};
|
|
24
|
-
columns: ColumnDef<T>[];
|
|
25
|
-
state?: Partial<TableState>;
|
|
26
|
-
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>;
|
|
27
|
-
onPaginationChange?: OnChangeFn<PaginationState>;
|
|
28
|
-
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
29
|
-
onSortingChange?: OnChangeFn<SortingState>;
|
|
30
|
-
manualPagination?: boolean;
|
|
31
|
-
enableRowSelection?: boolean;
|
|
32
|
-
isLoading?: boolean;
|
|
33
|
-
isError?: boolean;
|
|
34
|
-
isFetching?: boolean;
|
|
35
|
-
refetch?: () => void;
|
|
36
|
-
setGlobalFilter?: React.Dispatch<React.SetStateAction<string>>;
|
|
37
|
-
renderSubComponent?: (props: {
|
|
38
|
-
row: Row<T>;
|
|
39
|
-
}) => React.ReactElement;
|
|
40
|
-
getRowCanExpand?: (row: Row<T>) => boolean;
|
|
41
|
-
}
|
|
42
|
-
export declare const GridContextProvider: <T>({ children, payload, columns, state, onColumnFiltersChange, onPaginationChange, onSortingChange, onRowSelectionChange, setGlobalFilter, manualPagination, enableRowSelection, isError, isLoading, isFetching, refetch, getRowCanExpand, renderSubComponent, }: GridContextProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
export default GridContext;
|
package/dist/core/Grid.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { GridProps } from '../types';
|
|
2
|
-
declare const Grid: <T>({ columns, payload, state, onColumnFiltersChange, onPaginationChange, onSortingChange, onRowSelectionChange, isLoading, isError, setGlobalFilter, getRowCanExpand, renderSubComponent, manualPagination, enableRowSelection, isFetching, refetch }: GridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export { Grid };
|
package/dist/hooks/useGrid.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ColumnFiltersState, PaginationState, RowSelectionState, SortingState } from '@tanstack/react-table';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
export declare const useGridState: () => {
|
|
4
|
-
state: {
|
|
5
|
-
columnFilters: ColumnFiltersState;
|
|
6
|
-
globalFilter: string;
|
|
7
|
-
pagination: PaginationState;
|
|
8
|
-
sorting: SortingState;
|
|
9
|
-
rowSelection: RowSelectionState;
|
|
10
|
-
};
|
|
11
|
-
handlers: {
|
|
12
|
-
onColumnFiltersChange: React.Dispatch<React.SetStateAction<ColumnFiltersState>>;
|
|
13
|
-
onPaginationChange: React.Dispatch<React.SetStateAction<PaginationState>>;
|
|
14
|
-
onSortingChange: React.Dispatch<React.SetStateAction<SortingState>>;
|
|
15
|
-
setGlobalFilter: React.Dispatch<React.SetStateAction<string>>;
|
|
16
|
-
onRowSelectionChange: React.Dispatch<React.SetStateAction<RowSelectionState>>;
|
|
17
|
-
};
|
|
18
|
-
rowSelection: RowSelectionState;
|
|
19
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ColumnFiltersState, PaginationState, SortingState } from '@tanstack/react-table';
|
|
2
|
-
export declare const useQueryArgs: (state: {
|
|
3
|
-
columnFilters: ColumnFiltersState;
|
|
4
|
-
globalFilter: string;
|
|
5
|
-
pagination: PaginationState;
|
|
6
|
-
sorting: SortingState;
|
|
7
|
-
}) => {
|
|
8
|
-
pagination: PaginationState;
|
|
9
|
-
queryParams: string;
|
|
10
|
-
sort: string;
|
|
11
|
-
globalFilter: string;
|
|
12
|
-
};
|
package/dist/index.css
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
@layer theme{:host,:root{--mun-color-red-500:oklch(63.7% 0.237 25.331);--mun-color-red-600:oklch(57.7% 0.245 27.325);--mun-color-blue-800:oklch(42.4% 0.199 265.638);--mun-spacing:0.25rem;--mun-container-md:28rem;--mun-text-xs:0.75rem;--mun-text-xs--line-height:calc(1 / 0.75);--mun-text-sm:0.875rem;--mun-text-sm--line-height:calc(1.25 / 0.875);--mun-text-2xl:1.5rem;--mun-text-2xl--line-height:calc(2 / 1.5);--mun-font-weight-semibold:600;--mun-radius-md:0.375rem;--mun-animate-spin:spin 1s linear infinite;--mun-default-transition-duration:0.15s;--mun-default-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}}@layer utilities{.mun\:-translate-x-1\/2,.mun\:-translate-y-1\/2{translate:var(--tw-translate-x) var(--tw-translate-y)}.mun\:overflow-hidden,.mun\:truncate{overflow:hidden}.mun\:truncate,.mun\:whitespace-nowrap{white-space:nowrap}.mun\:invisible{visibility:hidden}.mun\:absolute{position:absolute}.mun\:relative{position:relative}.mun\:top-1\/2{top:50%}.mun\:left-1\/2{left:50%}.mun\:mb-3{margin-bottom:calc(var(--mun-spacing) * 3)}.mun\:mb-6{margin-bottom:calc(var(--mun-spacing) * 6)}.mun\:flex{display:flex}.mun\:hidden{display:none}.mun\:inline-flex{display:inline-flex}.mun\:size-4{width:calc(var(--mun-spacing) * 4);height:calc(var(--mun-spacing) * 4)}.mun\:size-7{width:calc(var(--mun-spacing) * 7);height:calc(var(--mun-spacing) * 7)}.mun\:h-4{height:calc(var(--mun-spacing) * 4)}.mun\:h-5{height:calc(var(--mun-spacing) * 5)}.mun\:h-8{height:calc(var(--mun-spacing) * 8)}.mun\:h-\[65vh\]{height:65vh}.mun\:h-\[75vh\]{height:75vh}.mun\:h-auto{height:auto}.mun\:max-h-50{max-height:calc(var(--mun-spacing) * 50)}.mun\:w-8{width:calc(var(--mun-spacing) * 8)}.mun\:w-16{width:calc(var(--mun-spacing) * 16)}.mun\:w-52{width:calc(var(--mun-spacing) * 52)}.mun\:w-full{width:100%}.mun\:max-w-md{max-width:var(--mun-container-md)}.mun\:min-w-5{min-width:calc(var(--mun-spacing) * 5)}.mun\:flex-1{flex:1}.mun\:-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1)}.mun\:-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1)}.mun\:-rotate-45{rotate:-45deg}.mun\:rotate-45{rotate:45deg}.mun\:animate-spin{animation:var(--mun-animate-spin)}.mun\:cursor-pointer{cursor:pointer}.mun\:flex-col{flex-direction:column}.mun\:flex-wrap{flex-wrap:wrap}.mun\:items-center{align-items:center}.mun\:justify-between{justify-content:space-between}.mun\:justify-center{justify-content:center}.mun\:gap-1{gap:calc(var(--mun-spacing) * 1)}.mun\:gap-1\.5{gap:calc(var(--mun-spacing) * 1.5)}.mun\:gap-2{gap:calc(var(--mun-spacing) * 2)}.mun\:gap-3{gap:calc(var(--mun-spacing) * 3)}.mun\:gap-4{gap:calc(var(--mun-spacing) * 4)}:where(.mun\:space-y-3 > :not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--mun-spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--mun-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.mun\:truncate{text-overflow:ellipsis}.mun\:overflow-scroll{overflow:scroll}.mun\:overflow-x-hidden{overflow-x:hidden}.mun\:overflow-y-auto{overflow-y:auto}.mun\:overflow-y-scroll{overflow-y:scroll}.mun\:rounded-full{border-radius:3.40282e38px}.mun\:rounded-md{border-radius:var(--mun-radius-md)}.mun\:rounded-none{border-radius:0}.mun\:border{border-style:var(--tw-border-style);border-width:1px}.mun\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.mun\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.mun\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.mun\:border-border{border-color:var(--border)}.mun\:bg-background{background-color:var(--background)}.mun\:bg-muted{background-color:var(--muted)}.mun\:p-0{padding:calc(var(--mun-spacing) * 0)}.mun\:p-1\.5{padding:calc(var(--mun-spacing) * 1.5)}.mun\:p-3{padding:calc(var(--mun-spacing) * 3)}.mun\:px-1\.5{padding-inline:calc(var(--mun-spacing) * 1.5)}.mun\:px-2{padding-inline:calc(var(--mun-spacing) * 2)}.mun\:px-3{padding-inline:calc(var(--mun-spacing) * 3)}.mun\:py-1{padding-block:calc(var(--mun-spacing) * 1)}.mun\:py-4{padding-block:calc(var(--mun-spacing) * 4)}.mun\:pr-0{padding-right:calc(var(--mun-spacing) * 0)}.mun\:text-center{text-align:center}.mun\:font-mono{font-family:var(--mun-font-mono)}.mun\:text-2xl{font-size:var(--mun-text-2xl);line-height:var(--tw-leading, var(--mun-text-2xl--line-height))}.mun\:text-sm{font-size:var(--mun-text-sm);line-height:var(--tw-leading, var(--mun-text-sm--line-height))}.mun\:text-xs{font-size:var(--mun-text-xs);line-height:var(--tw-leading, var(--mun-text-xs--line-height))}.mun\:font-semibold{--tw-font-weight:var(--mun-font-weight-semibold);font-weight:var(--mun-font-weight-semibold)}.mun\:text-red-500{color:var(--mun-color-red-500)}.mun\:text-red-600{color:var(--mun-color-red-600)}.mun\:capitalize{text-transform:capitalize}.mun\:tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.mun\:opacity-0{opacity:0}.mun\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--mun-default-transition-timing-function));transition-duration:var(
|
|
2
|
-
--tw-duration,
|
|
3
|
-
var(--mun-default-transition-duration)
|
|
4
|
-
)}.mun\:select-none{-webkit-user-select:none;user-select:none}.mun\:\[scrollbar-color\:transparent_transparent\]{scrollbar-color:transparent transparent}.mun\:\[writing-mode\:vertical-rl\]{writing-mode:vertical-rl}:is(.mun\:\*\:border-r > *){border-right-style:var(--tw-border-style);border-right-width:1px}:is(.mun\:\*\:border-border > *){border-color:var(--border)}@media (hover:hover){.mun\:hover\:bg-background\!:hover{background-color:var(--background)!important}.mun\:hover\:bg-transparent:hover{background-color:#0000}}.mun\:data-\[state\=selected\]\:bg-blue-800\/25[data-state=selected]{background-color:var(--mun-color-blue-800)}@supports (color:color-mix(in lab,red,red)){.mun\:data-\[state\=selected\]\:bg-blue-800\/25[data-state=selected]{background-color:color-mix(in oklab,var(--mun-color-blue-800) 25%,transparent)}}@media (width>=40rem){.mun\:sm\:flex{display:flex}}}
|
package/dist/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, ColumnFiltersState, PaginationState, Row, SortingState } from '@tanstack/react-table';
|
|
2
|
-
export { Grid } from './core/Grid';
|
|
3
|
-
export { useGridState } from './hooks/useGridState';
|
|
4
|
-
export { useQueryArgs } from './hooks/useQueryArgs';
|
|
5
|
-
export type { ColumnDef, ColumnFiltersState, PaginationState, Row, SortingState, };
|