@trackunit/react-table 0.0.348 → 0.0.351
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/index.cjs.js +4 -3
- package/index.esm.js +4 -3
- package/package.json +3 -2
- package/src/menus/ColumnFilter.d.ts +1 -1
- package/src/menus/Sorting.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -12,6 +12,7 @@ var reactRouter = require('@tanstack/react-router');
|
|
|
12
12
|
var reactTable = require('@tanstack/react-table');
|
|
13
13
|
var reactTableBaseComponents = require('@trackunit/react-table-base-components');
|
|
14
14
|
var reactTablePagination = require('@trackunit/react-table-pagination');
|
|
15
|
+
var tailwindMerge = require('tailwind-merge');
|
|
15
16
|
var reactFormComponents = require('@trackunit/react-form-components');
|
|
16
17
|
var update = require('immutability-helper');
|
|
17
18
|
var reactDnd = require('react-dnd');
|
|
@@ -125,7 +126,7 @@ const cvaActionSheet = cssClassVarianceUtilities.cvaMerge([
|
|
|
125
126
|
"sm:grid-cols-[min-content,1fr,min-content]",
|
|
126
127
|
"sm:grid-rows-1",
|
|
127
128
|
"p-2",
|
|
128
|
-
"bg-
|
|
129
|
+
"bg-primary-600",
|
|
129
130
|
"gap-1",
|
|
130
131
|
"rounded-2xl",
|
|
131
132
|
"items-center",
|
|
@@ -302,7 +303,7 @@ const Table = (_a) => {
|
|
|
302
303
|
rowHeight,
|
|
303
304
|
});
|
|
304
305
|
const hasResults = props.getRowModel().rows.length > 0;
|
|
305
|
-
return (jsxRuntime.jsxs(reactComponents.Card, { className:
|
|
306
|
+
return (jsxRuntime.jsxs(reactComponents.Card, { className: tailwindMerge.twMerge("flex flex-col overflow-hidden", props.className), dataTestId: props.dataTestId, children: [(props.headerLeftActions || props.headerRightActions) && (jsxRuntime.jsxs("div", { className: "z-default flex justify-between gap-2 p-2", children: [jsxRuntime.jsx("div", { className: "flex items-center", children: props.headerLeftActions }), jsxRuntime.jsx("div", { className: "flex items-center", children: props.headerRightActions })] })), jsxRuntime.jsx("div", { className: "h-full overflow-x-auto overflow-y-scroll border-b border-t border-gray-300", onScroll: e => fetchMoreOnBottomReached(e.target), ref: tableContainerRef, children: jsxRuntime.jsxs(reactTableBaseComponents.TableRoot, { style: {
|
|
306
307
|
height: hasResults ? "auto" : "100%",
|
|
307
308
|
width: "100%",
|
|
308
309
|
position: "relative",
|
|
@@ -715,7 +716,7 @@ const useTableSelection = ({ data, defaultSelectedIds, enableRowSelection = true
|
|
|
715
716
|
alignment: "left",
|
|
716
717
|
columnFilterLabel: t("table.selection.label"),
|
|
717
718
|
},
|
|
718
|
-
}), [columnHelper]);
|
|
719
|
+
}), [columnHelper, t]);
|
|
719
720
|
const selectionTableState = React.useMemo(() => ({
|
|
720
721
|
rowSelection,
|
|
721
722
|
}), [rowSelection]);
|
package/index.esm.js
CHANGED
|
@@ -10,6 +10,7 @@ import { flexRender, useReactTable, getSortedRowModel, getCoreRowModel, createCo
|
|
|
10
10
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
11
11
|
import { TableRoot, Thead, Tr, Th, SortIndicator, ResizeHandle, Tbody, Td } from '@trackunit/react-table-base-components';
|
|
12
12
|
import { useInfiniteScroll, noPagination } from '@trackunit/react-table-pagination';
|
|
13
|
+
import { twMerge } from 'tailwind-merge';
|
|
13
14
|
import { Toggle, RadioGroup, RadioItem, Checkbox } from '@trackunit/react-form-components';
|
|
14
15
|
import update from 'immutability-helper';
|
|
15
16
|
import { DndProvider, useDrop, useDrag } from 'react-dnd';
|
|
@@ -100,7 +101,7 @@ const cvaActionSheet = cvaMerge([
|
|
|
100
101
|
"sm:grid-cols-[min-content,1fr,min-content]",
|
|
101
102
|
"sm:grid-rows-1",
|
|
102
103
|
"p-2",
|
|
103
|
-
"bg-
|
|
104
|
+
"bg-primary-600",
|
|
104
105
|
"gap-1",
|
|
105
106
|
"rounded-2xl",
|
|
106
107
|
"items-center",
|
|
@@ -277,7 +278,7 @@ const Table = (_a) => {
|
|
|
277
278
|
rowHeight,
|
|
278
279
|
});
|
|
279
280
|
const hasResults = props.getRowModel().rows.length > 0;
|
|
280
|
-
return (jsxs(Card, { className:
|
|
281
|
+
return (jsxs(Card, { className: twMerge("flex flex-col overflow-hidden", props.className), dataTestId: props.dataTestId, children: [(props.headerLeftActions || props.headerRightActions) && (jsxs("div", { className: "z-default flex justify-between gap-2 p-2", children: [jsx("div", { className: "flex items-center", children: props.headerLeftActions }), jsx("div", { className: "flex items-center", children: props.headerRightActions })] })), jsx("div", { className: "h-full overflow-x-auto overflow-y-scroll border-b border-t border-gray-300", onScroll: e => fetchMoreOnBottomReached(e.target), ref: tableContainerRef, children: jsxs(TableRoot, { style: {
|
|
281
282
|
height: hasResults ? "auto" : "100%",
|
|
282
283
|
width: "100%",
|
|
283
284
|
position: "relative",
|
|
@@ -690,7 +691,7 @@ const useTableSelection = ({ data, defaultSelectedIds, enableRowSelection = true
|
|
|
690
691
|
alignment: "left",
|
|
691
692
|
columnFilterLabel: t("table.selection.label"),
|
|
692
693
|
},
|
|
693
|
-
}), [columnHelper]);
|
|
694
|
+
}), [columnHelper, t]);
|
|
694
695
|
const selectionTableState = useMemo(() => ({
|
|
695
696
|
rowSelection,
|
|
696
697
|
}), [rowSelection]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.351",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"@trackunit/ui-icons": "*",
|
|
23
23
|
"@trackunit/i18n-library-translation": "*",
|
|
24
24
|
"@tanstack/react-router": "1.31.6",
|
|
25
|
-
"@trackunit/shared-utils": "*"
|
|
25
|
+
"@trackunit/shared-utils": "*",
|
|
26
|
+
"tailwind-merge": "^2.0.0"
|
|
26
27
|
},
|
|
27
28
|
"module": "./index.esm.js",
|
|
28
29
|
"main": "./index.cjs.js"
|
|
@@ -16,7 +16,7 @@ export interface ColumnFilterProps<TColumnFilter extends object, TColumnFilterVa
|
|
|
16
16
|
* @param {ColumnFilterProps<TColumnFilter, TColumnFilterValue>} props - The props object containing necessary properties.
|
|
17
17
|
* @returns {JSX.Element | null} A React JSX element representing the ColumnFilter component or null if columns are not provided.
|
|
18
18
|
*/
|
|
19
|
-
export declare const ColumnFilter: <TColumnFilter extends
|
|
19
|
+
export declare const ColumnFilter: <TColumnFilter extends object, TColumnFilterValue>({ columns, setColumnOrder, defaultColumnOrder, columnOrder, onUserEvent, }: ColumnFilterProps<TColumnFilter, TColumnFilterValue>) => JSX.Element | null;
|
|
20
20
|
export interface ColumnFiltersDragAndDropProps<TColumnFiltersDragAndDrop extends object, TColumnFiltersDragAndDropValue> {
|
|
21
21
|
columns: Column<TColumnFiltersDragAndDrop, TColumnFiltersDragAndDropValue>[];
|
|
22
22
|
setColumnOrder: (updater: Updater<ColumnOrderState>) => void;
|
package/src/menus/Sorting.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ interface SortingProps<TSorting extends object, TSortingValue> {
|
|
|
11
11
|
* @param {SortingProps<TSorting, TSortingValue>} props - The props object containing sorting properties.
|
|
12
12
|
* @returns {JSX.Element | null} A React JSX element representing the Sorting component or null if there are no sortable columns.
|
|
13
13
|
*/
|
|
14
|
-
export declare const Sorting: <TSorting extends
|
|
14
|
+
export declare const Sorting: <TSorting extends object, TSortingValue>({ columns, }: SortingProps<TSorting, TSortingValue>) => JSX.Element | null;
|
|
15
15
|
export {};
|