@alaarab/ogrid-react-material 2.0.5 → 2.0.7
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.
|
@@ -10,7 +10,7 @@ import { COLUMN_HEADER_MENU_ITEMS } from '@alaarab/ogrid-core';
|
|
|
10
10
|
* Uses Material UI Menu component.
|
|
11
11
|
*/
|
|
12
12
|
export function ColumnHeaderMenu(props) {
|
|
13
|
-
const { columnId, isOpen, anchorElement, onClose, onPinLeft, onPinRight, onUnpin, canPinLeft, canPinRight, canUnpin, } = props;
|
|
13
|
+
const { columnId, isOpen: _isOpen, anchorElement: _anchorElement, onClose, onPinLeft, onPinRight, onUnpin, canPinLeft, canPinRight, canUnpin, } = props;
|
|
14
14
|
const [triggerEl, setTriggerEl] = React.useState(null);
|
|
15
15
|
const handleTriggerClick = (event) => {
|
|
16
16
|
event.stopPropagation();
|
|
@@ -173,7 +173,7 @@ function DataGridTableInner(props) {
|
|
|
173
173
|
const allowOverflowX = !suppressHorizontalScroll && containerWidth > 0 && (minTableWidth > containerWidth || desiredTableWidth > containerWidth);
|
|
174
174
|
// Density-aware cell padding
|
|
175
175
|
const densityPadding = useMemo(() => getDensityPadding(density), [density]);
|
|
176
|
-
const
|
|
176
|
+
const _cellSx = useMemo(() => ({ ...CELL_CONTENT_BASE_SX, ...densityPadding }), [densityPadding]);
|
|
177
177
|
const headerCellSx = useMemo(() => ({ px: densityPadding.px, py: densityPadding.py }), [densityPadding]);
|
|
178
178
|
// Memoize header rows (recursive tree traversal)
|
|
179
179
|
const headerRows = useMemo(() => buildHeaderRows(props.columns, props.visibleColumns), [props.columns, props.visibleColumns]);
|
|
@@ -260,7 +260,9 @@ function DataGridTableInner(props) {
|
|
|
260
260
|
// Select pre-computed sx variant (module-scope = no per-cell allocation)
|
|
261
261
|
const cellSx = getCellSx(col.type, descriptor.canEditAny, descriptor.isActive && !descriptor.isInRange, descriptor.isInRange, descriptor.isInCutRange);
|
|
262
262
|
const interactionProps = getCellInteractionProps(descriptor, col.columnId, interactionHandlers);
|
|
263
|
-
cellContent = (_jsxs(Box, { component: "div", ...interactionProps,
|
|
263
|
+
cellContent = (_jsxs(Box, { component: "div", ...interactionProps,
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
265
|
+
sx: Array.isArray(cellSx) ? [...cellSx, densityPadding] : { ...cellSx, ...densityPadding }, children: [styledContent, descriptor.canEditAny && descriptor.isSelectionEndCell && (_jsx(Box, { component: "div", onMouseDown: handleFillHandleMouseDown, "aria-label": "Fill handle", sx: FILL_HANDLE_SX }))] }));
|
|
264
266
|
}
|
|
265
267
|
return (_jsx(CellErrorBoundary, { onError: onCellError, children: cellContent }, `${rowId}-${col.columnId}`));
|
|
266
268
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-react-material",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "OGrid Material UI implementation – MUI Table–based data grid with sorting, filtering, pagination, column chooser, spreadsheet selection, and CSV export.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,11 +34,12 @@
|
|
|
34
34
|
"README.md",
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
|
+
"sideEffects": false,
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">=18"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@alaarab/ogrid-react": "2.0.
|
|
42
|
+
"@alaarab/ogrid-react": "2.0.7"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
45
|
"@emotion/react": "^11.0.0",
|
|
@@ -50,12 +51,12 @@
|
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@emotion/react": "^11.14.0",
|
|
53
|
-
"@emotion/styled": "^11.14.
|
|
54
|
-
"@mui/icons-material": "^7.
|
|
55
|
-
"@mui/material": "^7.
|
|
54
|
+
"@emotion/styled": "^11.14.1",
|
|
55
|
+
"@mui/icons-material": "^7.3.8",
|
|
56
|
+
"@mui/material": "^7.3.8",
|
|
56
57
|
"@storybook/react-vite": "10.2.8",
|
|
57
|
-
"@testing-library/jest-dom": "^6.
|
|
58
|
-
"@testing-library/react": "^16.
|
|
58
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
59
|
+
"@testing-library/react": "^16.3.2",
|
|
59
60
|
"@testing-library/user-event": "^14.6.1",
|
|
60
61
|
"@types/react": "^18.3.18",
|
|
61
62
|
"@types/react-dom": "^18.3.5",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"react": "^18.3.1",
|
|
64
65
|
"react-dom": "^18.3.1",
|
|
65
66
|
"storybook": "10.2.8",
|
|
66
|
-
"vite": "^7.
|
|
67
|
+
"vite": "^7.3.1"
|
|
67
68
|
},
|
|
68
69
|
"publishConfig": {
|
|
69
70
|
"access": "public"
|