@alaarab/ogrid-react-material 2.0.15 → 2.0.16
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo, useEffect, useState } from 'react';
|
|
3
3
|
import { Menu, MenuItem, Divider } from '@mui/material';
|
|
4
|
-
import { getColumnHeaderMenuItems } from '@alaarab/ogrid-
|
|
4
|
+
import { getColumnHeaderMenuItems } from '@alaarab/ogrid-react';
|
|
5
5
|
/**
|
|
6
6
|
* Column header dropdown menu for pin/sort/autosize actions.
|
|
7
7
|
* Uses Material UI Menu component with anchor position.
|
|
@@ -14,6 +14,21 @@ import { DropIndicator } from './DropIndicator';
|
|
|
14
14
|
import { useDataGridTableOrchestration, getHeaderFilterConfig, getCellRenderDescriptor, MarchingAntsOverlay, resolveCellDisplayContent, resolveCellStyle, buildInlineEditorProps, buildPopoverEditorProps, getCellInteractionProps, areGridRowPropsEqual, CellErrorBoundary, CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, DEFAULT_MIN_COLUMN_WIDTH, PREVENT_DEFAULT, NOOP, STOP_PROPAGATION, } from '@alaarab/ogrid-react';
|
|
15
15
|
// ── Module-scope stable styles (avoid per-render Emotion resolutions) ──
|
|
16
16
|
const gridRootSx = { position: 'relative', flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' };
|
|
17
|
+
// Editing cell wrapper (plain div, not MUI)
|
|
18
|
+
const EDITING_CELL_STYLE = {
|
|
19
|
+
width: '100%',
|
|
20
|
+
height: '100%',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
boxSizing: 'border-box',
|
|
24
|
+
outline: '2px solid var(--ogrid-selection-color, #217346)',
|
|
25
|
+
outlineOffset: '-1px',
|
|
26
|
+
zIndex: 2,
|
|
27
|
+
position: 'relative',
|
|
28
|
+
background: 'var(--ogrid-bg, #fff)',
|
|
29
|
+
overflow: 'visible',
|
|
30
|
+
padding: 0,
|
|
31
|
+
};
|
|
17
32
|
// Row
|
|
18
33
|
const ROW_HOVER_SX = { '&:hover': { bgcolor: 'action.hover' } };
|
|
19
34
|
// Checkbox column
|
|
@@ -232,7 +247,7 @@ function DataGridTableInner(props) {
|
|
|
232
247
|
const rowId = getRowId(item);
|
|
233
248
|
let cellContent;
|
|
234
249
|
if (descriptor.mode === 'editing-inline') {
|
|
235
|
-
cellContent = _jsx(InlineCellEditor, { ...buildInlineEditorProps(item, col, descriptor, editCallbacks) });
|
|
250
|
+
cellContent = (_jsx("div", { style: EDITING_CELL_STYLE, children: _jsx(InlineCellEditor, { ...buildInlineEditorProps(item, col, descriptor, editCallbacks) }) }));
|
|
236
251
|
}
|
|
237
252
|
else if (descriptor.mode === 'editing-popover' && typeof col.cellEditor === 'function') {
|
|
238
253
|
const editorProps = buildPopoverEditorProps(item, col, descriptor, pendingEditorValueRef.current, editCallbacks);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Checkbox
|
|
3
|
-
import { BaseInlineCellEditor
|
|
2
|
+
import { Checkbox } from '@mui/material';
|
|
3
|
+
import { BaseInlineCellEditor } from '@alaarab/ogrid-react';
|
|
4
4
|
export function InlineCellEditor(props) {
|
|
5
|
-
return (_jsx(BaseInlineCellEditor, { ...props, renderCheckbox: (checked, onCommit, onCancel) => (_jsx(Checkbox, { checked: checked, onChange: (_, c) => onCommit(c), onKeyDown: (e) => e.key === 'Escape' && (e.preventDefault(), onCancel()), size: "small" }))
|
|
5
|
+
return (_jsx(BaseInlineCellEditor, { ...props, renderCheckbox: (checked, onCommit, onCancel) => (_jsx(Checkbox, { checked: checked, onChange: (_, c) => onCommit(c), onKeyDown: (e) => e.key === 'Escape' && (e.preventDefault(), onCancel()), size: "small" })) }));
|
|
6
6
|
}
|
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.16",
|
|
4
4
|
"description": "OGrid React Material 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",
|