@trackunit/react-table 1.3.217 → 1.3.218
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/package.json +11 -11
- package/src/ActionSheet/ActionContainerAndOverflow.d.ts +3 -3
- package/src/ActionSheet/ActionSheet.d.ts +4 -4
- package/src/Table.d.ts +1 -1
- package/src/hooks/useCellsOffset.d.ts +1 -1
- package/src/index.d.ts +1 -1
- package/src/menus/ColumnFilter.d.ts +2 -2
- package/src/menus/Sorting.d.ts +1 -1
- package/src/types.d.ts +1 -1
- package/src/useTableSelection.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.218",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"jest-fetch-mock": "^3.0.3",
|
|
16
16
|
"@tanstack/react-router": "1.114.29",
|
|
17
17
|
"tailwind-merge": "^2.0.0",
|
|
18
|
-
"@trackunit/react-components": "1.4.
|
|
19
|
-
"@trackunit/shared-utils": "1.5.
|
|
20
|
-
"@trackunit/css-class-variance-utilities": "1.3.
|
|
21
|
-
"@trackunit/ui-icons": "1.3.
|
|
22
|
-
"@trackunit/react-table-base-components": "1.3.
|
|
23
|
-
"@trackunit/react-table-pagination": "1.3.
|
|
24
|
-
"@trackunit/react-form-components": "1.3.
|
|
25
|
-
"@trackunit/i18n-library-translation": "1.3.
|
|
26
|
-
"@trackunit/react-core-contexts-api": "1.4.
|
|
27
|
-
"@trackunit/react-test-setup": "1.0.
|
|
18
|
+
"@trackunit/react-components": "1.4.172",
|
|
19
|
+
"@trackunit/shared-utils": "1.5.141",
|
|
20
|
+
"@trackunit/css-class-variance-utilities": "1.3.141",
|
|
21
|
+
"@trackunit/ui-icons": "1.3.141",
|
|
22
|
+
"@trackunit/react-table-base-components": "1.3.194",
|
|
23
|
+
"@trackunit/react-table-pagination": "1.3.141",
|
|
24
|
+
"@trackunit/react-form-components": "1.3.196",
|
|
25
|
+
"@trackunit/i18n-library-translation": "1.3.160",
|
|
26
|
+
"@trackunit/react-core-contexts-api": "1.4.148",
|
|
27
|
+
"@trackunit/react-test-setup": "1.0.31"
|
|
28
28
|
},
|
|
29
29
|
"module": "./index.esm.js",
|
|
30
30
|
"main": "./index.cjs.js",
|
|
@@ -2,9 +2,9 @@ import { CommonProps, SidebarItemProps } from "@trackunit/react-components";
|
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
3
|
import { ActionModel, DropdownModel } from "./Actions";
|
|
4
4
|
interface ActionContainerAndOverflowProps extends CommonProps {
|
|
5
|
-
actions: ActionModel
|
|
6
|
-
dropdownActions?: DropdownModel
|
|
7
|
-
moreActions?: ReactElement<SidebarItemProps
|
|
5
|
+
actions: Array<ActionModel>;
|
|
6
|
+
dropdownActions?: Array<DropdownModel>;
|
|
7
|
+
moreActions?: Array<ReactElement<SidebarItemProps>> | ReactElement<SidebarItemProps>;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* `ActionContainerAndOverflow` renders a set of actions and a MoreMenu for overflow.
|
|
@@ -4,19 +4,19 @@ export interface ActionSheetProps extends CommonProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* Actions to be displayed in the ActionSheet as primary actions (normally visible)
|
|
6
6
|
*/
|
|
7
|
-
actions: ActionModel
|
|
7
|
+
actions: Array<ActionModel>;
|
|
8
8
|
/**
|
|
9
9
|
* Secondary Actions to be displayed in the ActionSheet via the more menu
|
|
10
10
|
*/
|
|
11
|
-
moreActions?: ActionModel
|
|
11
|
+
moreActions?: Array<ActionModel>;
|
|
12
12
|
/**
|
|
13
13
|
* Actions to be displayed as primary actions with capability to pass MenuList as dropdown
|
|
14
14
|
*/
|
|
15
|
-
dropdownActions?: DropdownModel
|
|
15
|
+
dropdownActions?: Array<DropdownModel>;
|
|
16
16
|
/**
|
|
17
17
|
* array of selected element-ids is used for calculating the number of selected elements - and available for eventhandlers.
|
|
18
18
|
*/
|
|
19
|
-
selections: string
|
|
19
|
+
selections: Array<string>;
|
|
20
20
|
/**
|
|
21
21
|
* Called when users closes the action sheet - must reset the selection.
|
|
22
22
|
*/
|
package/src/Table.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface TableProps<TData extends object> extends ReactTable<TData>, Com
|
|
|
15
15
|
hideFooter?: boolean;
|
|
16
16
|
emptyState?: EmptyStateProps;
|
|
17
17
|
selectionColId?: string;
|
|
18
|
-
renderFilterButton?: (filterKey: string | string
|
|
18
|
+
renderFilterButton?: (filterKey: string | Array<string>) => React.ReactNode;
|
|
19
19
|
isRowClickable?: (row: TData) => boolean;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -7,7 +7,7 @@ import { Header } from "@tanstack/react-table";
|
|
|
7
7
|
* @param {string | null} draggingColumnId - The ID of the column currently being dragged. If null, no dragging is occurring.
|
|
8
8
|
* @returns {Array<object>} Returns an array of objects containing `leftOffsets` and `rightOffsets` for each header group.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useCellsOffset: <TData extends object>(headerGroups: Header<TData, unknown
|
|
10
|
+
export declare const useCellsOffset: <TData extends object>(headerGroups: Array<Array<Header<TData, unknown>>>, draggingColumnId: string | null) => {
|
|
11
11
|
leftOffsets: Record<string, {
|
|
12
12
|
id: string;
|
|
13
13
|
offset: number;
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Column, ColumnOrderState, ColumnSizingState, Updater } from "@tanstack/react-table";
|
|
2
2
|
export interface ColumnFilterProps<TColumnFilter extends object, TColumnFilterValue> {
|
|
3
|
-
columns: Column<TColumnFilter, TColumnFilterValue
|
|
3
|
+
columns: Array<Column<TColumnFilter, TColumnFilterValue>>;
|
|
4
4
|
defaultColumnOrder: ColumnOrderState;
|
|
5
5
|
columnOrder?: ColumnOrderState;
|
|
6
6
|
setColumnOrder: (updater: Updater<ColumnOrderState>) => void;
|
|
@@ -17,7 +17,7 @@ export interface ColumnFilterProps<TColumnFilter extends object, TColumnFilterVa
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const ColumnFilter: <TColumnFilter extends object, TColumnFilterValue>({ columns, setColumnOrder, defaultColumnOrder, columnOrder, onUserEvent, setColumnSize, }: ColumnFilterProps<TColumnFilter, TColumnFilterValue>) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export interface ColumnFiltersDragAndDropProps<TColumnFiltersDragAndDrop extends object, TColumnFiltersDragAndDropValue> {
|
|
20
|
-
columns: Column<TColumnFiltersDragAndDrop, TColumnFiltersDragAndDropValue
|
|
20
|
+
columns: Array<Column<TColumnFiltersDragAndDrop, TColumnFiltersDragAndDropValue>>;
|
|
21
21
|
setColumnOrder: (updater: Updater<ColumnOrderState>) => void;
|
|
22
22
|
onUserEvent?: (event: "Column Reordering" | "Column Filter", payload: Record<string, unknown>) => void;
|
|
23
23
|
isSortDisabled: boolean;
|
package/src/menus/Sorting.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Column } from "@tanstack/react-table";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
3
|
interface SortingProps<TSorting extends object, TSortingValue> {
|
|
4
|
-
columns: Column<TSorting, TSortingValue
|
|
4
|
+
columns: Array<Column<TSorting, TSortingValue>>;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Sorting component for managing table column sorting.
|
package/src/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare module "@tanstack/react-table" {
|
|
|
23
23
|
* Allows to overwrite the Column Filter label.
|
|
24
24
|
* Used for dynamic headers like the selection column that uses a checkbox header in the table but should have a different column name in the Column Filter.
|
|
25
25
|
*/
|
|
26
|
-
filterName?: string | string
|
|
26
|
+
filterName?: string | Array<string>;
|
|
27
27
|
/**
|
|
28
28
|
* Specifies whether the column should be pinned (fixed) to the left or right side of the table.
|
|
29
29
|
* The value "left" pins the column to the left, and "right" pins it to the right.
|
|
@@ -6,7 +6,7 @@ export interface TableSelectionProps<TData extends SelectableTableData> {
|
|
|
6
6
|
/**
|
|
7
7
|
* The data that is displayed in the table.
|
|
8
8
|
*/
|
|
9
|
-
data: TData
|
|
9
|
+
data: Array<TData>;
|
|
10
10
|
/**
|
|
11
11
|
* The key in TData that should be used as the unique identifier
|
|
12
12
|
* Example: 'id', 'assetId', 'userId', etc.
|
|
@@ -15,7 +15,7 @@ export interface TableSelectionProps<TData extends SelectableTableData> {
|
|
|
15
15
|
/**
|
|
16
16
|
* An array of ids of the rows that should be selected by default.
|
|
17
17
|
*/
|
|
18
|
-
defaultSelectedIds?: string
|
|
18
|
+
defaultSelectedIds?: Array<string>;
|
|
19
19
|
/**
|
|
20
20
|
* Whether or not to enable row selection.
|
|
21
21
|
*/
|
|
@@ -25,7 +25,7 @@ export interface TableSelectionReturn<TData extends SelectableTableData> {
|
|
|
25
25
|
/**
|
|
26
26
|
* An array of the ids of the currently selected rows.
|
|
27
27
|
*/
|
|
28
|
-
selectedIds: string
|
|
28
|
+
selectedIds: Array<string>;
|
|
29
29
|
/**
|
|
30
30
|
* The current state of row selection.
|
|
31
31
|
* Pass this to the `state` prop of the `useTable` Hook.
|