@trackunit/react-table 0.0.277 → 0.0.279
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 +3 -3
- package/index.esm.js +2 -2
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var i18nLibraryTranslation = require('@trackunit/i18n-library-translation');
|
|
|
7
7
|
var reactComponents = require('@trackunit/react-components');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
10
|
-
var
|
|
10
|
+
var reactRouter = require('@tanstack/react-router');
|
|
11
11
|
var reactTable = require('@tanstack/react-table');
|
|
12
12
|
var reactTableBaseComponents = require('@trackunit/react-table-base-components');
|
|
13
13
|
var reactVirtual = require('@tanstack/react-virtual');
|
|
@@ -187,7 +187,7 @@ function __rest(s, e) {
|
|
|
187
187
|
const ActionButton = (_a) => {
|
|
188
188
|
var { action, children, id } = _a, rest = __rest(_a, ["action", "children", "id"]);
|
|
189
189
|
if (action.type === "route") {
|
|
190
|
-
return (jsxRuntime.jsx(reactComponents.Button, Object.assign({ id: id, renderAs:
|
|
190
|
+
return (jsxRuntime.jsx(reactComponents.Button, Object.assign({ id: id, renderAs: reactRouter.Link, to: action.url, variant: "ghost-neutral" }, rest, { children: children })));
|
|
191
191
|
}
|
|
192
192
|
return (jsxRuntime.jsx(reactComponents.Button, Object.assign({ id: id, onClick: action.method, variant: "ghost-neutral" }, rest, { children: children })));
|
|
193
193
|
};
|
|
@@ -212,7 +212,7 @@ const actionDataToMenuItem = (action, dataTestId) => {
|
|
|
212
212
|
};
|
|
213
213
|
const item = (jsxRuntime.jsx(reactComponents.MenuItem, { props, className: "flex justify-center", dataTestId: `${dataTestId}-action-label`, label: action.label, onClick: "method" in action ? action.method : undefined, prefix: jsxRuntime.jsx(reactComponents.Icon, { "data-testid": "action-icon", forwardedRef: action.forwardedRef, name: action.icon, size: action.size, style: action.style }), stopPropagation: false }, action.label));
|
|
214
214
|
if ("url" in action) {
|
|
215
|
-
return (jsxRuntime.jsx(
|
|
215
|
+
return (jsxRuntime.jsx(reactRouter.Link, { id: action.id, params: prev => prev, to: action.url, children: item }, action.label));
|
|
216
216
|
}
|
|
217
217
|
return item;
|
|
218
218
|
};
|
package/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { MenuItem, Icon, Text, Button, useOverflowItems, MoreMenu, MenuList, Ico
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useMemo, Children, cloneElement, useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
7
|
-
import { Link } from 'react-router
|
|
7
|
+
import { Link } from '@tanstack/react-router';
|
|
8
8
|
import { flexRender, useReactTable, getSortedRowModel, getCoreRowModel, createColumnHelper } from '@tanstack/react-table';
|
|
9
9
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
10
10
|
import { TableRoot, Thead, Tr, Th, SortIndicator, ResizeHandle, Tbody, Td } from '@trackunit/react-table-base-components';
|
|
@@ -187,7 +187,7 @@ const actionDataToMenuItem = (action, dataTestId) => {
|
|
|
187
187
|
};
|
|
188
188
|
const item = (jsx(MenuItem, { props, className: "flex justify-center", dataTestId: `${dataTestId}-action-label`, label: action.label, onClick: "method" in action ? action.method : undefined, prefix: jsx(Icon, { "data-testid": "action-icon", forwardedRef: action.forwardedRef, name: action.icon, size: action.size, style: action.style }), stopPropagation: false }, action.label));
|
|
189
189
|
if ("url" in action) {
|
|
190
|
-
return (jsx(Link, { id: action.id, to: action.url, children: item }, action.label));
|
|
190
|
+
return (jsx(Link, { id: action.id, params: prev => prev, to: action.url, children: item }, action.label));
|
|
191
191
|
}
|
|
192
192
|
return item;
|
|
193
193
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.279",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@trackunit/react-components": "*",
|
|
11
11
|
"react": "^18.2.0",
|
|
12
|
-
"react-router-dom": "6.18.0",
|
|
13
12
|
"@tanstack/react-table": "^8.10.7",
|
|
14
13
|
"@trackunit/react-table-base-components": "*",
|
|
15
14
|
"@trackunit/react-table-pagination": "*",
|
|
@@ -22,7 +21,8 @@
|
|
|
22
21
|
"@trackunit/react-core-contexts-api": "*",
|
|
23
22
|
"@trackunit/css-class-variance-utilities": "*",
|
|
24
23
|
"@trackunit/ui-icons": "*",
|
|
25
|
-
"@trackunit/i18n-library-translation": "*"
|
|
24
|
+
"@trackunit/i18n-library-translation": "*",
|
|
25
|
+
"@tanstack/react-router": "1.19.1"
|
|
26
26
|
},
|
|
27
27
|
"module": "./index.esm.js",
|
|
28
28
|
"main": "./index.cjs.js"
|