qbs-react-grid 1.1.12 → 1.1.13

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.
@@ -73,7 +73,7 @@ export var ExpandCell = /*#__PURE__*/React.memo(function (_ref3) {
73
73
  }) ? '-' : '+'));
74
74
  });
75
75
  export var CustomTableCell = /*#__PURE__*/React.memo(function (_ref4) {
76
- var _renderCell, _renderCell2, _renderCell3;
76
+ var _renderCell, _path, _renderCell2, _renderCell3;
77
77
  var rowData = _ref4.rowData,
78
78
  renderCell = _ref4.renderCell,
79
79
  toolTip = _ref4.toolTip,
@@ -92,7 +92,7 @@ export var CustomTableCell = /*#__PURE__*/React.memo(function (_ref4) {
92
92
  },
93
93
  className: "qbs-table-row-link"
94
94
  }, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : handleCellFormat(rowData[dataKey], type)) : path ? /*#__PURE__*/React.createElement(Link, {
95
- to: path,
95
+ to: (_path = path === null || path === void 0 ? void 0 : path(rowData)) != null ? _path : '',
96
96
  className: "qbs-table-row-link"
97
97
  }, renderCell ? (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell : handleCellFormat(rowData[dataKey], type)) : /*#__PURE__*/React.createElement(React.Fragment, null, renderCell ? (_renderCell3 = renderCell(rowData)) === null || _renderCell3 === void 0 ? void 0 : _renderCell3.cell : handleCellFormat(rowData[dataKey], type))));
98
98
  });
@@ -311,7 +311,7 @@ var QbsTable = function QbsTable(_ref) {
311
311
  renderCell = _ref3.renderCell,
312
312
  isVisible = _ref3.isVisible,
313
313
  link = _ref3.link,
314
- path = _ref3.path,
314
+ getPath = _ref3.getPath,
315
315
  rowClick = _ref3.rowClick,
316
316
  sortKey = _ref3.sortKey,
317
317
  type = _ref3.type;
@@ -341,7 +341,7 @@ var QbsTable = function QbsTable(_ref) {
341
341
  dataKey: child.field,
342
342
  dataTheme: dataTheme,
343
343
  type: child.type,
344
- path: child.path,
344
+ path: child.getPath,
345
345
  link: child.link
346
346
  }) : /*#__PURE__*/React.createElement(Cell, {
347
347
  className: " " + classes.cellClass,
@@ -366,7 +366,7 @@ var QbsTable = function QbsTable(_ref) {
366
366
  dataKey: field,
367
367
  rowClick: rowClick,
368
368
  type: type,
369
- path: path,
369
+ path: getPath,
370
370
  dataTheme: dataTheme,
371
371
  link: link
372
372
  }) : /*#__PURE__*/React.createElement(Cell, {
@@ -18,7 +18,7 @@ export interface ColumnBase {
18
18
  rowClick?: (rowData: any) => void;
19
19
  sortKey?: string;
20
20
  type?: string;
21
- path?: string;
21
+ getPath?: (data: any) => string;
22
22
  }
23
23
  export interface QbsColumnProps extends ColumnBase {
24
24
  grouped?: boolean;
@@ -81,7 +81,7 @@ var ExpandCell = /*#__PURE__*/_react["default"].memo(function (_ref3) {
81
81
  });
82
82
  exports.ExpandCell = ExpandCell;
83
83
  var CustomTableCell = /*#__PURE__*/_react["default"].memo(function (_ref4) {
84
- var _renderCell, _renderCell2, _renderCell3;
84
+ var _renderCell, _path, _renderCell2, _renderCell3;
85
85
  var rowData = _ref4.rowData,
86
86
  renderCell = _ref4.renderCell,
87
87
  toolTip = _ref4.toolTip,
@@ -100,7 +100,7 @@ var CustomTableCell = /*#__PURE__*/_react["default"].memo(function (_ref4) {
100
100
  },
101
101
  className: "qbs-table-row-link"
102
102
  }, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : (0, _handleFormatCell.handleCellFormat)(rowData[dataKey], type)) : path ? /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
103
- to: path,
103
+ to: (_path = path === null || path === void 0 ? void 0 : path(rowData)) != null ? _path : '',
104
104
  className: "qbs-table-row-link"
105
105
  }, renderCell ? (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell : (0, _handleFormatCell.handleCellFormat)(rowData[dataKey], type)) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, renderCell ? (_renderCell3 = renderCell(rowData)) === null || _renderCell3 === void 0 ? void 0 : _renderCell3.cell : (0, _handleFormatCell.handleCellFormat)(rowData[dataKey], type))));
106
106
  });
