munza-x-data-grid 1.1.9 → 1.2.1

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.
@@ -0,0 +1,9 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,4 @@
1
+ import { Label as LabelPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Label };
@@ -1,4 +1,4 @@
1
- import { ColumnDef, ColumnFiltersState, OnChangeFn, PaginationState, SortingState, Table, TableState } from '@tanstack/react-table';
1
+ import { ColumnDef, ColumnFiltersState, OnChangeFn, PaginationState, Row, SortingState, Table, TableState } from '@tanstack/react-table';
2
2
  import { default as React } from 'react';
3
3
  export interface GridContextProps<T> {
4
4
  table: Table<T>;
@@ -6,11 +6,11 @@ export interface GridContextProps<T> {
6
6
  isError?: boolean;
7
7
  paneRef1: React.RefObject<HTMLDivElement | null>;
8
8
  paneRef2: React.RefObject<HTMLDivElement | null>;
9
- paneRef3: React.RefObject<HTMLDivElement | null>;
10
- paneRef4: React.RefObject<HTMLDivElement | null>;
11
- paneRef5: React.RefObject<HTMLDivElement | null>;
12
- paneRef6: React.RefObject<HTMLDivElement | null>;
13
- paneRef7: React.RefObject<HTMLDivElement | null>;
9
+ globalFilter?: string;
10
+ setGlobalFilter?: React.Dispatch<React.SetStateAction<string>>;
11
+ renderSubComponent?: (props: {
12
+ row: Row<T>;
13
+ }) => React.ReactElement;
14
14
  }
15
15
  declare const GridContext: React.Context<GridContextProps<any> | undefined>;
16
16
  interface GridContextProviderProps<T> {
@@ -27,6 +27,11 @@ interface GridContextProviderProps<T> {
27
27
  manualPagination?: boolean;
28
28
  isLoading?: boolean;
29
29
  isError?: boolean;
30
+ setGlobalFilter?: React.Dispatch<React.SetStateAction<string>>;
31
+ renderSubComponent?: (props: {
32
+ row: Row<T>;
33
+ }) => React.ReactElement;
34
+ getRowCanExpand?: (row: Row<T>) => boolean;
30
35
  }
31
- export declare const GridContextProvider: <T>({ children, payload, columns, state, onColumnFiltersChange, onPaginationChange, onSortingChange, manualPagination, isError, isLoading, }: GridContextProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
36
+ export declare const GridContextProvider: <T>({ children, payload, columns, state, onColumnFiltersChange, onPaginationChange, onSortingChange, setGlobalFilter, manualPagination, isError, isLoading, getRowCanExpand, renderSubComponent, }: GridContextProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
32
37
  export default GridContext;
@@ -1,3 +1,3 @@
1
1
  import { GridProps } from '../types';
2
- declare const Grid: <T>({ columns, payload, state, onColumnFiltersChange, onPaginationChange, onSortingChange, isLoading, isError, }: GridProps<T>) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Grid: <T>({ columns, payload, state, onColumnFiltersChange, onPaginationChange, onSortingChange, isLoading, isError, setGlobalFilter, getRowCanExpand, renderSubComponent, }: GridProps<T>) => import("react/jsx-runtime").JSX.Element;
3
3
  export { Grid };
@@ -0,0 +1,10 @@
1
+ export type Person = {
2
+ firstName: string;
3
+ lastName: string;
4
+ age: number;
5
+ visits: number;
6
+ progress: number;
7
+ status: string;
8
+ subRows?: Person[];
9
+ };
10
+ export declare const dummyPeople: Person[];