@mui/x-data-grid-premium 6.19.6 → 6.19.8
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/CHANGELOG.md +48 -0
- package/DataGridPremium/DataGridPremium.js +8 -0
- package/hooks/features/cellSelection/useGridCellSelection.js +2 -1
- package/hooks/features/clipboard/useGridClipboardImport.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboardImport.js +18 -3
- package/index.js +1 -1
- package/legacy/DataGridPremium/DataGridPremium.js +8 -0
- package/legacy/hooks/features/cellSelection/useGridCellSelection.js +2 -1
- package/legacy/hooks/features/clipboard/useGridClipboardImport.js +26 -5
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/models/dataGridPremiumProps.d.ts +10 -0
- package/modern/DataGridPremium/DataGridPremium.js +8 -0
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +2 -1
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +18 -3
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPremium/DataGridPremium.js +8 -0
- package/node/hooks/features/cellSelection/useGridCellSelection.js +2 -1
- package/node/hooks/features/clipboard/useGridClipboardImport.js +17 -2
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,54 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.19.8
|
|
7
|
+
|
|
8
|
+
_Mar 20, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 3 contributors who made this release possible.
|
|
11
|
+
|
|
12
|
+
### Data Grid
|
|
13
|
+
|
|
14
|
+
#### `@mui/x-data-grid@6.19.8`
|
|
15
|
+
|
|
16
|
+
- [DataGrid] Fix `ElementType` usage (#12505) @cherniavskii
|
|
17
|
+
- [DataGrid] Fix cell value formatting on copy (#12483) @sai6855
|
|
18
|
+
- [DataGrid] Fix checkbox selection when filtering (#12485) @g1mishra
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid-pro@6.19.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
21
|
+
|
|
22
|
+
Same changes as in `@mui/x-data-grid@6.19.8`.
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid-premium@6.19.8` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
25
|
+
|
|
26
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.8`, plus:
|
|
27
|
+
|
|
28
|
+
- [DataGridPremium] Add support for confirmation before clipboard paste (#12466) @cherniavskii
|
|
29
|
+
|
|
30
|
+
### Docs
|
|
31
|
+
|
|
32
|
+
- [docs] Update links to v7 (#12495) @cherniavskii
|
|
33
|
+
|
|
34
|
+
## 6.19.7
|
|
35
|
+
|
|
36
|
+
_Mar 14, 2024_
|
|
37
|
+
|
|
38
|
+
We'd like to offer a big thanks to @LukasTy who made this release possible.
|
|
39
|
+
|
|
40
|
+
### Date Pickers
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers@6.19.7`
|
|
43
|
+
|
|
44
|
+
- [pickers] Keep the existing time when looking for closest enabled date (#12410) @LukasTy
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers-pro@6.19.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
47
|
+
|
|
48
|
+
Same changes as in `@mui/x-date-pickers@6.19.7`.
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [docs] Add Pickers custom start of week section (#12425) @LukasTy
|
|
53
|
+
|
|
6
54
|
## 6.19.6
|
|
7
55
|
|
|
8
56
|
_Mar 1, 2024_
|
|
@@ -489,6 +489,14 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
489
489
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
490
490
|
*/
|
|
491
491
|
onAggregationModelChange: PropTypes.func,
|
|
492
|
+
/**
|
|
493
|
+
* Callback fired before the clipboard paste operation starts.
|
|
494
|
+
* Use it to confirm or cancel the paste operation.
|
|
495
|
+
* @param {object} params Params passed to the callback.
|
|
496
|
+
* @param {string[][]} params.data The raw pasted data split by rows and cells.
|
|
497
|
+
* @returns {Promise<any>} A promise that resolves to confirm the paste operation, and rejects to cancel it.
|
|
498
|
+
*/
|
|
499
|
+
onBeforeClipboardPasteStart: PropTypes.func,
|
|
492
500
|
/**
|
|
493
501
|
* Callback fired when any cell is clicked.
|
|
494
502
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -456,7 +456,8 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
456
456
|
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
457
457
|
cellData = serializeCellValue(cellParams, {
|
|
458
458
|
delimiterCharacter: clipboardCopyCellDelimiter,
|
|
459
|
-
ignoreValueFormatter
|
|
459
|
+
ignoreValueFormatter,
|
|
460
|
+
shouldAppendQuotes: true
|
|
460
461
|
});
|
|
461
462
|
} else {
|
|
462
463
|
cellData = '';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
3
3
|
import type { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
-
export declare const useGridClipboardImport: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'pagination' | 'paginationMode' | 'processRowUpdate' | 'onProcessRowUpdateError' | 'getRowId' | 'onClipboardPasteStart' | 'onClipboardPasteEnd' | 'experimentalFeatures' | 'unstable_splitClipboardPastedText' | 'disableClipboardPaste'>) => void;
|
|
4
|
+
export declare const useGridClipboardImport: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'pagination' | 'paginationMode' | 'processRowUpdate' | 'onProcessRowUpdateError' | 'getRowId' | 'onClipboardPasteStart' | 'onClipboardPasteEnd' | 'experimentalFeatures' | 'unstable_splitClipboardPastedText' | 'disableClipboardPaste' | 'onBeforeClipboardPasteStart'>) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid';
|
|
3
|
+
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector, useGridLogger } from '@mui/x-data-grid';
|
|
4
4
|
import { buildWarning, getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
@@ -249,7 +249,12 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
249
249
|
const getRowId = props.getRowId;
|
|
250
250
|
const enableClipboardPaste = (_ref = !props.disableClipboardPaste && ((_props$experimentalFe = props.experimentalFeatures) == null ? void 0 : _props$experimentalFe.clipboardPaste)) != null ? _ref : false;
|
|
251
251
|
const rootEl = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE.current;
|
|
252
|
+
const logger = useGridLogger(apiRef, 'useGridClipboardImport');
|
|
252
253
|
const splitClipboardPastedText = props.unstable_splitClipboardPastedText;
|
|
254
|
+
const {
|
|
255
|
+
pagination,
|
|
256
|
+
onBeforeClipboardPasteStart
|
|
257
|
+
} = props;
|
|
253
258
|
const handlePaste = React.useCallback(async (params, event) => {
|
|
254
259
|
if (!enableClipboardPaste) {
|
|
255
260
|
return;
|
|
@@ -276,6 +281,16 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
276
281
|
if (!pastedData) {
|
|
277
282
|
return;
|
|
278
283
|
}
|
|
284
|
+
if (onBeforeClipboardPasteStart) {
|
|
285
|
+
try {
|
|
286
|
+
await onBeforeClipboardPasteStart({
|
|
287
|
+
data: pastedData
|
|
288
|
+
});
|
|
289
|
+
} catch (error) {
|
|
290
|
+
logger.debug('Clipboard paste operation cancelled');
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
279
294
|
const cellUpdater = new CellValueUpdater({
|
|
280
295
|
apiRef,
|
|
281
296
|
processRowUpdate,
|
|
@@ -291,10 +306,10 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
291
306
|
updateCell: (...args) => {
|
|
292
307
|
cellUpdater.updateCell(...args);
|
|
293
308
|
},
|
|
294
|
-
pagination
|
|
309
|
+
pagination
|
|
295
310
|
});
|
|
296
311
|
cellUpdater.applyUpdates();
|
|
297
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText,
|
|
312
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
298
313
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
299
314
|
event
|
|
300
315
|
}) => {
|
package/index.js
CHANGED
|
@@ -489,6 +489,14 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
489
489
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
490
490
|
*/
|
|
491
491
|
onAggregationModelChange: PropTypes.func,
|
|
492
|
+
/**
|
|
493
|
+
* Callback fired before the clipboard paste operation starts.
|
|
494
|
+
* Use it to confirm or cancel the paste operation.
|
|
495
|
+
* @param {object} params Params passed to the callback.
|
|
496
|
+
* @param {string[][]} params.data The raw pasted data split by rows and cells.
|
|
497
|
+
* @returns {Promise<any>} A promise that resolves to confirm the paste operation, and rejects to cancel it.
|
|
498
|
+
*/
|
|
499
|
+
onBeforeClipboardPasteStart: PropTypes.func,
|
|
492
500
|
/**
|
|
493
501
|
* Callback fired when any cell is clicked.
|
|
494
502
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -442,7 +442,8 @@ export var useGridCellSelection = function useGridCellSelection(apiRef, props) {
|
|
|
442
442
|
var cellParams = apiRef.current.getCellParams(rowId, field);
|
|
443
443
|
cellData = serializeCellValue(cellParams, {
|
|
444
444
|
delimiterCharacter: clipboardCopyCellDelimiter,
|
|
445
|
-
ignoreValueFormatter: ignoreValueFormatter
|
|
445
|
+
ignoreValueFormatter: ignoreValueFormatter,
|
|
446
|
+
shouldAppendQuotes: true
|
|
446
447
|
});
|
|
447
448
|
} else {
|
|
448
449
|
cellData = '';
|
|
@@ -4,7 +4,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid';
|
|
7
|
+
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector, useGridLogger } from '@mui/x-data-grid';
|
|
8
8
|
import { buildWarning, getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
|
|
10
10
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
@@ -294,7 +294,10 @@ export var useGridClipboardImport = function useGridClipboardImport(apiRef, prop
|
|
|
294
294
|
var getRowId = props.getRowId;
|
|
295
295
|
var enableClipboardPaste = (_ref4 = !props.disableClipboardPaste && ((_props$experimentalFe = props.experimentalFeatures) == null ? void 0 : _props$experimentalFe.clipboardPaste)) != null ? _ref4 : false;
|
|
296
296
|
var rootEl = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE.current;
|
|
297
|
+
var logger = useGridLogger(apiRef, 'useGridClipboardImport');
|
|
297
298
|
var splitClipboardPastedText = props.unstable_splitClipboardPastedText;
|
|
299
|
+
var pagination = props.pagination,
|
|
300
|
+
onBeforeClipboardPasteStart = props.onBeforeClipboardPasteStart;
|
|
298
301
|
var handlePaste = React.useCallback( /*#__PURE__*/function () {
|
|
299
302
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(params, event) {
|
|
300
303
|
var focusedCell, cellMode, text, pastedData, cellUpdater;
|
|
@@ -348,6 +351,24 @@ export var useGridClipboardImport = function useGridClipboardImport(apiRef, prop
|
|
|
348
351
|
}
|
|
349
352
|
return _context2.abrupt("return");
|
|
350
353
|
case 19:
|
|
354
|
+
if (!onBeforeClipboardPasteStart) {
|
|
355
|
+
_context2.next = 29;
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
_context2.prev = 20;
|
|
359
|
+
_context2.next = 23;
|
|
360
|
+
return onBeforeClipboardPasteStart({
|
|
361
|
+
data: pastedData
|
|
362
|
+
});
|
|
363
|
+
case 23:
|
|
364
|
+
_context2.next = 29;
|
|
365
|
+
break;
|
|
366
|
+
case 25:
|
|
367
|
+
_context2.prev = 25;
|
|
368
|
+
_context2.t0 = _context2["catch"](20);
|
|
369
|
+
logger.debug('Clipboard paste operation cancelled');
|
|
370
|
+
return _context2.abrupt("return");
|
|
371
|
+
case 29:
|
|
351
372
|
cellUpdater = new CellValueUpdater({
|
|
352
373
|
apiRef: apiRef,
|
|
353
374
|
processRowUpdate: processRowUpdate,
|
|
@@ -363,19 +384,19 @@ export var useGridClipboardImport = function useGridClipboardImport(apiRef, prop
|
|
|
363
384
|
updateCell: function updateCell() {
|
|
364
385
|
cellUpdater.updateCell.apply(cellUpdater, arguments);
|
|
365
386
|
},
|
|
366
|
-
pagination:
|
|
387
|
+
pagination: pagination
|
|
367
388
|
});
|
|
368
389
|
cellUpdater.applyUpdates();
|
|
369
|
-
case
|
|
390
|
+
case 33:
|
|
370
391
|
case "end":
|
|
371
392
|
return _context2.stop();
|
|
372
393
|
}
|
|
373
|
-
}, _callee2);
|
|
394
|
+
}, _callee2, null, [[20, 25]]);
|
|
374
395
|
}));
|
|
375
396
|
return function (_x3, _x4) {
|
|
376
397
|
return _ref5.apply(this, arguments);
|
|
377
398
|
};
|
|
378
|
-
}(), [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText,
|
|
399
|
+
}(), [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
379
400
|
var checkIfCanStartEditing = React.useCallback(function (initialValue, _ref6) {
|
|
380
401
|
var event = _ref6.event;
|
|
381
402
|
if (isPasteShortcut(event) && enableClipboardPaste) {
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTcxMDg4NTYwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -143,6 +143,16 @@ export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowM
|
|
|
143
143
|
* @param {string} inProgress Indicates if the task is in progress.
|
|
144
144
|
*/
|
|
145
145
|
onExcelExportStateChange?: (inProgress: 'pending' | 'finished') => void;
|
|
146
|
+
/**
|
|
147
|
+
* Callback fired before the clipboard paste operation starts.
|
|
148
|
+
* Use it to confirm or cancel the paste operation.
|
|
149
|
+
* @param {object} params Params passed to the callback.
|
|
150
|
+
* @param {string[][]} params.data The raw pasted data split by rows and cells.
|
|
151
|
+
* @returns {Promise<any>} A promise that resolves to confirm the paste operation, and rejects to cancel it.
|
|
152
|
+
*/
|
|
153
|
+
onBeforeClipboardPasteStart?: (params: {
|
|
154
|
+
data: string[][];
|
|
155
|
+
}) => Promise<any>;
|
|
146
156
|
/**
|
|
147
157
|
* Callback fired when the clipboard paste operation starts.
|
|
148
158
|
*/
|
|
@@ -489,6 +489,14 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
489
489
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
490
490
|
*/
|
|
491
491
|
onAggregationModelChange: PropTypes.func,
|
|
492
|
+
/**
|
|
493
|
+
* Callback fired before the clipboard paste operation starts.
|
|
494
|
+
* Use it to confirm or cancel the paste operation.
|
|
495
|
+
* @param {object} params Params passed to the callback.
|
|
496
|
+
* @param {string[][]} params.data The raw pasted data split by rows and cells.
|
|
497
|
+
* @returns {Promise<any>} A promise that resolves to confirm the paste operation, and rejects to cancel it.
|
|
498
|
+
*/
|
|
499
|
+
onBeforeClipboardPasteStart: PropTypes.func,
|
|
492
500
|
/**
|
|
493
501
|
* Callback fired when any cell is clicked.
|
|
494
502
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -447,7 +447,8 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
447
447
|
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
448
448
|
cellData = serializeCellValue(cellParams, {
|
|
449
449
|
delimiterCharacter: clipboardCopyCellDelimiter,
|
|
450
|
-
ignoreValueFormatter
|
|
450
|
+
ignoreValueFormatter,
|
|
451
|
+
shouldAppendQuotes: true
|
|
451
452
|
});
|
|
452
453
|
} else {
|
|
453
454
|
cellData = '';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid';
|
|
3
|
+
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector, useGridLogger } from '@mui/x-data-grid';
|
|
4
4
|
import { buildWarning, getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
@@ -247,7 +247,12 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
247
247
|
const getRowId = props.getRowId;
|
|
248
248
|
const enableClipboardPaste = (!props.disableClipboardPaste && props.experimentalFeatures?.clipboardPaste) ?? false;
|
|
249
249
|
const rootEl = apiRef.current.rootElementRef?.current;
|
|
250
|
+
const logger = useGridLogger(apiRef, 'useGridClipboardImport');
|
|
250
251
|
const splitClipboardPastedText = props.unstable_splitClipboardPastedText;
|
|
252
|
+
const {
|
|
253
|
+
pagination,
|
|
254
|
+
onBeforeClipboardPasteStart
|
|
255
|
+
} = props;
|
|
251
256
|
const handlePaste = React.useCallback(async (params, event) => {
|
|
252
257
|
if (!enableClipboardPaste) {
|
|
253
258
|
return;
|
|
@@ -274,6 +279,16 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
274
279
|
if (!pastedData) {
|
|
275
280
|
return;
|
|
276
281
|
}
|
|
282
|
+
if (onBeforeClipboardPasteStart) {
|
|
283
|
+
try {
|
|
284
|
+
await onBeforeClipboardPasteStart({
|
|
285
|
+
data: pastedData
|
|
286
|
+
});
|
|
287
|
+
} catch (error) {
|
|
288
|
+
logger.debug('Clipboard paste operation cancelled');
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
277
292
|
const cellUpdater = new CellValueUpdater({
|
|
278
293
|
apiRef,
|
|
279
294
|
processRowUpdate,
|
|
@@ -289,10 +304,10 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
289
304
|
updateCell: (...args) => {
|
|
290
305
|
cellUpdater.updateCell(...args);
|
|
291
306
|
},
|
|
292
|
-
pagination
|
|
307
|
+
pagination
|
|
293
308
|
});
|
|
294
309
|
cellUpdater.applyUpdates();
|
|
295
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText,
|
|
310
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
296
311
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
297
312
|
event
|
|
298
313
|
}) => {
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcxMDg4NTYwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -497,6 +497,14 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
497
497
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
498
498
|
*/
|
|
499
499
|
onAggregationModelChange: _propTypes.default.func,
|
|
500
|
+
/**
|
|
501
|
+
* Callback fired before the clipboard paste operation starts.
|
|
502
|
+
* Use it to confirm or cancel the paste operation.
|
|
503
|
+
* @param {object} params Params passed to the callback.
|
|
504
|
+
* @param {string[][]} params.data The raw pasted data split by rows and cells.
|
|
505
|
+
* @returns {Promise<any>} A promise that resolves to confirm the paste operation, and rejects to cancel it.
|
|
506
|
+
*/
|
|
507
|
+
onBeforeClipboardPasteStart: _propTypes.default.func,
|
|
500
508
|
/**
|
|
501
509
|
* Callback fired when any cell is clicked.
|
|
502
510
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -457,7 +457,8 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
457
457
|
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
458
458
|
cellData = (0, _internals.serializeCellValue)(cellParams, {
|
|
459
459
|
delimiterCharacter: clipboardCopyCellDelimiter,
|
|
460
|
-
ignoreValueFormatter
|
|
460
|
+
ignoreValueFormatter,
|
|
461
|
+
shouldAppendQuotes: true
|
|
461
462
|
});
|
|
462
463
|
} else {
|
|
463
464
|
cellData = '';
|
|
@@ -256,7 +256,12 @@ const useGridClipboardImport = (apiRef, props) => {
|
|
|
256
256
|
const getRowId = props.getRowId;
|
|
257
257
|
const enableClipboardPaste = (!props.disableClipboardPaste && props.experimentalFeatures?.clipboardPaste) ?? false;
|
|
258
258
|
const rootEl = apiRef.current.rootElementRef?.current;
|
|
259
|
+
const logger = (0, _xDataGrid.useGridLogger)(apiRef, 'useGridClipboardImport');
|
|
259
260
|
const splitClipboardPastedText = props.unstable_splitClipboardPastedText;
|
|
261
|
+
const {
|
|
262
|
+
pagination,
|
|
263
|
+
onBeforeClipboardPasteStart
|
|
264
|
+
} = props;
|
|
260
265
|
const handlePaste = React.useCallback(async (params, event) => {
|
|
261
266
|
if (!enableClipboardPaste) {
|
|
262
267
|
return;
|
|
@@ -283,6 +288,16 @@ const useGridClipboardImport = (apiRef, props) => {
|
|
|
283
288
|
if (!pastedData) {
|
|
284
289
|
return;
|
|
285
290
|
}
|
|
291
|
+
if (onBeforeClipboardPasteStart) {
|
|
292
|
+
try {
|
|
293
|
+
await onBeforeClipboardPasteStart({
|
|
294
|
+
data: pastedData
|
|
295
|
+
});
|
|
296
|
+
} catch (error) {
|
|
297
|
+
logger.debug('Clipboard paste operation cancelled');
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
286
301
|
const cellUpdater = new CellValueUpdater({
|
|
287
302
|
apiRef,
|
|
288
303
|
processRowUpdate,
|
|
@@ -298,10 +313,10 @@ const useGridClipboardImport = (apiRef, props) => {
|
|
|
298
313
|
updateCell: (...args) => {
|
|
299
314
|
cellUpdater.updateCell(...args);
|
|
300
315
|
},
|
|
301
|
-
pagination
|
|
316
|
+
pagination
|
|
302
317
|
});
|
|
303
318
|
cellUpdater.applyUpdates();
|
|
304
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText,
|
|
319
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
305
320
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
306
321
|
event
|
|
307
322
|
}) => {
|
package/node/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTcxMDg4NTYwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-premium",
|
|
3
|
-
"version": "6.19.
|
|
3
|
+
"version": "6.19.8",
|
|
4
4
|
"description": "The Premium plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.23.2",
|
|
35
35
|
"@mui/utils": "^5.14.16",
|
|
36
|
-
"@mui/x-data-grid": "6.19.
|
|
37
|
-
"@mui/x-data-grid-pro": "6.19.
|
|
36
|
+
"@mui/x-data-grid": "6.19.8",
|
|
37
|
+
"@mui/x-data-grid-pro": "6.19.8",
|
|
38
38
|
"@mui/x-license-pro": "6.10.2",
|
|
39
39
|
"@types/format-util": "^1.0.3",
|
|
40
40
|
"clsx": "^2.0.0",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcxMDg4NTYwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|