@@ -318,7 +318,7 @@ var QbsTable = function QbsTable(_ref) {
318
318
  renderCell = _ref3.renderCell,
319
319
  isVisible = _ref3.isVisible,
320
320
  link = _ref3.link,
321
- path = _ref3.path,
321
+ getPath = _ref3.getPath,
322
322
  rowClick = _ref3.rowClick,
323
323
  sortKey = _ref3.sortKey,
324
324
  type = _ref3.type;
@@ -348,7 +348,7 @@ var QbsTable = function QbsTable(_ref) {
348
348
  dataKey: child.field,
349
349
  dataTheme: dataTheme,
350
350
  type: child.type,
351
- path: child.path,
351
+ path: child.getPath,
352
352
  link: child.link
353
353
  }) : /*#__PURE__*/_react["default"].createElement(_Cell["default"], {
354
354
  className: " " + classes.cellClass,
@@ -373,7 +373,7 @@ var QbsTable = function QbsTable(_ref) {
373
373
  dataKey: field,
374
374
  rowClick: rowClick,
375
375
  type: type,
376
- path: path,
376
+ path: getPath,
377
377
  dataTheme: dataTheme,
378
378
  link: link
379
379
  }) : /*#__PURE__*/_react["default"].createElement(_Cell["default"], {
@@ -18,7 +18,7 @@ export interface ColumnBase {
18
18
  rowClick?: (rowData: any) => void;
19
19
  sortKey?: string;
20
20
  type?: string;
21
- path?: string;
21
+ getPath?: (data: any) => string;
22
22
  }
23
23
  export interface QbsColumnProps extends ColumnBase {
24
24
  grouped?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qbs-react-grid",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "A React table component",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -70,7 +70,7 @@ export const CustomTableCell: React.FC<any> = React.memo(
70
70
  {renderCell ? renderCell(rowData)?.cell : handleCellFormat(rowData[dataKey], type)}
71
71
  </a>
72
72
  ) : path ? (
73
- <Link to={path} className="qbs-table-row-link">
73
+ <Link to={path?.(rowData) ?? ''} className="qbs-table-row-link">
74
74
  {renderCell ? renderCell(rowData)?.cell : handleCellFormat(rowData[dataKey], type)}
75
75
  </Link>
76
76
  ) : (
@@ -308,7 +308,7 @@ const QbsTable: React.FC<QbsTableProps> = ({
308
308
  renderCell,
309
309
  isVisible,
310
310
  link,
311
- path,
311
+ getPath,
312
312
  rowClick,
313
313
  sortKey,
314
314
  type
@@ -349,7 +349,7 @@ const QbsTable: React.FC<QbsTableProps> = ({
349
349
  dataKey={child.field}
350
350
  dataTheme={dataTheme}
351
351
  type={child.type}
352
- path={child.path}
352
+ path={child.getPath}
353
353
  link={child.link}
354
354
  />
355
355
  ) : (
@@ -387,7 +387,7 @@ const QbsTable: React.FC<QbsTableProps> = ({
387
387
  dataKey={field}
388
388
  rowClick={rowClick}
389
389
  type={type}
390
- path={path}
390
+ path={getPath}
391
391
  dataTheme={dataTheme}
392
392
  link={link}
393
393
  />
@@ -19,7 +19,7 @@ export interface ColumnBase {
19
19
  rowClick?: (rowData: any) => void;
20
20
  sortKey?: string;
21
21
  type?: string;
22
- path?: string;
22
+ getPath?: (data: any) => string;
23
23
  }
24
24
 
25
25
  export interface QbsColumnProps extends ColumnBase {