munza-x-data-grid 3.0.0-beta.4 → 3.0.0-beta.6

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.
@@ -1 +0,0 @@
1
- export declare function useIsMobile(): boolean;
@@ -1,2 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
- export declare function cn(...inputs: ClassValue[]): string;
@@ -1,16 +0,0 @@
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 {};
@@ -1,3 +0,0 @@
1
- import { GridProps } from '../types';
2
- declare const Grid: <T>({ columns, payload }: GridProps<T>) => import("react").JSX.Element;
3
- export { Grid };
@@ -1,3 +0,0 @@
1
- export type { ColumnDef, ColumnFiltersState, PaginationState, Row, SortingState, } from '@tanstack/react-table';
2
- export { Grid } from './grid';
3
- export type { GridProps } from './types';
@@ -1,76 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- declare const TMain: () => import("react").JSX.Element;
2
- export default TMain;
@@ -1,8 +0,0 @@
1
- import { ColumnDef } from '@tanstack/react-table';
2
- export interface GridProps<T> {
3
- payload?: {
4
- data: T[];
5
- total: number;
6
- };
7
- columns: ColumnDef<T>[];
8
- }