bam32bittheme
Advanced tools
Comparing version 2.1.102 to 2.1.103
@@ -5,3 +5,2 @@ "use strict"; | ||
require("core-js/modules/es.weak-map.js"); | ||
require("core-js/modules/web.dom-collections.iterator.js"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -15,3 +14,3 @@ value: true | ||
require("core-js/modules/es.regexp.to-string.js"); | ||
require("core-js/modules/es.string.trim.js"); | ||
require("core-js/modules/web.dom-collections.iterator.js"); | ||
var _react = _interopRequireWildcard(require("react")); | ||
@@ -75,2 +74,3 @@ var _react2 = require("@emotion/react"); | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
const [getColumnVisibility, setColumnVisibility] = _react.default.useState({}); | ||
const theme = (0, _react2.useTheme)(); | ||
@@ -88,11 +88,9 @@ const numericSortingFn = (rowA, rowB, columnId) => { | ||
}; | ||
const getColumnVisibility = (0, _react.useMemo)(() => { | ||
(0, _react.useEffect)(() => { | ||
const visibility = {}; | ||
columns.forEach(column => { | ||
const isColumnEmpty = rows.every(row => !row[column.field] || row[column.field].toString().trim() === ''); | ||
if (isColumnEmpty) { | ||
visibility[column.field] = false; // Hide column if all values are empty | ||
} | ||
const isColumnEmpty = rows.every(row => !row[column.field]); | ||
visibility[column.field] = !isColumnEmpty; // Eğer sütun boşsa false | ||
}); | ||
return visibility; | ||
setColumnVisibility(visibility); // Sütun görünürlüğünü güncelle | ||
}, [columns, rows]); | ||
@@ -168,4 +166,3 @@ const tableColumns = (0, _react.useMemo)(() => { | ||
initialState: _objectSpread(_objectSpread({}, initialState), {}, { | ||
density: 'compact', | ||
columnVisibility: _objectSpread(_objectSpread({}, getColumnVisibility), initialState === null || initialState === void 0 ? void 0 : initialState.columnVisibility) | ||
density: 'compact' | ||
}), | ||
@@ -181,2 +178,8 @@ autoResetPageIndex: autoResetPageIndex, | ||
paginateExpandedRows: paginateExpandedRows, | ||
state: { | ||
columnVisibility: getColumnVisibility | ||
}, | ||
// Column visibility state is passed here | ||
onColumnVisibilityChange: setColumnVisibility, | ||
// Update visibility dynamically | ||
muiTableBodyProps: { | ||
@@ -183,0 +186,0 @@ sx: { |
{ | ||
"name": "bam32bittheme", | ||
"version": "2.1.102", | ||
"version": "2.1.103", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "32bit Theme for Material UI v5.x", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1573266
5405