@mui/x-data-grid-premium 9.0.0-beta.0 → 9.0.0

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,4 +1,26 @@
1
1
  import type { RefObject } from '@mui/x-internals/types';
2
+ import { type GridColDef, type GridRowId, type GridValidRowModel, type GridRowModel } from '@mui/x-data-grid';
2
3
  import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.mjs";
3
4
  import type { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.mjs";
5
+ export declare class CellValueUpdater {
6
+ rowsToUpdate: Map<GridRowId, GridValidRowModel>;
7
+ updateRow: (row: GridRowModel) => void;
8
+ options: {
9
+ apiRef: RefObject<GridPrivateApiPremium>;
10
+ processRowUpdate: DataGridPremiumProcessedProps['processRowUpdate'];
11
+ onProcessRowUpdateError: DataGridPremiumProcessedProps['onProcessRowUpdateError'];
12
+ getRowId: DataGridPremiumProcessedProps['getRowId'];
13
+ };
14
+ constructor(options: CellValueUpdater['options']);
15
+ updateCell({
16
+ rowId,
17
+ field,
18
+ pastedCellValue
19
+ }: {
20
+ rowId: GridRowId;
21
+ field: GridColDef['field'];
22
+ pastedCellValue: string;
23
+ }): void;
24
+ applyUpdates(): void;
25
+ }
4
26
  export declare const useGridClipboardImport: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "pagination" | "paginationMode" | "processRowUpdate" | "onProcessRowUpdateError" | "getRowId" | "onClipboardPasteStart" | "onClipboardPasteEnd" | "splitClipboardPastedText" | "disableClipboardPaste" | "onBeforeClipboardPasteStart" | "clipboardCopyCellDelimiter">) => void;
@@ -1,4 +1,26 @@
1
1
  import type { RefObject } from '@mui/x-internals/types';
2
+ import { type GridColDef, type GridRowId, type GridValidRowModel, type GridRowModel } from '@mui/x-data-grid';
2
3
  import type { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
3
4
  import type { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
5
+ export declare class CellValueUpdater {
6
+ rowsToUpdate: Map<GridRowId, GridValidRowModel>;
7
+ updateRow: (row: GridRowModel) => void;
8
+ options: {
9
+ apiRef: RefObject<GridPrivateApiPremium>;
10
+ processRowUpdate: DataGridPremiumProcessedProps['processRowUpdate'];
11
+ onProcessRowUpdateError: DataGridPremiumProcessedProps['onProcessRowUpdateError'];
12
+ getRowId: DataGridPremiumProcessedProps['getRowId'];
13
+ };
14
+ constructor(options: CellValueUpdater['options']);
15
+ updateCell({
16
+ rowId,
17
+ field,
18
+ pastedCellValue
19
+ }: {
20
+ rowId: GridRowId;
21
+ field: GridColDef['field'];
22
+ pastedCellValue: string;
23
+ }): void;
24
+ applyUpdates(): void;
25
+ }
4
26
  export declare const useGridClipboardImport: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "pagination" | "paginationMode" | "processRowUpdate" | "onProcessRowUpdateError" | "getRowId" | "onClipboardPasteStart" | "onClipboardPasteEnd" | "splitClipboardPastedText" | "disableClipboardPaste" | "onBeforeClipboardPasteStart" | "clipboardCopyCellDelimiter">) => void;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.useGridClipboardImport = void 0;
8
+ exports.useGridClipboardImport = exports.CellValueUpdater = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _xDataGrid = require("@mui/x-data-grid");
@@ -173,6 +173,7 @@ class CellValueUpdater {
173
173
  });
174
174
  }
175
175
  }
