@majoo-ui/react 1.58.4-rc.1 → 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.
- package/components/table/MobileTable.d.ts +2 -1
- package/components/table/Table.d.ts +2 -2
- package/index.esm.js +24 -9
- package/index.umd.js +24 -9
- package/package.json +1 -1
|
@@ -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
|
|
7
|
+
css?: CSS;
|
|
8
|
+
hideRowMenuColumn?: boolean;
|
|
8
9
|
}
|
|
9
10
|
interface MobileTableProps {
|
|
10
11
|
instance: TableInstance<object>;
|
|
@@ -1106,8 +1106,8 @@ export interface RowGroup {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
interface CustomRowsStyle {
|
|
1108
1108
|
predicate: boolean;
|
|
1109
|
-
css
|
|
1110
|
-
|
|
1109
|
+
css?: CSS;
|
|
1110
|
+
hideRowMenuColumn?: boolean;
|
|
1111
1111
|
}
|
|
1112
1112
|
export interface ColumnInstanceProps<D extends object> extends ColumnInstance<D> {
|
|
1113
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
|
-
|
|
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
|
-
|
|
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,7 +22322,7 @@ function Table({
|
|
|
22316
22322
|
}), void 0)
|
|
22317
22323
|
}, {
|
|
22318
22324
|
children: page.map((row, i) => {
|
|
22319
|
-
var _a, _b, _c;
|
|
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 : [];
|
|
@@ -22326,12 +22332,15 @@ function Table({
|
|
|
22326
22332
|
return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
|
|
22327
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
|
-
|
|
22333
|
-
|
|
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) {
|
|
22334
22342
|
isContextMenu = false;
|
|
22343
|
+
hideRowMenuColumn = true;
|
|
22335
22344
|
}
|
|
22336
22345
|
}
|
|
22337
22346
|
}
|
|
@@ -22387,7 +22396,13 @@ function Table({
|
|
|
22387
22396
|
}), void 0)
|
|
22388
22397
|
}), void 0)
|
|
22389
22398
|
}, {
|
|
22390
|
-
children:
|
|
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)
|
|
22391
22406
|
}), void 0)
|
|
22392
22407
|
}), void 0);
|
|
22393
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
|
-
|
|
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, _c;
|
|
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;
|
|
@@ -22697,12 +22703,15 @@
|
|
|
22697
22703
|
return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
|
|
22698
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
|
-
|
|
22704
|
-
|
|
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) {
|
|
22705
22713
|
isContextMenu = false;
|
|
22714
|
+
hideRowMenuColumn = true;
|
|
22706
22715
|
}
|
|
22707
22716
|
}
|
|
22708
22717
|
}
|
|
@@ -22766,7 +22775,13 @@
|
|
|
22766
22775
|
}), void 0);
|
|
22767
22776
|
}
|
|
22768
22777
|
}, {
|
|
22769
|
-
children:
|
|
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)
|
|
22770
22785
|
}), void 0)
|
|
22771
22786
|
}), void 0);
|
|
22772
22787
|
})
|