@majoo-ui/react 1.58.3 → 1.58.4-rc.2

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.
@@ -4,7 +4,8 @@ import { EmptyDataProps, RowGroup, Decoration } from './Table';
4
4
  import { TableInstance } from 'react-table';
5
5
  interface CustomRowsStyle {
6
6
  predicate: boolean;
7
- css: CSS;
7
+ css?: CSS;
8
+ hideRowMenuColumn?: boolean;
8
9
  }
9
10
  interface MobileTableProps {
10
11
  instance: TableInstance<object>;
@@ -1106,7 +1106,8 @@ export interface RowGroup {
1106
1106
  }
1107
1107
  interface CustomRowsStyle {
1108
1108
  predicate: boolean;
1109
- css: CSS;
1109
+ css?: CSS;
1110
+ hideRowMenuColumn?: boolean;
1110
1111
  }
1111
1112
  export interface ColumnInstanceProps<D extends object> extends ColumnInstance<D> {
1112
1113
  options?: [];
package/index.esm.js CHANGED
@@ -21315,18 +21315,24 @@ const MobileTable = /*#__PURE__*/React__default.forwardRef(({
21315
21315
  }), void 0)
21316
21316
  }, {
21317
21317
  children: page.map((row, i) => {
21318
- var _a;
21318
+ var _a, _b, _c;
21319
21319
  prepareRow(row);
21320
- const isContextMenu = (_a = row.cells.filter(cell => {
21320
+ let isContextMenu = Boolean((_a = row.cells.filter(cell => {
21321
21321
  var _a, _b;
21322
21322
  return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
21323
- })) === null || _a === void 0 ? void 0 : _a.length;
21323
+ })) === null || _a === void 0 ? void 0 : _a.length);
21324
21324
  const actionCells = row.allCells.filter(cell => cell.column.id === 'menu' || cell.column.isAction);
21325
21325
  let customStyle = {};
21326
+ let hideRowMenuColumn = false;
21326
21327
  if (customRowsStyle && customRowsStyle(row.values).length) {
21327
21328
  for (let _i = 0; _i < customRowsStyle(row.values).length; _i++) {
21328
21329
  if (customRowsStyle(row.values)[_i].predicate) {
21329
- customStyle = customRowsStyle(row.values)[_i].css;
21330
+ const customRowCss = (_b = customRowsStyle(row.values)[_i]) === null || _b === void 0 ? void 0 : _b.css;
21331
+ customStyle = customRowCss || {};
21332
+ if ((_c = customRowsStyle(row.original)[_i]) === null || _c === void 0 ? void 0 : _c.hideRowMenuColumn) {
21333
+ isContextMenu = false;
21334
+ hideRowMenuColumn = true;
21335
+ }
21330
21336
  }
21331
21337
  }
21332
21338
  }
@@ -21456,7 +21462,7 @@ const MobileTable = /*#__PURE__*/React__default.forwardRef(({
21456
21462
  }), void 0)]
21457
21463
  }), `${cell.column.id}-${row.id}`);
21458
21464
  })
21459
- }), void 0), actionCells && actionCells.length > 0 && jsx(Flex$1, Object.assign({
21465
+ }), void 0), actionCells && !hideRowMenuColumn && actionCells.length > 0 && jsx(Flex$1, Object.assign({
21460
21466
  align: "center",
21461
21467
  justify: "end",
21462
21468
  gap: 3,
@@ -22316,20 +22322,26 @@ function Table({
22316
22322
  }), void 0)
22317
22323
  }, {
22318
22324
  children: page.map((row, i) => {
22319
- var _a, _b;
22325
+ var _a, _b, _c, _d;
22320
22326
  prepareRow(row);
22321
22327
  const subRowCells = row.cells.filter(cell => cell.column.isSubRow);
22322
22328
  const leftAddOnCells = (_a = row.cells.filter(cell => ['expander', 'selection'].includes(cell.column.id))) !== null && _a !== void 0 ? _a : [];
22323
22329
  const notNullHeaderColumns = visibleColumns.filter(column => typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow);
22324
- const isContextMenu = (_b = row.cells.filter(cell => {
22330
+ let isContextMenu = Boolean((_b = row.cells.filter(cell => {
22325
22331
  var _a, _b;
22326
22332
  return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
22327
- })) === null || _b === void 0 ? void 0 : _b.length;
22333
+ })) === null || _b === void 0 ? void 0 : _b.length);
22328
22334
  let customStyle = {};
22335
+ let hideRowMenuColumn = false;
22329
22336
  if (customRowsStyle && customRowsStyle(row.original).length) {
22330
22337
  for (let _i2 = 0; _i2 < customRowsStyle(row.original).length; _i2++) {
22331
22338
  if (customRowsStyle(row.original)[_i2].predicate) {
22332
- customStyle = customRowsStyle(row.original)[_i2].css;
22339
+ const customRowCss = (_c = customRowsStyle(row.original)[_i2]) === null || _c === void 0 ? void 0 : _c.css;
22340
+ customStyle = customRowCss || {};
22341
+ if ((_d = customRowsStyle(row.original)[_i2]) === null || _d === void 0 ? void 0 : _d.hideRowMenuColumn) {
22342
+ isContextMenu = false;
22343
+ hideRowMenuColumn = true;
22344
+ }
22333
22345
  }
22334
22346
  }
22335
22347
  }
@@ -22384,7 +22396,13 @@ function Table({
22384
22396
  }), void 0)
22385
22397
  }), void 0)