176
+ exports.CellValueUpdater = CellValueUpdater;
176
177
  function defaultPasteResolver({
177
178
  pastedData,
178
179
  apiRef,
@@ -287,6 +288,11 @@ const useGridClipboardImport = (apiRef, props) => {
287
288
  onBeforeClipboardPasteStart
288
289
  } = props;
289
290
  const handlePaste = React.useCallback(async (params, event) => {
291
+ // Ignore portal
292
+ // Do not apply shortcuts if the focus is not on the cell root component
293
+ if ((0, _internals.isEventTargetInPortal)(event)) {
294
+ return;
295
+ }
290
296
  if (!enableClipboardPaste) {
291
297
  return;
292
298
  }
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridEventPriority, useGridEvent, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector, gridRowSelectionIdsSelector, gridRowSelectionCountSelector } from '@mui/x-data-grid';
4
- import { getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef, isPasteShortcut, useGridLogger } from '@mui/x-data-grid/internals';
4
+ import { getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef, isPasteShortcut, useGridLogger, isEventTargetInPortal } from '@mui/x-data-grid/internals';
5
5
  import { warnOnce } from '@mui/x-internals/warning';
6
6
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
7
7
  import debounce from '@mui/utils/debounce';
@@ -52,8 +52,8 @@ async function getTextFromClipboard(rootEl) {
52
52
  }
53
53
 
54
54
  // Keeps track of updated rows during clipboard paste
55
- class CellValueUpdater {
56
- rowsToUpdate = (() => new Map())();
55
+ export class CellValueUpdater {
56
+ rowsToUpdate = new Map();
57
57
  constructor(options) {
58
58
  this.options = options;
59
59
  this.updateRow = batchRowUpdates(options.apiRef.current.updateRows, 50);
@@ -279,6 +279,11 @@ export const useGridClipboardImport = (apiRef, props) => {
279
279
  onBeforeClipboardPasteStart
280
280
  } = props;
281
281
  const handlePaste = React.useCallback(async (params, event) => {
282
+ // Ignore portal
283
+ // Do not apply shortcuts if the focus is not on the cell root component
284
+ if (isEventTargetInPortal(event)) {
285
+ return;
286
+ }
282
287
  if (!enableClipboardPaste) {
283
288
  return;
284
289
  }
@@ -100,7 +100,7 @@ const useGridRowsOverridableMethods = (apiRef, props) => {
100
100
  };
101
101
  return _rowGroupingReorderExecutor.rowGroupingReorderExecutor.execute(executionContext);
102
102
  }, [apiRef, processRowUpdate, onProcessRowUpdateError]);
103
- if (flatTree) {
103
+ if (flatTree && !props.treeData) {
104
104
  return {
105
105
  setRowIndex: setRowIndexPlain,
106
106
  setRowPosition: setRowPositionPlain
@@ -92,7 +92,7 @@ export const useGridRowsOverridableMethods = (apiRef, props) => {
92
92
  };
93
93
  return rowGroupingReorderExecutor.execute(executionContext);
94
94
  }, [apiRef, processRowUpdate, onProcessRowUpdateError]);
95
- if (flatTree) {
95
+ if (flatTree && !props.treeData) {
96
96
  return {
97
97
  setRowIndex: setRowIndexPlain,
98
98
  setRowPosition: setRowPositionPlain
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v9.0.0-beta.0
2
+ * @mui/x-data-grid-premium v9.0.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v9.0.0-beta.0
2
+ * @mui/x-data-grid-premium v9.0.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -100,6 +100,13 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
100
100
  * @default false
101
101
  */
102
102
  chartsIntegration: boolean;
103
+ /**
104
+ * If `true`, a fill handle is shown at the bottom-right corner of the cell selection.
105
+ * Dragging the fill handle fills target cells with the values from selected cells.
106
+ * Requires `cellSelection` to be enabled.
107
+ * @default false
108
+ */
109
+ cellSelectionFillHandle: boolean;
103
110
  /**
104
111
  * The maximum size of the history stack.
105
112
  * Set to 0 to disable the undo/redo feature.
@@ -100,6 +100,13 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
100
100
  * @default false
101
101
  */
102
102
  chartsIntegration: boolean;
103
+ /**
104
+ * If `true`, a fill handle is shown at the bottom-right corner of the cell selection.
105
+ * Dragging the fill handle fills target cells with the values from selected cells.
106
+ * Requires `cellSelection` to be enabled.
107
+ * @default false
108
+ */
109
+ cellSelectionFillHandle: boolean;
103
110
  /**
104
111
  * The maximum size of the history stack.
105
112
  * Set to 0 to disable the undo/redo feature.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-premium",
3
- "version": "9.0.0-beta.0",
3
+ "version": "9.0.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Premium plan edition of the MUI X Data Grid Components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -34,20 +34,20 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.28.6",
37
- "@mui/utils": "^7.3.7",
38
- "@mui/x-internal-exceljs-fork": "4.4.4",
37
+ "@mui/utils": "9.0.0",
38
+ "@mui/x-internal-exceljs-fork": "4.4.5",
39
39
  "clsx": "^2.1.1",
40
40
  "prop-types": "^15.8.1",
41
- "@mui/x-data-grid": "9.0.0-beta.0",
42
- "@mui/x-data-grid-pro": "9.0.0-beta.0",
43
- "@mui/x-internals": "9.0.0-alpha.4",
44
- "@mui/x-license": "9.0.0-beta.0"
41
+ "@mui/x-data-grid-pro": "^9.0.0",
42
+ "@mui/x-internals": "^9.0.0",
43
+ "@mui/x-data-grid": "^9.0.0",
44
+ "@mui/x-license": "^9.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@emotion/react": "^11.9.0",
48
48
  "@emotion/styled": "^11.8.1",
49
- "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0",
50
- "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0",
49
+ "@mui/material": "^7.3.0 || ^9.0.0",
50
+ "@mui/system": "^7.3.0 || ^9.0.0",
51
51
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
52
52
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
53
53
  },