@trackunit/react-table 0.0.472 → 0.0.474
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 +2 -12
- package/index.esm.js +3 -13
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -286,9 +286,9 @@ const Table = ({ rowHeight = 75, ...props }) => {
|
|
|
286
286
|
return null;
|
|
287
287
|
}
|
|
288
288
|
else {
|
|
289
|
-
return (jsxRuntime.jsx(reactTableBaseComponents.Tr, { className:
|
|
289
|
+
return (jsxRuntime.jsx(reactTableBaseComponents.Tr, { className: reactComponents.cvaInteractableItem({
|
|
290
290
|
showPointer: !!props.onRowClick || row.getCanSelect(),
|
|
291
|
-
|
|
291
|
+
selected: props.options.enableRowSelection && row.getIsSelected(),
|
|
292
292
|
}), dataTestId: `table-body-row-${virtualRow.index}`, layout: "flex", onClick: () => {
|
|
293
293
|
if (props.onRowClick) {
|
|
294
294
|
props.onRowClick(row);
|
|
@@ -315,16 +315,6 @@ const Table = ({ rowHeight = 75, ...props }) => {
|
|
|
315
315
|
total: ((_b = (_a = props.pagination) === null || _a === void 0 ? void 0 : _a.pageInfo) === null || _b === void 0 ? void 0 : _b.count) || 0,
|
|
316
316
|
}) }), ((_c = props.pagination) === null || _c === void 0 ? void 0 : _c.isLoading) ? (jsxRuntime.jsx("span", { className: "ml-2", children: jsxRuntime.jsx(reactComponents.Spinner, { size: "small" }) })) : null, props.footerRightActions ? jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: props.footerRightActions }) : null] }))] }));
|
|
317
317
|
};
|
|
318
|
-
const cvaTableRow = cssClassVarianceUtilities.cvaMerge(["hover:bg-neutral-100"], {
|
|
319
|
-
variants: {
|
|
320
|
-
showPointer: {
|
|
321
|
-
true: "cursor-pointer",
|
|
322
|
-
},
|
|
323
|
-
isSelected: {
|
|
324
|
-
true: "bg-primary-50",
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
});
|
|
328
318
|
|
|
329
319
|
const cvaColumnFilterGrabbable = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "justify-center"], {
|
|
330
320
|
variants: {
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { MenuItem, Icon, Text, Button, useOverflowItems, MoreMenu, MenuList, IconButton, Card, Spinner, EmptyState, Tooltip, Popover, PopoverTrigger, PopoverContent } from '@trackunit/react-components';
|
|
3
|
+
import { MenuItem, Icon, Text, Button, useOverflowItems, MoreMenu, MenuList, IconButton, Card, cvaInteractableItem, Spinner, EmptyState, Tooltip, Popover, PopoverTrigger, PopoverContent } from '@trackunit/react-components';
|
|
4
4
|
import { objectValues, truthy, objectKeys, objectEntries } from '@trackunit/shared-utils';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { useMemo, Children, cloneElement, useRef, useState, useEffect, useCallback } from 'react';
|
|
@@ -267,9 +267,9 @@ const Table = ({ rowHeight = 75, ...props }) => {
|
|
|
267
267
|
return null;
|
|
268
268
|
}
|
|
269
269
|
else {
|
|
270
|
-
return (jsx(Tr, { className:
|
|
270
|
+
return (jsx(Tr, { className: cvaInteractableItem({
|
|
271
271
|
showPointer: !!props.onRowClick || row.getCanSelect(),
|
|
272
|
-
|
|
272
|
+
selected: props.options.enableRowSelection && row.getIsSelected(),
|
|
273
273
|
}), dataTestId: `table-body-row-${virtualRow.index}`, layout: "flex", onClick: () => {
|
|
274
274
|
if (props.onRowClick) {
|
|
275
275
|
props.onRowClick(row);
|
|
@@ -296,16 +296,6 @@ const Table = ({ rowHeight = 75, ...props }) => {
|
|
|
296
296
|
total: ((_b = (_a = props.pagination) === null || _a === void 0 ? void 0 : _a.pageInfo) === null || _b === void 0 ? void 0 : _b.count) || 0,
|
|
297
297
|
}) }), ((_c = props.pagination) === null || _c === void 0 ? void 0 : _c.isLoading) ? (jsx("span", { className: "ml-2", children: jsx(Spinner, { size: "small" }) })) : null, props.footerRightActions ? jsx("div", { className: "flex flex-1 justify-end", children: props.footerRightActions }) : null] }))] }));
|
|
298
298
|
};
|
|
299
|
-
const cvaTableRow = cvaMerge(["hover:bg-neutral-100"], {
|
|
300
|
-
variants: {
|
|
301
|
-
showPointer: {
|
|
302
|
-
true: "cursor-pointer",
|
|
303
|
-
},
|
|
304
|
-
isSelected: {
|
|
305
|
-
true: "bg-primary-50",
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
});
|
|
309
299
|
|
|
310
300
|
const cvaColumnFilterGrabbable = cvaMerge(["flex", "items-center", "justify-center"], {
|
|
311
301
|
variants: {
|