22386
22398
  }, {
22387
- children: cell.render('Cell')
22399
+ children: jsx(Box, Object.assign({
22400
+ css: {
22401
+ visibility: hideRowMenuColumn && collId === 'menu' ? 'hidden' : 'visible'
22402
+ }
22403
+ }, {
22404
+ children: cell.render('Cell')
22405
+ }), void 0)
22388
22406
  }), void 0)
22389
22407
  }), void 0);
22390
22408
  })
package/index.umd.js CHANGED
@@ -21608,20 +21608,26 @@
21608
21608
  }
21609
21609
  }, {
21610
21610
  children: page.map(function (row, i) {
21611
- var _a;
21611
+ var _a, _b, _c;
21612
21612
  prepareRow(row);
21613
- var isContextMenu = (_a = row.cells.filter(function (cell) {
21613
+ var isContextMenu = Boolean((_a = row.cells.filter(function (cell) {
21614
21614
  var _a, _b;
21615
21615
  return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
21616
- })) === null || _a === void 0 ? void 0 : _a.length;
21616
+ })) === null || _a === void 0 ? void 0 : _a.length);
21617
21617
  var actionCells = row.allCells.filter(function (cell) {
21618
21618
  return cell.column.id === 'menu' || cell.column.isAction;
21619
21619
  });
21620
21620
  var customStyle = {};
21621
+ var hideRowMenuColumn = false;
21621
21622
  if (customRowsStyle && customRowsStyle(row.values).length) {
21622
21623
  for (var i_1 = 0; i_1 < customRowsStyle(row.values).length; i_1++) {
21623
21624
  if (customRowsStyle(row.values)[i_1].predicate) {
21624
- customStyle = customRowsStyle(row.values)[i_1].css;
21625
+ var customRowCss = (_b = customRowsStyle(row.values)[i_1]) === null || _b === void 0 ? void 0 : _b.css;
21626
+ customStyle = customRowCss || {};
21627
+ if ((_c = customRowsStyle(row.original)[i_1]) === null || _c === void 0 ? void 0 : _c.hideRowMenuColumn) {
21628
+ isContextMenu = false;
21629
+ hideRowMenuColumn = true;
21630
+ }
21625
21631
  }
21626
21632
  }
21627
21633
  }
@@ -21765,7 +21771,7 @@
21765
21771
  }), void 0)]
21766
21772
  }), "".concat(cell.column.id, "-").concat(row.id));
21767
21773
  })
21768
- }), void 0), actionCells && actionCells.length > 0 && jsxRuntime.jsx(Flex$1, __assign({
21774
+ }), void 0), actionCells && !hideRowMenuColumn && actionCells.length > 0 && jsxRuntime.jsx(Flex$1, __assign({
21769
21775
  align: "center",
21770
21776
  justify: "end",
21771
21777
  gap: 3,
@@ -22681,7 +22687,7 @@
22681
22687
  }
22682
22688
  }, {
22683
22689
  children: page.map(function (row, i) {
22684
- var _a, _b;
22690
+ var _a, _b, _c, _d;
22685
22691
  prepareRow(row);
22686
22692
  var subRowCells = row.cells.filter(function (cell) {
22687
22693
  return cell.column.isSubRow;
@@ -22692,15 +22698,21 @@
22692
22698
  var notNullHeaderColumns = visibleColumns.filter(function (column) {
22693
22699
  return typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow;
22694
22700
  });
22695
- var isContextMenu = (_b = row.cells.filter(function (cell) {
22701
+ var isContextMenu = Boolean((_b = row.cells.filter(function (cell) {
22696
22702
  var _a, _b;
22697
22703
  return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
22698
- })) === null || _b === void 0 ? void 0 : _b.length;
22704
+ })) === null || _b === void 0 ? void 0 : _b.length);
22699
22705
  var customStyle = {};
22706
+ var hideRowMenuColumn = false;
22700
22707
  if (customRowsStyle && customRowsStyle(row.original).length) {
22701
22708
  for (var i_2 = 0; i_2 < customRowsStyle(row.original).length; i_2++) {
22702
22709
  if (customRowsStyle(row.original)[i_2].predicate) {
22703
- customStyle = customRowsStyle(row.original)[i_2].css;
22710
+ var customRowCss = (_c = customRowsStyle(row.original)[i_2]) === null || _c === void 0 ? void 0 : _c.css;
22711
+ customStyle = customRowCss || {};
22712
+ if ((_d = customRowsStyle(row.original)[i_2]) === null || _d === void 0 ? void 0 : _d.hideRowMenuColumn) {
22713
+ isContextMenu = false;
22714
+ hideRowMenuColumn = true;
22715
+ }
22704
22716
  }
22705
22717
  }
22706
22718
  }
@@ -22763,7 +22775,13 @@
22763
22775
  }), void 0);
22764
22776
  }
22765
22777
  }, {
22766
- children: cell.render('Cell')
22778
+ children: jsxRuntime.jsx(Box, __assign({
22779
+ css: {
22780
+ visibility: hideRowMenuColumn && collId === 'menu' ? 'hidden' : 'visible'
22781
+ }
22782
+ }, {
22783
+ children: cell.render('Cell')
22784
+ }), void 0)
22767
22785
  }), void 0)
22768
22786
  }), void 0);
22769
22787
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.58.3",
3
+ "version": "1.58.4-rc.2",
4
4
  "dependencies": {
5
5
  "@majoo-ui/core": "^1.31.3",
6
6
  "@majoo-ui/helpers": "^1.30.5",