@trackunit/react-table 0.0.557 → 0.0.559

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 CHANGED
@@ -343,7 +343,12 @@ const Table = ({ rowHeight = 75, ...props }) => {
343
343
  transform: `translateY(${virtualRow.start - index * virtualRow.size}px)`,
344
344
  }, children: row.getVisibleCells().map(cell => {
345
345
  var _a, _b;
346
- return (jsxRuntime.jsx(reactTableBaseComponents.Td, { style: {
346
+ return (jsxRuntime.jsx(reactTableBaseComponents.Td, { onClick: (event) => {
347
+ // prevent onRowClick action when clicking on a "selectable" cell with checkbox
348
+ if (props.selectionColId && cell.column.id === props.selectionColId) {
349
+ event.stopPropagation();
350
+ }
351
+ }, style: {
347
352
  width: cell.column.getSize(),
348
353
  minWidth: cell.column.columnDef.minSize,
349
354
  maxWidth: cell.column.columnDef.maxSize,
package/index.esm.js CHANGED
@@ -324,7 +324,12 @@ const Table = ({ rowHeight = 75, ...props }) => {
324
324
  transform: `translateY(${virtualRow.start - index * virtualRow.size}px)`,
325
325
  }, children: row.getVisibleCells().map(cell => {
326
326
  var _a, _b;
327
- return (jsx(Td, { style: {
327
+ return (jsx(Td, { onClick: (event) => {
328
+ // prevent onRowClick action when clicking on a "selectable" cell with checkbox
329
+ if (props.selectionColId && cell.column.id === props.selectionColId) {
330
+ event.stopPropagation();
331
+ }
332
+ }, style: {
328
333
  width: cell.column.getSize(),
329
334
  minWidth: cell.column.columnDef.minSize,
330
335
  maxWidth: cell.column.columnDef.maxSize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table",
3
- "version": "0.0.557",
3
+ "version": "0.0.559",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
package/src/Table.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface TableProps<TData extends object> extends ReactTable<TData>, Com
12
12
  rowHeight?: number;
13
13
  hideFooter?: boolean;
14
14
  emptyState?: EmptyStateProps;
15
+ selectionColId?: string;
15
16
  }
16
17
  /**
17
18
  * Table component for displaying large sets of data in tables with infinite scroll, sorting, filtering and others.