@mui/x-data-grid 5.17.18 → 5.17.20
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 +49 -0
- package/components/columnHeaders/GridColumnHeaders.js +1 -0
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -1
- package/hooks/features/export/useGridPrintExport.js +31 -17
- package/hooks/features/virtualization/useGridVirtualScroller.js +2 -6
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/legacy/components/columnHeaders/GridColumnHeaders.js +1 -0
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -1
- package/legacy/hooks/features/export/useGridPrintExport.js +33 -20
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +2 -6
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/esES.js +27 -27
- package/legacy/locales/svSE.js +10 -10
- package/legacy/utils/utils.js +1 -1
- package/locales/esES.js +27 -27
- package/locales/svSE.js +10 -10
- package/models/api/gridParamsApi.d.ts +1 -1
- package/modern/components/columnHeaders/GridColumnHeaders.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -1
- package/modern/hooks/features/export/useGridPrintExport.js +30 -16
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -6
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/esES.js +27 -27
- package/modern/locales/svSE.js +10 -10
- package/modern/utils/utils.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaders.js +1 -0
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -1
- package/node/hooks/features/export/useGridPrintExport.js +31 -17
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -6
- package/node/index.js +1 -1
- package/node/internals/index.js +6 -0
- package/node/locales/esES.js +27 -27
- package/node/locales/svSE.js +10 -10
- package/node/utils/utils.js +1 -1
- package/package.json +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,55 @@
|
|
|
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
|
+
## 5.17.20
|
|
7
|
+
|
|
8
|
+
_Jan 19, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Italian (it-IT) and Swedish (sv-SE) locales
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
|
|
15
|
+
### `@mui/x-data-grid@v5.17.20` / `@mui/x-data-grid-pro@v5.17.20` / `@mui/x-data-grid-premium@v5.17.20`
|
|
16
|
+
|
|
17
|
+
#### Changes
|
|
18
|
+
|
|
19
|
+
- [DataGrid] Fix flickering on grid scroll (#7609) @cherniavskii
|
|
20
|
+
- [DataGrid] Remove tag limit from `isAnyOf` operator input (#7616) @m4theushw
|
|
21
|
+
- [l10n] Improve Swedish (sv-SE) locale (#7463) @MaanTyringe
|
|
22
|
+
|
|
23
|
+
### `@mui/x-date-pickers@v5.0.15` / `@mui/x-date-pickers-pro@v5.0.15`
|
|
24
|
+
|
|
25
|
+
#### Changes
|
|
26
|
+
|
|
27
|
+
- [pickers] Ensure `key` is passed without object spreading (#7584) @alexfauquette
|
|
28
|
+
- [l10n] Improve Italian (it-IT) locale (#7547) @marikadeveloper
|
|
29
|
+
|
|
30
|
+
## 5.17.19
|
|
31
|
+
|
|
32
|
+
_Jan 16, 2023_
|
|
33
|
+
|
|
34
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
35
|
+
|
|
36
|
+
- 🌍 Improve Spanish (es-ES) and add Belarusian (be-BY) and Urdu (ur-PK) locales
|
|
37
|
+
- 🐞 Bugfixes
|
|
38
|
+
|
|
39
|
+
### `@mui/x-data-grid@v5.17.19` / `@mui/x-data-grid-pro@v5.17.19` / `@mui/x-data-grid-premium@v5.17.19`
|
|
40
|
+
|
|
41
|
+
#### Changes
|
|
42
|
+
|
|
43
|
+
- [DataGrid] Improve print support (#7407) @cherniavskii
|
|
44
|
+
- [DataGrid] Improve Spanish (es-ES) locale (#7438) @Anderssxn
|
|
45
|
+
- [DataGridPremium] Fix Excel export not working with date strings (#7478) @cherniavskii
|
|
46
|
+
- [DataGridPro] Fix missing column headers border with top-pinned rows (#7399) @cherniavskii
|
|
47
|
+
|
|
48
|
+
### `@mui/x-date-pickers@v5.0.14` / `@mui/x-date-pickers-pro@v5.0.14`
|
|
49
|
+
|
|
50
|
+
#### Changes
|
|
51
|
+
|
|
52
|
+
- [pickers] Add Belarusian (be-BY) locale (#7450) @volhalink
|
|
53
|
+
- [pickers] Add Urdu (ur-PK) locale (#7449) @MBilalShafi
|
|
54
|
+
|
|
6
55
|
## 5.17.18
|
|
7
56
|
|
|
8
57
|
_Jan 5, 2023_
|
|
@@ -35,6 +35,7 @@ const GridColumnHeadersRoot = styled('div', {
|
|
|
35
35
|
overflow: 'hidden',
|
|
36
36
|
display: 'flex',
|
|
37
37
|
alignItems: 'center',
|
|
38
|
+
boxSizing: 'border-box',
|
|
38
39
|
borderBottom: `1px solid ${borderColor}`,
|
|
39
40
|
borderTopLeftRadius: theme.shape.borderRadius,
|
|
40
41
|
borderTopRightRadius: theme.shape.borderRadius
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { AutocompleteProps } from '@mui/material/Autocomplete';
|
|
3
3
|
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
|
|
4
4
|
import type { ValueOptions } from '../../../models/colDef/gridColDef';
|
|
5
|
-
export interface GridFilterInputMultipleSingleSelectProps extends Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options' | 'renderInput' | 'onChange' | 'value' | 'id' | 'filterOptions' | 'isOptionEqualToValue' | '
|
|
5
|
+
export interface GridFilterInputMultipleSingleSelectProps extends Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options' | 'renderInput' | 'onChange' | 'value' | 'id' | 'filterOptions' | 'isOptionEqualToValue' | 'multiple' | 'color'>, GridFilterInputValueProps {
|
|
6
6
|
type?: 'singleSelect';
|
|
7
7
|
}
|
|
8
8
|
declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): JSX.Element;
|
|
@@ -105,7 +105,6 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
105
105
|
}, [applyValue, item]);
|
|
106
106
|
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
107
107
|
multiple: true,
|
|
108
|
-
limitTags: 1,
|
|
109
108
|
options: resolvedValueOptions,
|
|
110
109
|
isOptionEqualToValue: isOptionEqualToValue,
|
|
111
110
|
filterOptions: filter,
|
|
@@ -13,6 +13,14 @@ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
|
13
13
|
import { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
|
|
16
|
+
function raf() {
|
|
17
|
+
return new Promise(resolve => {
|
|
18
|
+
requestAnimationFrame(() => {
|
|
19
|
+
resolve();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
* @requires useGridColumns (state)
|
|
18
26
|
* @requires useGridFilter (state)
|
|
@@ -30,6 +38,7 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
30
38
|
// the new state needs to be in place before the grid can be sized correctly
|
|
31
39
|
|
|
32
40
|
const updateGridColumnsForPrint = React.useCallback((fields, allColumns) => new Promise(resolve => {
|
|
41
|
+
// TODO remove unused Promise
|
|
33
42
|
if (!fields && !allColumns) {
|
|
34
43
|
resolve();
|
|
35
44
|
return;
|
|
@@ -49,12 +58,10 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
49
58
|
});
|
|
50
59
|
apiRef.current.setColumnVisibilityModel(newColumnVisibilityModel);
|
|
51
60
|
resolve();
|
|
52
|
-
}), [apiRef]);
|
|
61
|
+
}), [apiRef]); // TODO move outside of this scope and remove React.useCallback
|
|
62
|
+
|
|
53
63
|
const buildPrintWindow = React.useCallback(title => {
|
|
54
64
|
const iframeEl = document.createElement('iframe');
|
|
55
|
-
iframeEl.id = 'grid-print-window'; // Without this 'onload' event won't fire in some browsers
|
|
56
|
-
|
|
57
|
-
iframeEl.src = window.location.href;
|
|
58
65
|
iframeEl.style.position = 'absolute';
|
|
59
66
|
iframeEl.style.width = '0px';
|
|
60
67
|
iframeEl.style.height = '0px';
|
|
@@ -62,18 +69,15 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
62
69
|
return iframeEl;
|
|
63
70
|
}, []);
|
|
64
71
|
const handlePrintWindowLoad = React.useCallback((printWindow, options) => {
|
|
65
|
-
var
|
|
72
|
+
var _querySelector, _querySelector2;
|
|
66
73
|
|
|
67
74
|
const normalizeOptions = _extends({
|
|
68
75
|
copyStyles: true,
|
|
69
76
|
hideToolbar: false,
|
|
70
77
|
hideFooter: false
|
|
71
|
-
}, options);
|
|
72
|
-
// `onload` callback. This ensures that it is only called once.
|
|
78
|
+
}, options);
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
printWindow.onload = null;
|
|
76
|
-
const printDoc = printWindow.contentDocument || ((_printWindow$contentW = printWindow.contentWindow) == null ? void 0 : _printWindow$contentW.document);
|
|
80
|
+
const printDoc = printWindow.contentDocument;
|
|
77
81
|
|
|
78
82
|
if (!printDoc) {
|
|
79
83
|
return;
|
|
@@ -113,10 +117,12 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
113
117
|
} // Expand container height to accommodate all rows
|
|
114
118
|
|
|
115
119
|
|
|
116
|
-
gridClone.style.height = `${rowsMeta.currentPageTotalHeight + totalHeaderHeight + gridToolbarElementHeight + gridFooterElementHeight}px`; //
|
|
120
|
+
gridClone.style.height = `${rowsMeta.currentPageTotalHeight + totalHeaderHeight + gridToolbarElementHeight + gridFooterElementHeight}px`; // printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
|
|
121
|
+
// prevents us to do it
|
|
117
122
|
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
const container = document.createElement('div');
|
|
124
|
+
container.appendChild(gridClone);
|
|
125
|
+
printDoc.body.innerHTML = container.innerHTML;
|
|
120
126
|
const defaultPageStyle = typeof normalizeOptions.pageStyle === 'function' ? normalizeOptions.pageStyle() : normalizeOptions.pageStyle;
|
|
121
127
|
|
|
122
128
|
if (typeof defaultPageStyle === 'string') {
|
|
@@ -210,17 +216,25 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
210
216
|
|
|
211
217
|
await updateGridColumnsForPrint(options == null ? void 0 : options.fields, options == null ? void 0 : options.allColumns);
|
|
212
218
|
apiRef.current.unstable_disableVirtualization();
|
|
219
|
+
await raf(); // wait for the state changes to take action
|
|
220
|
+
|
|
213
221
|
const printWindow = buildPrintWindow(options == null ? void 0 : options.fileName);
|
|
214
|
-
doc.current.body.appendChild(printWindow);
|
|
215
222
|
|
|
216
223
|
if (process.env.NODE_ENV === 'test') {
|
|
217
|
-
// In test env, run the all pipeline without waiting for loading
|
|
224
|
+
doc.current.body.appendChild(printWindow); // In test env, run the all pipeline without waiting for loading
|
|
225
|
+
|
|
218
226
|
handlePrintWindowLoad(printWindow, options);
|
|
219
227
|
handlePrintWindowAfterPrint(printWindow);
|
|
220
228
|
} else {
|
|
221
|
-
printWindow.onload = () =>
|
|
229
|
+
printWindow.onload = () => {
|
|
230
|
+
handlePrintWindowLoad(printWindow, options);
|
|
231
|
+
|
|
232
|
+
printWindow.contentWindow.onafterprint = () => {
|
|
233
|
+
handlePrintWindowAfterPrint(printWindow);
|
|
234
|
+
};
|
|
235
|
+
};
|
|
222
236
|
|
|
223
|
-
|
|
237
|
+
doc.current.body.appendChild(printWindow);
|
|
224
238
|
}
|
|
225
239
|
}, [props, logger, apiRef, buildPrintWindow, handlePrintWindowLoad, handlePrintWindowAfterPrint, updateGridColumnsForPrint]);
|
|
226
240
|
const printExportApi = {
|
|
@@ -217,13 +217,9 @@ export const useGridVirtualScroller = props => {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
}, [apiRef, currentPage.rows, onRenderZonePositioning, renderZoneMinColumnIndex, renderZoneMaxColumnIndex, rootProps.columnBuffer, rootProps.rowBuffer]);
|
|
220
|
-
React.useLayoutEffect(() => {
|
|
221
|
-
if (renderContext) {
|
|
222
|
-
updateRenderZonePosition(renderContext);
|
|
223
|
-
}
|
|
224
|
-
}, [renderContext, updateRenderZonePosition]);
|
|
225
220
|
const updateRenderContext = React.useCallback(nextRenderContext => {
|
|
226
221
|
setRenderContext(nextRenderContext);
|
|
222
|
+
updateRenderZonePosition(nextRenderContext);
|
|
227
223
|
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
228
224
|
firstIndex: nextRenderContext.firstRowIndex,
|
|
229
225
|
lastIndex: nextRenderContext.lastRowIndex,
|
|
@@ -236,7 +232,7 @@ export const useGridVirtualScroller = props => {
|
|
|
236
232
|
lastRowToRender
|
|
237
233
|
});
|
|
238
234
|
prevRenderContext.current = nextRenderContext;
|
|
239
|
-
}, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
|
|
235
|
+
}, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer, updateRenderZonePosition]);
|
|
240
236
|
useEnhancedEffect(() => {
|
|
241
237
|
if (containerDimensions.width == null) {
|
|
242
238
|
return;
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/ex
|
|
|
54
54
|
export { createSelector, unstable_resetCreateSelectorCache } from '../utils/createSelector';
|
|
55
55
|
export { findParentElementFromClassName } from '../utils/domUtils';
|
|
56
56
|
export { isNavigationKey } from '../utils/keyboardUtils';
|
|
57
|
-
export { clamp, isDeepEqual, isNumber, isFunction } from '../utils/utils';
|
|
57
|
+
export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
|
|
58
58
|
export { buildWarning } from '../utils/warning';
|
|
59
59
|
export { exportAs } from '../utils/exportAs';
|
|
60
60
|
export type { GridApiCommunity } from '../models/api/gridApiCommunity';
|
package/internals/index.js
CHANGED
|
@@ -45,6 +45,6 @@ export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/ex
|
|
|
45
45
|
export { createSelector, unstable_resetCreateSelectorCache } from '../utils/createSelector';
|
|
46
46
|
export { findParentElementFromClassName } from '../utils/domUtils';
|
|
47
47
|
export { isNavigationKey } from '../utils/keyboardUtils';
|
|
48
|
-
export { clamp, isDeepEqual, isNumber, isFunction } from '../utils/utils';
|
|
48
|
+
export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
|
|
49
49
|
export { buildWarning } from '../utils/warning';
|
|
50
50
|
export { exportAs } from '../utils/exportAs';
|
|
@@ -34,6 +34,7 @@ var GridColumnHeadersRoot = styled('div', {
|
|
|
34
34
|
overflow: 'hidden',
|
|
35
35
|
display: 'flex',
|
|
36
36
|
alignItems: 'center',
|
|
37
|
+
boxSizing: 'border-box',
|
|
37
38
|
borderBottom: "1px solid ".concat(borderColor),
|
|
38
39
|
borderTopLeftRadius: theme.shape.borderRadius,
|
|
39
40
|
borderTopRightRadius: theme.shape.borderRadius
|
|
@@ -115,7 +115,6 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
115
115
|
}, [applyValue, item]);
|
|
116
116
|
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
117
117
|
multiple: true,
|
|
118
|
-
limitTags: 1,
|
|
119
118
|
options: resolvedValueOptions,
|
|
120
119
|
isOptionEqualToValue: isOptionEqualToValue,
|
|
121
120
|
filterOptions: filter,
|
|
@@ -54,7 +54,6 @@ function GridFilterInputMultipleValue(props) {
|
|
|
54
54
|
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
55
55
|
multiple: true,
|
|
56
56
|
freeSolo: true,
|
|
57
|
-
limitTags: 1,
|
|
58
57
|
options: [],
|
|
59
58
|
filterOptions: function filterOptions(options, params) {
|
|
60
59
|
var inputValue = params.inputValue;
|
|
@@ -16,6 +16,14 @@ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
|
16
16
|
import { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
|
|
19
|
+
function raf() {
|
|
20
|
+
return new Promise(function (resolve) {
|
|
21
|
+
requestAnimationFrame(function () {
|
|
22
|
+
resolve();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
/**
|
|
20
28
|
* @requires useGridColumns (state)
|
|
21
29
|
* @requires useGridFilter (state)
|
|
@@ -34,6 +42,7 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
34
42
|
|
|
35
43
|
var updateGridColumnsForPrint = React.useCallback(function (fields, allColumns) {
|
|
36
44
|
return new Promise(function (resolve) {
|
|
45
|
+
// TODO remove unused Promise
|
|
37
46
|
if (!fields && !allColumns) {
|
|
38
47
|
resolve();
|
|
39
48
|
return;
|
|
@@ -56,12 +65,10 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
56
65
|
apiRef.current.setColumnVisibilityModel(newColumnVisibilityModel);
|
|
57
66
|
resolve();
|
|
58
67
|
});
|
|
59
|
-
}, [apiRef]);
|
|
68
|
+
}, [apiRef]); // TODO move outside of this scope and remove React.useCallback
|
|
69
|
+
|
|
60
70
|
var buildPrintWindow = React.useCallback(function (title) {
|
|
61
71
|
var iframeEl = document.createElement('iframe');
|
|
62
|
-
iframeEl.id = 'grid-print-window'; // Without this 'onload' event won't fire in some browsers
|
|
63
|
-
|
|
64
|
-
iframeEl.src = window.location.href;
|
|
65
72
|
iframeEl.style.position = 'absolute';
|
|
66
73
|
iframeEl.style.width = '0px';
|
|
67
74
|
iframeEl.style.height = '0px';
|
|
@@ -69,18 +76,15 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
69
76
|
return iframeEl;
|
|
70
77
|
}, []);
|
|
71
78
|
var handlePrintWindowLoad = React.useCallback(function (printWindow, options) {
|
|
72
|
-
var
|
|
79
|
+
var _querySelector, _querySelector2;
|
|
73
80
|
|
|
74
81
|
var normalizeOptions = _extends({
|
|
75
82
|
copyStyles: true,
|
|
76
83
|
hideToolbar: false,
|
|
77
84
|
hideFooter: false
|
|
78
|
-
}, options);
|
|
79
|
-
// `onload` callback. This ensures that it is only called once.
|
|
85
|
+
}, options);
|
|
80
86
|
|
|
81
|
-
|
|
82
|
-
printWindow.onload = null;
|
|
83
|
-
var printDoc = printWindow.contentDocument || ((_printWindow$contentW = printWindow.contentWindow) == null ? void 0 : _printWindow$contentW.document);
|
|
87
|
+
var printDoc = printWindow.contentDocument;
|
|
84
88
|
|
|
85
89
|
if (!printDoc) {
|
|
86
90
|
return;
|
|
@@ -120,10 +124,12 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
120
124
|
} // Expand container height to accommodate all rows
|
|
121
125
|
|
|
122
126
|
|
|
123
|
-
gridClone.style.height = "".concat(rowsMeta.currentPageTotalHeight + totalHeaderHeight + gridToolbarElementHeight + gridFooterElementHeight, "px"); //
|
|
127
|
+
gridClone.style.height = "".concat(rowsMeta.currentPageTotalHeight + totalHeaderHeight + gridToolbarElementHeight + gridFooterElementHeight, "px"); // printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
|
|
128
|
+
// prevents us to do it
|
|
124
129
|
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
var container = document.createElement('div');
|
|
131
|
+
container.appendChild(gridClone);
|
|
132
|
+
printDoc.body.innerHTML = container.innerHTML;
|
|
127
133
|
var defaultPageStyle = typeof normalizeOptions.pageStyle === 'function' ? normalizeOptions.pageStyle() : normalizeOptions.pageStyle;
|
|
128
134
|
|
|
129
135
|
if (typeof defaultPageStyle === 'string') {
|
|
@@ -232,24 +238,31 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
232
238
|
|
|
233
239
|
case 8:
|
|
234
240
|
apiRef.current.unstable_disableVirtualization();
|
|
241
|
+
_context.next = 11;
|
|
242
|
+
return raf();
|
|
243
|
+
|
|
244
|
+
case 11:
|
|
245
|
+
// wait for the state changes to take action
|
|
235
246
|
printWindow = buildPrintWindow(options == null ? void 0 : options.fileName);
|
|
236
|
-
doc.current.body.appendChild(printWindow);
|
|
237
247
|
|
|
238
248
|
if (process.env.NODE_ENV === 'test') {
|
|
239
|
-
// In test env, run the all pipeline without waiting for loading
|
|
249
|
+
doc.current.body.appendChild(printWindow); // In test env, run the all pipeline without waiting for loading
|
|
250
|
+
|
|
240
251
|
handlePrintWindowLoad(printWindow, options);
|
|
241
252
|
handlePrintWindowAfterPrint(printWindow);
|
|
242
253
|
} else {
|
|
243
254
|
printWindow.onload = function () {
|
|
244
|
-
|
|
245
|
-
};
|
|
255
|
+
handlePrintWindowLoad(printWindow, options);
|
|
246
256
|
|
|
247
|
-
|
|
248
|
-
|
|
257
|
+
printWindow.contentWindow.onafterprint = function () {
|
|
258
|
+
handlePrintWindowAfterPrint(printWindow);
|
|
259
|
+
};
|
|
249
260
|
};
|
|
261
|
+
|
|
262
|
+
doc.current.body.appendChild(printWindow);
|
|
250
263
|
}
|
|
251
264
|
|
|
252
|
-
case
|
|
265
|
+
case 13:
|
|
253
266
|
case "end":
|
|
254
267
|
return _context.stop();
|
|
255
268
|
}
|
|
@@ -240,13 +240,9 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
}, [apiRef, currentPage.rows, onRenderZonePositioning, renderZoneMinColumnIndex, renderZoneMaxColumnIndex, rootProps.columnBuffer, rootProps.rowBuffer]);
|
|
243
|
-
React.useLayoutEffect(function () {
|
|
244
|
-
if (renderContext) {
|
|
245
|
-
updateRenderZonePosition(renderContext);
|
|
246
|
-
}
|
|
247
|
-
}, [renderContext, updateRenderZonePosition]);
|
|
248
243
|
var updateRenderContext = React.useCallback(function (nextRenderContext) {
|
|
249
244
|
setRenderContext(nextRenderContext);
|
|
245
|
+
updateRenderZonePosition(nextRenderContext);
|
|
250
246
|
|
|
251
247
|
var _getRenderableIndexes7 = getRenderableIndexes({
|
|
252
248
|
firstIndex: nextRenderContext.firstRowIndex,
|
|
@@ -264,7 +260,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
264
260
|
lastRowToRender: lastRowToRender
|
|
265
261
|
});
|
|
266
262
|
prevRenderContext.current = nextRenderContext;
|
|
267
|
-
}, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
|
|
263
|
+
}, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer, updateRenderZonePosition]);
|
|
268
264
|
useEnhancedEffect(function () {
|
|
269
265
|
if (containerDimensions.width == null) {
|
|
270
266
|
return;
|
package/legacy/index.js
CHANGED
|
@@ -45,6 +45,6 @@ export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/ex
|
|
|
45
45
|
export { createSelector, unstable_resetCreateSelectorCache } from '../utils/createSelector';
|
|
46
46
|
export { findParentElementFromClassName } from '../utils/domUtils';
|
|
47
47
|
export { isNavigationKey } from '../utils/keyboardUtils';
|
|
48
|
-
export { clamp, isDeepEqual, isNumber, isFunction } from '../utils/utils';
|
|
48
|
+
export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
|
|
49
49
|
export { buildWarning } from '../utils/warning';
|
|
50
50
|
export { exportAs } from '../utils/exportAs';
|
package/legacy/locales/esES.js
CHANGED
|
@@ -3,7 +3,7 @@ import { getGridLocalization } from '../utils/getGridLocalization';
|
|
|
3
3
|
var esESGrid = {
|
|
4
4
|
// Root
|
|
5
5
|
noRowsLabel: 'Sin filas',
|
|
6
|
-
|
|
6
|
+
noResultsOverlayLabel: 'Resultados no encontrados',
|
|
7
7
|
errorOverlayDefaultLabel: 'Ha ocurrido un error.',
|
|
8
8
|
// Density selector toolbar button text
|
|
9
9
|
toolbarDensity: 'Densidad',
|
|
@@ -23,15 +23,15 @@ var esESGrid = {
|
|
|
23
23
|
return count > 1 ? "".concat(count, " filtros activos") : "".concat(count, " filtro activo");
|
|
24
24
|
},
|
|
25
25
|
// Quick filter toolbar field
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
toolbarQuickFilterPlaceholder: 'Buscar…',
|
|
27
|
+
toolbarQuickFilterLabel: 'Buscar',
|
|
28
|
+
toolbarQuickFilterDeleteIconLabel: 'Limpiar',
|
|
29
29
|
// Export selector toolbar button text
|
|
30
30
|
toolbarExport: 'Exportar',
|
|
31
31
|
toolbarExportLabel: 'Exportar',
|
|
32
32
|
toolbarExportCSV: 'Descargar como CSV',
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
toolbarExportPrint: 'Imprimir',
|
|
34
|
+
toolbarExportExcel: 'Descargar como Excel',
|
|
35
35
|
// Columns panel text
|
|
36
36
|
columnsPanelTextFieldLabel: 'Columna de búsqueda',
|
|
37
37
|
columnsPanelTextFieldPlaceholder: 'Título de columna',
|
|
@@ -41,7 +41,7 @@ var esESGrid = {
|
|
|
41
41
|
// Filter panel text
|
|
42
42
|
filterPanelAddFilter: 'Agregar filtro',
|
|
43
43
|
filterPanelDeleteIconLabel: 'Borrar',
|
|
44
|
-
|
|
44
|
+
filterPanelLinkOperator: 'Operador lógico',
|
|
45
45
|
filterPanelOperators: 'Operadores',
|
|
46
46
|
// TODO v6: rename to filterPanelOperator
|
|
47
47
|
filterPanelOperatorAnd: 'Y',
|
|
@@ -62,11 +62,11 @@ var esESGrid = {
|
|
|
62
62
|
filterOperatorOnOrBefore: 'es en o anterior',
|
|
63
63
|
filterOperatorIsEmpty: 'está vacío',
|
|
64
64
|
filterOperatorIsNotEmpty: 'no esta vacío',
|
|
65
|
-
|
|
65
|
+
filterOperatorIsAnyOf: 'es cualquiera de',
|
|
66
66
|
// Filter values text
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
filterValueAny: 'cualquiera',
|
|
68
|
+
filterValueTrue: 'verdadero',
|
|
69
|
+
filterValueFalse: 'falso',
|
|
70
70
|
// Column menu text
|
|
71
71
|
columnMenuLabel: 'Menú',
|
|
72
72
|
columnMenuShowColumns: 'Mostrar columnas',
|
|
@@ -92,19 +92,20 @@ var esESGrid = {
|
|
|
92
92
|
return "".concat(visibleCount.toLocaleString(), " de ").concat(totalCount.toLocaleString());
|
|
93
93
|
},
|
|
94
94
|
// Checkbox selection text
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
checkboxSelectionHeaderName: 'Seleccionar casilla',
|
|
96
|
+
checkboxSelectionSelectAllRows: 'Seleccionar todas las filas',
|
|
97
|
+
checkboxSelectionUnselectAllRows: 'Deseleccionar todas las filas',
|
|
98
|
+
checkboxSelectionSelectRow: 'Seleccionar fila',
|
|
99
|
+
checkboxSelectionUnselectRow: 'Deseleccionar fila',
|
|
100
100
|
// Boolean cell text
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
booleanCellTrueLabel: 'si',
|
|
102
|
+
booleanCellFalseLabel: 'no',
|
|
103
103
|
// Actions cell more text
|
|
104
|
-
actionsCellMore: 'más'
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
actionsCellMore: 'más',
|
|
105
|
+
// Column pinning text
|
|
106
|
+
pinToLeft: 'Anclar a la izquierda',
|
|
107
|
+
pinToRight: 'Anclar a la derecha',
|
|
108
|
+
unpin: 'Desanclar',
|
|
108
109
|
// Tree Data
|
|
109
110
|
// treeDataGroupingHeaderName: 'Group',
|
|
110
111
|
// treeDataExpand: 'see children',
|
|
@@ -115,17 +116,16 @@ var esESGrid = {
|
|
|
115
116
|
// unGroupColumn: name => `Stop grouping by ${name}`,
|
|
116
117
|
// Master/detail
|
|
117
118
|
// detailPanelToggle: 'Detail panel toggle',
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
expandDetailPanel: 'Expandir',
|
|
120
|
+
collapseDetailPanel: 'reducirse',
|
|
120
121
|
// Row reordering text
|
|
121
122
|
// rowReorderingHeaderName: 'Row reordering',
|
|
122
123
|
// Aggregation
|
|
123
124
|
// aggregationMenuItemHeader: 'Aggregation',
|
|
124
125
|
// aggregationFunctionLabelSum: 'sum',
|
|
125
126
|
// aggregationFunctionLabelAvg: 'avg',
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// aggregationFunctionLabelSize: 'size',
|
|
127
|
+
aggregationFunctionLabelMin: 'min',
|
|
128
|
+
aggregationFunctionLabelMax: 'max' // aggregationFunctionLabelSize: 'size',
|
|
129
129
|
|
|
130
130
|
};
|
|
131
131
|
export var esES = getGridLocalization(esESGrid, esESCore);
|
package/legacy/locales/svSE.js
CHANGED
|
@@ -105,7 +105,7 @@ var svSEGrid = {
|
|
|
105
105
|
// Column pinning text
|
|
106
106
|
pinToLeft: 'Fäst till vänster',
|
|
107
107
|
pinToRight: 'Fäst till höger',
|
|
108
|
-
unpin: 'Ta bort
|
|
108
|
+
unpin: 'Ta bort fästning',
|
|
109
109
|
// Tree Data
|
|
110
110
|
treeDataGroupingHeaderName: 'Grupp',
|
|
111
111
|
treeDataExpand: 'visa underordnade',
|
|
@@ -119,17 +119,17 @@ var svSEGrid = {
|
|
|
119
119
|
return "Sluta gruppera efter ".concat(name);
|
|
120
120
|
},
|
|
121
121
|
// Master/detail
|
|
122
|
-
|
|
122
|
+
detailPanelToggle: 'Växla detaljpanel',
|
|
123
123
|
expandDetailPanel: 'Expandera',
|
|
124
124
|
collapseDetailPanel: 'Kollapsa',
|
|
125
125
|
// Row reordering text
|
|
126
|
-
rowReorderingHeaderName: 'Ordna om rader'
|
|
127
|
-
//
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
rowReorderingHeaderName: 'Ordna om rader',
|
|
127
|
+
// Aggregation
|
|
128
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
129
|
+
aggregationFunctionLabelSum: 'sum',
|
|
130
|
+
aggregationFunctionLabelAvg: 'medel',
|
|
131
|
+
aggregationFunctionLabelMin: 'min',
|
|
132
|
+
aggregationFunctionLabelMax: 'max',
|
|
133
|
+
aggregationFunctionLabelSize: 'antal'
|
|
134
134
|
};
|
|
135
135
|
export var svSE = getGridLocalization(svSEGrid, svSECore);
|
package/legacy/utils/utils.js
CHANGED
|
@@ -6,7 +6,7 @@ export function isFunction(value) {
|
|
|
6
6
|
return typeof value === 'function';
|
|
7
7
|
}
|
|
8
8
|
export function isObject(value) {
|
|
9
|
-
return _typeof(value) === 'object';
|
|
9
|
+
return _typeof(value) === 'object' && value !== null;
|
|
10
10
|
}
|
|
11
11
|
export function localStorageAvailable() {
|
|
12
12
|
try {
|