@collana-solutions/react-data-table 0.0.0-stage → 6.3.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/LICENSE +21 -0
- package/README.md +52 -3
- package/dist/index.d.ts +15 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +2 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/lib/ReactDataTable/DragAndDropOptions.d.ts +15 -0
- package/dist/lib/ReactDataTable/ReactDataTable.d.ts +9 -0
- package/dist/lib/ReactDataTable/ReactDataTableProps.d.ts +116 -0
- package/dist/lib/ReactDataTable/TableBody.d.ts +13 -0
- package/dist/lib/ReactDataTable/TableRows.d.ts +16 -0
- package/dist/lib/ReactDataTable/VirtualizationOptions.d.ts +15 -0
- package/dist/lib/hooks/useVirtualizationTableHeight.d.ts +12 -0
- package/dist/lib/translations/translations.d.ts +15 -0
- package/dist/lib/types/ColumnFilterState.d.ts +5 -0
- package/dist/lib/types/NullableTypes.d.ts +27 -0
- package/dist/lib/types/SortingState.d.ts +13 -0
- package/dist/lib/types/TableState.d.ts +26 -0
- package/dist/lib/useFullyControlledReactDataTable/useFullyControlledReactDataTable.d.ts +23 -0
- package/dist/lib/useReactDataTable/useReactDataTable.d.ts +10 -0
- package/dist/lib/useReactDataTable/useReactDataTableProps.d.ts +74 -0
- package/dist/lib/useReactDataTable/useReactDataTableResult.d.ts +62 -0
- package/dist/lib/useReactDataTableState/usePersistentReactDataTableState.d.ts +22 -0
- package/dist/lib/useReactDataTableState/useReactDataTableState.d.ts +11 -0
- package/dist/lib/useReactDataTableState/useReactDataTableStateProps.d.ts +37 -0
- package/dist/lib/useReactDataTableState/useReactDataTableStateResult.d.ts +64 -0
- package/dist/lib/utils/createReactDataTableColumnHelper.d.ts +9 -0
- package/dist/lib/utils/customFilterMethods.d.ts +4 -0
- package/dist/lib/utils/getColumnFilterFromModel.d.ts +4 -0
- package/dist/lib/utils/getCommonPinningStyles.d.ts +4 -0
- package/dist/lib/utils/getModelFromColumnFilter.d.ts +4 -0
- package/dist/lib/utils/getModelFromSortingState.d.ts +4 -0
- package/dist/lib/utils/getSortingStateFromModel.d.ts +4 -0
- package/dist/lib/utils/getStronglyTypedColumnFilter.d.ts +3 -0
- package/dist/react-table.d.ts +85 -0
- package/package.json +129 -6
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ColumnDef, ColumnPinningState, ExpandedState, OnChangeFn, PaginationState, RowSelectionState, TableOptions } from "@tanstack/react-table";
|
|
2
|
+
import { FilterModel, TableState } from "../types/TableState";
|
|
3
|
+
import { SortingState } from "../types/SortingState";
|
|
4
|
+
/**
|
|
5
|
+
* The props for the useReactDataTable hook
|
|
6
|
+
*/
|
|
7
|
+
export interface useReactDataTableProps<TData, TFilter extends FilterModel> {
|
|
8
|
+
/**
|
|
9
|
+
* data to display in the table
|
|
10
|
+
*/
|
|
11
|
+
data?: TData[];
|
|
12
|
+
/**
|
|
13
|
+
* columns to display in the table. You can use the createColumnHelper to create the columns
|
|
14
|
+
* ref: https://tanstack.com/table/v8/docs/guide/column-defs#column-helpers
|
|
15
|
+
*/
|
|
16
|
+
columns: ColumnDef<TData, any>[];
|
|
17
|
+
/**
|
|
18
|
+
* indicates if the table is loading data for the first time
|
|
19
|
+
* will display skeletons if true
|
|
20
|
+
*/
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* initial state of the table, for column filters, global filter, sorting and pagination
|
|
24
|
+
* will only be used if the corresponding state property is not supplied.
|
|
25
|
+
* So for example, if you supply the `state.columnFilters` property, the `initialState.columnFilters` property will be ignored.
|
|
26
|
+
*/
|
|
27
|
+
initialState?: TableState<TData, TFilter>;
|
|
28
|
+
/**
|
|
29
|
+
* the state of the table for column filters, global filter, sorting and pagination
|
|
30
|
+
*/
|
|
31
|
+
state?: TableState<TData, TFilter>;
|
|
32
|
+
/**
|
|
33
|
+
* indicates if the table should be manually filtered
|
|
34
|
+
*/
|
|
35
|
+
manualFiltering?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* indicates if the table should be manually paginated
|
|
38
|
+
*/
|
|
39
|
+
manualPagination?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* indicates if the table should be manually sorted
|
|
42
|
+
*/
|
|
43
|
+
manualSorting?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* event handler for when the column filters change
|
|
46
|
+
*/
|
|
47
|
+
onColumnFiltersChange?: OnChangeFn<TFilter>;
|
|
48
|
+
/**
|
|
49
|
+
* event handler for when the pagination changes
|
|
50
|
+
*/
|
|
51
|
+
onPaginationChange?: OnChangeFn<PaginationState>;
|
|
52
|
+
/**
|
|
53
|
+
* event handler for when the sorting changes
|
|
54
|
+
*/
|
|
55
|
+
onSortingChange?: OnChangeFn<SortingState<TData> | undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* event handler for when the row selection changes
|
|
58
|
+
*/
|
|
59
|
+
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
60
|
+
/**
|
|
61
|
+
* event handler for when the expanded changes
|
|
62
|
+
*/
|
|
63
|
+
onExpandedChange?: OnChangeFn<ExpandedState>;
|
|
64
|
+
/**
|
|
65
|
+
* event handler for when the column pinning changes
|
|
66
|
+
*/
|
|
67
|
+
onColumnPinningChange?: OnChangeFn<ColumnPinningState>;
|
|
68
|
+
/**
|
|
69
|
+
* the react table options that will be passed to the `useReactTable` hook.
|
|
70
|
+
* Omits the `state` property. Use the `state` property instead.
|
|
71
|
+
* ref: https://tanstack.com/table/v8/docs/api/core/table#usereacttable--createsolidtable--usevuetable--createsveltetable
|
|
72
|
+
*/
|
|
73
|
+
reactTableOptions?: Partial<Omit<TableOptions<TData>, "state">>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ColumnPinningState, ExpandedState, PaginationState, RowSelectionState, Table } from "@tanstack/react-table";
|
|
2
|
+
import { Dispatch, SetStateAction } from "react";
|
|
3
|
+
import { FilterModel } from "../types/TableState";
|
|
4
|
+
import { SortingState } from "../types/SortingState";
|
|
5
|
+
/**
|
|
6
|
+
* The result of the useReactDataTable hook
|
|
7
|
+
*/
|
|
8
|
+
export interface useReactDataTableResult<TData, TFilter extends FilterModel> {
|
|
9
|
+
/**
|
|
10
|
+
* the react table instance
|
|
11
|
+
*/
|
|
12
|
+
table: Table<TData>;
|
|
13
|
+
/**
|
|
14
|
+
* the pagination state. Only makes sense to use this if you are not supplying the `state.pagination` property
|
|
15
|
+
*/
|
|
16
|
+
pagination: PaginationState;
|
|
17
|
+
/**
|
|
18
|
+
* the pagination state setter.
|
|
19
|
+
* Only makes sense to use this if you are not using the `onPaginationChange` callback
|
|
20
|
+
*/
|
|
21
|
+
setPagination: Dispatch<SetStateAction<PaginationState>>;
|
|
22
|
+
/**
|
|
23
|
+
* the column filters state. Only makes sense to use this if you are not supplying the `state.columnFilters` property
|
|
24
|
+
*/
|
|
25
|
+
columnFilters: TFilter;
|
|
26
|
+
/**
|
|
27
|
+
* the row selection state. Only makes sense to use this if you are not supplying the `state.rowSelection` property
|
|
28
|
+
*/
|
|
29
|
+
rowSelection: RowSelectionState;
|
|
30
|
+
/**
|
|
31
|
+
* the column filters state setter. Only makes sense to use this if you are not using the `onColumnFiltersChange` callback
|
|
32
|
+
*/
|
|
33
|
+
setColumnFilters: Dispatch<SetStateAction<TFilter>>;
|
|
34
|
+
/**
|
|
35
|
+
* the sorting state. Only makes sense to use this if you are not supplying the `state.sorting` property
|
|
36
|
+
*/
|
|
37
|
+
sorting: SortingState<TData> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* the row selection state setter. Only makes sense to use this if you are not supplying the `state.rowSelection` property
|
|
40
|
+
*/
|
|
41
|
+
setRowSelection: Dispatch<SetStateAction<RowSelectionState>>;
|
|
42
|
+
/**
|
|
43
|
+
* the sorting state setter. Only makes sense to use this if you are not using the `onSortingChange` callback
|
|
44
|
+
*/
|
|
45
|
+
setSorting: Dispatch<SetStateAction<SortingState<TData | undefined>>>;
|
|
46
|
+
/**
|
|
47
|
+
* the expanded state. Only makes sense to use this if you are not supplying the `state.expanded` property
|
|
48
|
+
*/
|
|
49
|
+
expanded: ExpandedState;
|
|
50
|
+
/**
|
|
51
|
+
* the expanded state setter. Only makes sense to use this if you are not supplying the `state.expanded` property
|
|
52
|
+
*/
|
|
53
|
+
setExpanded: Dispatch<SetStateAction<ExpandedState>>;
|
|
54
|
+
/**
|
|
55
|
+
* the column pinning state. Only makes sense to use this if you are not supplying the `state.columnPinning` property
|
|
56
|
+
*/
|
|
57
|
+
columnPinning: ColumnPinningState;
|
|
58
|
+
/**
|
|
59
|
+
* the column pinning state setter. Only makes sense to use this if you are not supplying the `state.columnPinning` property
|
|
60
|
+
*/
|
|
61
|
+
setColumnPinning: Dispatch<SetStateAction<ColumnPinningState>>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OptionalNullable } from "../types/NullableTypes";
|
|
2
|
+
import { useReactDataTableStateProps } from "./useReactDataTableStateProps";
|
|
3
|
+
import { useReactDataTableStateResult } from "./useReactDataTableStateResult";
|
|
4
|
+
import { FilterModel } from "../types/TableState";
|
|
5
|
+
interface PersistentReactDataTableStateProps {
|
|
6
|
+
/**
|
|
7
|
+
* The prefix of the local storage keys the state is persisted under
|
|
8
|
+
*/
|
|
9
|
+
localStorageKey: string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the date the persisted state expires, called on every write (e.g. `() => getEndOfDay(new Date())`).
|
|
12
|
+
* Expired state is ignored and the initial state is used instead. Without it, the persisted state never expires.
|
|
13
|
+
*/
|
|
14
|
+
getExpirationDate?: () => Date;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A custom hook that will initialize all the state needed for the react data table and will persist it to local storage
|
|
18
|
+
* @param props The properties to configure the initial state
|
|
19
|
+
* @returns the state and the setters
|
|
20
|
+
*/
|
|
21
|
+
declare const usePersistentReactDataTableState: <TData, TFilter extends FilterModel = Record<string, never>>(props: OptionalNullable<useReactDataTableStateProps<TData, TFilter>> & PersistentReactDataTableStateProps) => useReactDataTableStateResult<TData, TFilter>;
|
|
22
|
+
export { usePersistentReactDataTableState };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useReactDataTableStateProps } from "./useReactDataTableStateProps";
|
|
2
|
+
import { useReactDataTableStateResult } from "./useReactDataTableStateResult";
|
|
3
|
+
import { FilterModel } from "../types/TableState";
|
|
4
|
+
import { OptionalNullable } from "../types/NullableTypes";
|
|
5
|
+
/**
|
|
6
|
+
* A custom hook that will initialize all the state needed for the react data table
|
|
7
|
+
* @param props The properties to configure the initial state
|
|
8
|
+
* @returns the state and the setters
|
|
9
|
+
*/
|
|
10
|
+
declare const useReactDataTableState: <TData, TFilter extends FilterModel = Record<string, never>>(props: OptionalNullable<useReactDataTableStateProps<TData, TFilter>>) => useReactDataTableStateResult<TData, TFilter>;
|
|
11
|
+
export { useReactDataTableState };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ColumnPinningState, ExpandedState, PaginationState, RowSelectionState } from "@tanstack/react-table";
|
|
2
|
+
import { SortingState } from "../types/SortingState";
|
|
3
|
+
import { FilterModel } from "../types/TableState";
|
|
4
|
+
import { ColumnFilterState } from "../types/ColumnFilterState";
|
|
5
|
+
/**
|
|
6
|
+
* The props for the useReactDataTableState hook
|
|
7
|
+
*/
|
|
8
|
+
export interface useReactDataTableStateProps<TData, TFilter extends FilterModel> {
|
|
9
|
+
/**
|
|
10
|
+
* the initial column filters
|
|
11
|
+
*/
|
|
12
|
+
initialColumnFilters: ColumnFilterState<TFilter>;
|
|
13
|
+
/**
|
|
14
|
+
* the initial after search filter
|
|
15
|
+
*/
|
|
16
|
+
initialAfterSearchFilter?: ColumnFilterState<TFilter>;
|
|
17
|
+
/**
|
|
18
|
+
* the initial sorting
|
|
19
|
+
*/
|
|
20
|
+
initialSorting?: SortingState<TData>;
|
|
21
|
+
/**
|
|
22
|
+
* the initial pagination
|
|
23
|
+
*/
|
|
24
|
+
initialPagination?: Partial<PaginationState>;
|
|
25
|
+
/**
|
|
26
|
+
* the initial row selection
|
|
27
|
+
*/
|
|
28
|
+
initialRowSelection?: RowSelectionState;
|
|
29
|
+
/**
|
|
30
|
+
* the initial expanded
|
|
31
|
+
*/
|
|
32
|
+
initialExpanded?: ExpandedState;
|
|
33
|
+
/**
|
|
34
|
+
* the initial column pinning
|
|
35
|
+
*/
|
|
36
|
+
initialColumnPinning?: ColumnPinningState;
|
|
37
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { ColumnPinningState, ExpandedState, PaginationState, RowSelectionState } from "@tanstack/react-table";
|
|
3
|
+
import { SortingState } from "../types/SortingState";
|
|
4
|
+
/**
|
|
5
|
+
* The props for the useReactDataTableState hook
|
|
6
|
+
*/
|
|
7
|
+
export interface useReactDataTableStateResult<TData, TFilter> {
|
|
8
|
+
/**
|
|
9
|
+
* the current sorting state
|
|
10
|
+
*/
|
|
11
|
+
sorting: SortingState<TData> | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* the current pagination state
|
|
14
|
+
*/
|
|
15
|
+
pagination: PaginationState;
|
|
16
|
+
/**
|
|
17
|
+
* the current column filters state
|
|
18
|
+
*/
|
|
19
|
+
columnFilters: TFilter;
|
|
20
|
+
/**
|
|
21
|
+
* the column filters state after search was triggered
|
|
22
|
+
*/
|
|
23
|
+
afterSearchFilter: TFilter;
|
|
24
|
+
/**
|
|
25
|
+
* the current row selection state
|
|
26
|
+
*/
|
|
27
|
+
rowSelection: RowSelectionState;
|
|
28
|
+
/**
|
|
29
|
+
* the expanded state
|
|
30
|
+
*/
|
|
31
|
+
expanded: ExpandedState;
|
|
32
|
+
/**
|
|
33
|
+
* the column pinning state
|
|
34
|
+
*/
|
|
35
|
+
columnPinning: ColumnPinningState;
|
|
36
|
+
/**
|
|
37
|
+
* the setter for the sorting state
|
|
38
|
+
*/
|
|
39
|
+
setSorting: Dispatch<SetStateAction<SortingState<TData> | undefined>>;
|
|
40
|
+
/**
|
|
41
|
+
* the setter for the pagination state
|
|
42
|
+
*/
|
|
43
|
+
setPagination: Dispatch<SetStateAction<PaginationState>>;
|
|
44
|
+
/**
|
|
45
|
+
* the setter for the column filters state
|
|
46
|
+
*/
|
|
47
|
+
setColumnFilters: Dispatch<SetStateAction<TFilter>>;
|
|
48
|
+
/**
|
|
49
|
+
* the setter for the column filters state after search was triggered
|
|
50
|
+
*/
|
|
51
|
+
setAfterSearchFilter: Dispatch<SetStateAction<TFilter>>;
|
|
52
|
+
/**
|
|
53
|
+
* the setter for the row selection state
|
|
54
|
+
*/
|
|
55
|
+
setRowSelection: Dispatch<SetStateAction<RowSelectionState>>;
|
|
56
|
+
/**
|
|
57
|
+
* the setter for the expanded state
|
|
58
|
+
*/
|
|
59
|
+
setExpanded: Dispatch<SetStateAction<ExpandedState>>;
|
|
60
|
+
/**
|
|
61
|
+
* the setter for the column pinning state
|
|
62
|
+
*/
|
|
63
|
+
setColumnPinning: Dispatch<SetStateAction<ColumnPinningState>>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDef, ColumnHelper, DeepKeys, DisplayColumnDef, RowData, Row } from "@tanstack/react-table";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import type { DropdownColumnFilterOption } from "src/react-table";
|
|
4
|
+
interface ReactDataTableColumnHelper<TData extends RowData> extends ColumnHelper<TData> {
|
|
5
|
+
createEnumColumn: <TEnum extends string | number>(columnKey: DeepKeys<TData>, enumTranslations: Record<TEnum, string> | DropdownColumnFilterOption[], columndDef?: Partial<ColumnDef<TData, TEnum>>) => ColumnDef<TData, TEnum>;
|
|
6
|
+
createDraggableColumn: (columnKey: DeepKeys<TData>, columndDef: Omit<DisplayColumnDef<TData>, "id" | "cell">, isEnabled?: boolean | ((row: Row<TData>) => boolean), draggableElement?: ReactNode) => ColumnDef<TData>;
|
|
7
|
+
}
|
|
8
|
+
declare const createReactDataTableColumnHelper: <TData extends RowData>() => ReactDataTableColumnHelper<TData>;
|
|
9
|
+
export { createReactDataTableColumnHelper };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Column, Table } from "@tanstack/react-table";
|
|
2
|
+
declare const setFilterValue: <TData>(column: Column<TData, unknown>, table: Table<TData>, value: unknown) => void;
|
|
3
|
+
declare const getFilterValue: <TData>(column: Column<TData, unknown>, table: Table<TData>) => unknown;
|
|
4
|
+
export { setFilterValue, getFilterValue };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SortingState as CustomSortingState } from "../types/SortingState";
|
|
2
|
+
import { SortingState } from "@tanstack/react-table";
|
|
3
|
+
declare const getModelFromSortingState: <TData>(sortingState: SortingState) => CustomSortingState<TData> | undefined;
|
|
4
|
+
export { getModelFromSortingState };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SortingState } from "@tanstack/react-table";
|
|
2
|
+
import { SortingState as CustomSortingState } from "../types/SortingState";
|
|
3
|
+
declare const getSortingStateFromModel: <TData>(sortingState?: CustomSortingState<TData>) => SortingState;
|
|
4
|
+
export { getSortingStateFromModel };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ColumnFiltersState } from "@tanstack/react-table";
|
|
2
|
+
declare const getStronglyTypedColumnFilter: <TData, TResult extends string | number>(columnFilters: ColumnFiltersState, id: keyof TData, targetType: "string" | "number") => TResult | undefined;
|
|
3
|
+
export { getStronglyTypedColumnFilter };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import { RowData, Table } from "@tanstack/react-table";
|
|
3
|
+
import { CSSProperties, JSX } from "react";
|
|
4
|
+
|
|
5
|
+
interface DropdownColumnFilterOption {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface DropdownColumnFilter {
|
|
12
|
+
options: DropdownColumnFilterOption[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare module "@tanstack/table-core" {
|
|
16
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
17
|
+
/**
|
|
18
|
+
* Define a dropdown filter
|
|
19
|
+
*/
|
|
20
|
+
dropdownFilter?: DropdownColumnFilter;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Add a style to every cell in this column
|
|
24
|
+
*/
|
|
25
|
+
cellStyle?: CSSProperties;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Add class name to the every cell in this column
|
|
29
|
+
*/
|
|
30
|
+
cellClassName?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Add a style to the header cell of this column
|
|
34
|
+
*/
|
|
35
|
+
headerStyle?: CSSProperties;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Add class name to the every header in this column
|
|
39
|
+
*/
|
|
40
|
+
headerClassName?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Add a style to the footer cell of this column
|
|
44
|
+
*/
|
|
45
|
+
footerStyle?: CSSProperties;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Add class name to the every footer in this column
|
|
49
|
+
*/
|
|
50
|
+
footerClassName?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Define a custom filter
|
|
54
|
+
* @param filterValue The current value of the filter
|
|
55
|
+
* @param setFilterValue The callback to update the filter state
|
|
56
|
+
* @param table The table object
|
|
57
|
+
* @returns The custom filter component
|
|
58
|
+
*/
|
|
59
|
+
customFilter?: <T>(filterValue: T, setFilterValue: (filterValue: T) => void, table: Table<TData>) => JSX.Element;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Prevents the column from being drawn
|
|
63
|
+
*/
|
|
64
|
+
isHidden?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Set to true to hide the header filters
|
|
68
|
+
*/
|
|
69
|
+
hideHeaderFilters?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Sets the header filter style
|
|
73
|
+
*/
|
|
74
|
+
headerFilterStyle?: CSSProperties;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Custom filter name to use instead of the default used accessor name
|
|
78
|
+
*/
|
|
79
|
+
customFilterName?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface RowSelectionOptions<TData extends RowData> {
|
|
83
|
+
fullRowSelectable?: boolean;
|
|
84
|
+
}
|
|
85
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,129 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@collana-solutions/react-data-table",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@collana-solutions/react-data-table",
|
|
3
|
+
"version": "6.3.0",
|
|
4
|
+
"description": "A small and clean data-table with a lot of integrated functions",
|
|
5
|
+
"homepage": "https://collana-solutions.github.io/react-data-table",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/collana-solutions/react-data-table"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "collana solutions AG",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.modern.js",
|
|
18
|
+
"require": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"main": "dist/index.js",
|
|
22
|
+
"umd:main": "dist/index.umd.js",
|
|
23
|
+
"jsdelivr": "dist/index.umd.js",
|
|
24
|
+
"unpkg": "dist/index.umd.js",
|
|
25
|
+
"module": "dist/index.modern.js",
|
|
26
|
+
"source": "src/index.ts",
|
|
27
|
+
"jsnext:main": "dist/index.modern.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "rollup -c && pnpm run copy-definitionfile",
|
|
34
|
+
"build-storybook": "build-storybook",
|
|
35
|
+
"lint": "eslint --cache",
|
|
36
|
+
"prepack": "pnpm run build",
|
|
37
|
+
"prepare-pr": "pnpm exec prettier . --write && pnpm run lint && pnpm run build && pnpm run test",
|
|
38
|
+
"prettier-check": "prettier --check .",
|
|
39
|
+
"prettier-write": "prettier --write .",
|
|
40
|
+
"copy-definitionfile": "shx cp -r src/react-table.d.ts dist/react-table.d.ts",
|
|
41
|
+
"start": "pnpm run copy-definitionfile && rollup -c -w",
|
|
42
|
+
"start-all": "concurrently \"pnpm run start\" \"pnpm run start-yalc\"",
|
|
43
|
+
"start-yalc": "nodemon --watch dist -x \"yalc push\"",
|
|
44
|
+
"storybook": "start-storybook -p 6006",
|
|
45
|
+
"test": "cross-env DEBUG_PRINT_LIMIT=100 jest",
|
|
46
|
+
"tsc": "tsc",
|
|
47
|
+
"changeset": "changeset",
|
|
48
|
+
"version-packages": "changeset version",
|
|
49
|
+
"release": "changeset publish"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@dnd-kit/core": "^6.3.1",
|
|
53
|
+
"@dnd-kit/modifiers": "^7.0.0",
|
|
54
|
+
"@dnd-kit/sortable": "^8.0.0",
|
|
55
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
56
|
+
"@neolution-ch/javascript-utils": "^2.2.0",
|
|
57
|
+
"@neolution-ch/react-pattern-ui": "^6.0.0",
|
|
58
|
+
"@tanstack/react-table": "^8.21.3",
|
|
59
|
+
"@tanstack/react-virtual": "^3.13.18",
|
|
60
|
+
"react-loading-skeleton": "^3.5.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@babel/core": "^7.29.0",
|
|
64
|
+
"@changesets/changelog-github": "^1.0.1",
|
|
65
|
+
"@changesets/cli": "^3.0.3",
|
|
66
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
67
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
68
|
+
"@fortawesome/react-fontawesome": "^3.2.0",
|
|
69
|
+
"@neolution-ch/eslint-config-neolution": "^2.3.0",
|
|
70
|
+
"@neolution-ch/reactstrap": "^10.0.0",
|
|
71
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
72
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
73
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
74
|
+
"@storybook/addon-actions": "^9.0.8",
|
|
75
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
76
|
+
"@storybook/addon-interactions": "^8.6.14",
|
|
77
|
+
"@storybook/addon-links": "^10.2.8",
|
|
78
|
+
"@storybook/react": "^10.2.8",
|
|
79
|
+
"@storybook/testing-library": "^0.2.2",
|
|
80
|
+
"@testing-library/dom": "^10.4.1",
|
|
81
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
82
|
+
"@testing-library/react": "^16.3.2",
|
|
83
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
84
|
+
"@testing-library/user-event": "^14.6.1",
|
|
85
|
+
"@types/jest": "^30.0.0",
|
|
86
|
+
"@types/node": "^18.16.3",
|
|
87
|
+
"@types/react": "^19.2.14",
|
|
88
|
+
"@types/react-dom": "^19.2.3",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
90
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
91
|
+
"concurrently": "^9.2.1",
|
|
92
|
+
"cross-env": "^10.1.0",
|
|
93
|
+
"eslint": "^9.37.0",
|
|
94
|
+
"eslint-plugin-storybook": "^0.10.0",
|
|
95
|
+
"gh-pages": "^6.3.0",
|
|
96
|
+
"jest": "^30.2.0",
|
|
97
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
98
|
+
"nodemon": "^3.1.11",
|
|
99
|
+
"pkg-pr-new": "^0.0.93",
|
|
100
|
+
"prettier": "^3.8.1",
|
|
101
|
+
"react": "^19.2.4",
|
|
102
|
+
"react-dom": "^19.2.4",
|
|
103
|
+
"rollup": "^4.57.1",
|
|
104
|
+
"rollup-plugin-import-css": "^4.2.0",
|
|
105
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
106
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
107
|
+
"shx": "^0.4.0",
|
|
108
|
+
"ts-jest": "^29.4.6",
|
|
109
|
+
"typescript": "^5.9.3",
|
|
110
|
+
"webpack": "^5.105.2",
|
|
111
|
+
"yalc": "^1.0.0-pre.53"
|
|
112
|
+
},
|
|
113
|
+
"peerDependencies": {
|
|
114
|
+
"@fortawesome/fontawesome-svg-core": "^6.1.1 || ^7.2.0",
|
|
115
|
+
"@fortawesome/free-solid-svg-icons": "^6.1.1 || ^7.2.0",
|
|
116
|
+
"@fortawesome/react-fontawesome": "^0.1.18 || ^0.2.0 || ^3.2.0",
|
|
117
|
+
"@neolution-ch/reactstrap": "^10.0.0",
|
|
118
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
119
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
120
|
+
},
|
|
121
|
+
"engines": {
|
|
122
|
+
"node": ">=20"
|
|
123
|
+
},
|
|
124
|
+
"publishConfig": {
|
|
125
|
+
"access": "public",
|
|
126
|
+
"registry": "https://registry.npmjs.org"
|
|
127
|
+
},
|
|
128
|
+
"packageManager": "pnpm@11.22.0"
|
|
129
|
+
}
|