@mui/x-data-grid 5.12.3 → 5.13.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.
- package/CHANGELOG.md +53 -0
- package/DataGrid/DataGrid.js +4 -4
- package/colDef/gridStringOperators.d.ts +1 -1
- package/colDef/gridStringOperators.js +11 -6
- package/components/GridRow.js +1 -1
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +11 -4
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +30 -14
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/hooks/features/rows/useGridRows.js +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridRootProps.js +1 -1
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +4 -4
- package/legacy/colDef/gridStringOperators.js +13 -5
- package/legacy/components/GridRow.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +22 -7
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
- package/legacy/hooks/features/rows/useGridRows.js +1 -1
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/legacy/hooks/utils/useGridApiContext.js +1 -1
- package/legacy/hooks/utils/useGridRootProps.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/locales/index.js +2 -0
- package/legacy/locales/roRO.js +128 -0
- package/legacy/locales/skSK.js +16 -16
- package/legacy/utils/keyboardUtils.js +4 -3
- package/locales/index.d.ts +2 -0
- package/locales/index.js +2 -0
- package/locales/roRO.d.ts +2 -0
- package/locales/roRO.js +116 -0
- package/locales/skSK.js +16 -16
- package/modern/DataGrid/DataGrid.js +4 -4
- package/modern/colDef/gridStringOperators.js +11 -6
- package/modern/components/GridRow.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +20 -8
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/modern/hooks/features/rows/useGridRows.js +1 -1
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridRootProps.js +1 -1
- package/modern/index.js +1 -1
- package/modern/locales/index.js +2 -0
- package/modern/locales/roRO.js +116 -0
- package/modern/locales/skSK.js +16 -16
- package/modern/utils/keyboardUtils.js +4 -3
- package/node/DataGrid/DataGrid.js +4 -4
- package/node/colDef/gridStringOperators.js +11 -6
- package/node/components/GridRow.js +1 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +31 -15
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/node/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/node/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridRootProps.js +1 -1
- package/node/index.js +1 -1
- package/node/locales/index.js +26 -0
- package/node/locales/roRO.js +126 -0
- package/node/locales/skSK.js +16 -16
- package/node/utils/keyboardUtils.js +4 -3
- package/package.json +2 -2
- package/utils/keyboardUtils.js +4 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
7
7
|
import Chip from '@mui/material/Chip';
|
|
8
|
-
import TextField from '@mui/material/TextField';
|
|
9
8
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
9
|
+
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
function GridFilterInputMultipleValue(props) {
|
|
@@ -15,12 +15,25 @@ function GridFilterInputMultipleValue(props) {
|
|
|
15
15
|
applyValue,
|
|
16
16
|
type,
|
|
17
17
|
apiRef,
|
|
18
|
-
focusElementRef
|
|
18
|
+
focusElementRef,
|
|
19
|
+
color,
|
|
20
|
+
error,
|
|
21
|
+
helperText,
|
|
22
|
+
size,
|
|
23
|
+
variant
|
|
19
24
|
} = props,
|
|
20
25
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
26
|
|
|
27
|
+
const TextFieldProps = {
|
|
28
|
+
color,
|
|
29
|
+
error,
|
|
30
|
+
helperText,
|
|
31
|
+
size,
|
|
32
|
+
variant
|
|
33
|
+
};
|
|
22
34
|
const [filterValueState, setFilterValueState] = React.useState(item.value || []);
|
|
23
35
|
const id = useId();
|
|
36
|
+
const rootProps = useGridRootProps();
|
|
24
37
|
React.useEffect(() => {
|
|
25
38
|
const itemValue = item.value ?? [];
|
|
26
39
|
setFilterValueState(itemValue.map(String));
|
|
@@ -52,16 +65,15 @@ function GridFilterInputMultipleValue(props) {
|
|
|
52
65
|
}, getTagProps({
|
|
53
66
|
index
|
|
54
67
|
})))),
|
|
55
|
-
renderInput: params => /*#__PURE__*/_jsx(
|
|
68
|
+
renderInput: params => /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
|
|
56
69
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
57
70
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
58
71
|
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
59
72
|
shrink: true
|
|
60
73
|
}),
|
|
61
74
|
inputRef: focusElementRef,
|
|
62
|
-
type: type || 'text'
|
|
63
|
-
|
|
64
|
-
}))
|
|
75
|
+
type: type || 'text'
|
|
76
|
+
}, TextFieldProps, rootProps.componentsProps?.baseTextField))
|
|
65
77
|
}, other));
|
|
66
78
|
}
|
|
67
79
|
|
|
@@ -70,7 +82,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
|
|
|
70
82
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
83
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
72
84
|
// ----------------------------------------------------------------------
|
|
73
|
-
apiRef: PropTypes.
|
|
85
|
+
apiRef: PropTypes.shape({
|
|
86
|
+
current: PropTypes.object.isRequired
|
|
87
|
+
}).isRequired,
|
|
74
88
|
applyValue: PropTypes.func.isRequired,
|
|
75
89
|
focusElementRef: PropTypes
|
|
76
90
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -51,6 +51,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
51
51
|
const isSelectNative = baseSelectProps.native ?? true;
|
|
52
52
|
const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
53
53
|
const currentValueOptions = React.useMemo(() => {
|
|
54
|
+
if (currentColumn === null) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
55
59
|
field: currentColumn.field
|
|
56
60
|
}) : currentColumn.valueOptions;
|
|
@@ -90,8 +94,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
90
94
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
91
95
|
value: filterValueState,
|
|
92
96
|
onChange: onFilterChange,
|
|
93
|
-
type: type || 'text',
|
|
94
97
|
variant: "standard",
|
|
98
|
+
type: type || 'text',
|
|
95
99
|
InputLabelProps: {
|
|
96
100
|
shrink: true
|
|
97
101
|
},
|
|
@@ -110,7 +114,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
110
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
111
115
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
112
116
|
// ----------------------------------------------------------------------
|
|
113
|
-
apiRef: PropTypes.
|
|
117
|
+
apiRef: PropTypes.shape({
|
|
118
|
+
current: PropTypes.object.isRequired
|
|
119
|
+
}).isRequired,
|
|
114
120
|
applyValue: PropTypes.func.isRequired,
|
|
115
121
|
focusElementRef: PropTypes
|
|
116
122
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -111,8 +111,8 @@ function GridFilterInputValue(props) {
|
|
|
111
111
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
112
112
|
value: filterValueState,
|
|
113
113
|
onChange: onFilterChange,
|
|
114
|
-
type: type || 'text',
|
|
115
114
|
variant: "standard",
|
|
115
|
+
type: type || 'text',
|
|
116
116
|
InputProps: InputProps,
|
|
117
117
|
InputLabelProps: {
|
|
118
118
|
shrink: true
|
|
@@ -126,7 +126,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
126
126
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
127
127
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
128
128
|
// ----------------------------------------------------------------------
|
|
129
|
-
apiRef: PropTypes.
|
|
129
|
+
apiRef: PropTypes.shape({
|
|
130
|
+
current: PropTypes.object.isRequired
|
|
131
|
+
}).isRequired,
|
|
130
132
|
applyValue: PropTypes.func.isRequired,
|
|
131
133
|
focusElementRef: PropTypes
|
|
132
134
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -69,21 +69,34 @@ export function useGridDimensions(apiRef, props) {
|
|
|
69
69
|
rootElement.removeChild(scrollDiv);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
72
|
+
let viewportOuterSize;
|
|
73
|
+
let hasScrollX;
|
|
74
|
+
let hasScrollY;
|
|
75
|
+
|
|
76
|
+
if (props.autoHeight) {
|
|
77
|
+
hasScrollY = false;
|
|
78
|
+
hasScrollX = Math.round(columnsTotalWidth) > rootDimensionsRef.current.width;
|
|
79
|
+
viewportOuterSize = {
|
|
80
|
+
width: rootDimensionsRef.current.width,
|
|
81
|
+
height: rowsMeta.currentPageTotalHeight + (hasScrollX ? scrollBarSize : 0)
|
|
82
|
+
};
|
|
83
|
+
} else {
|
|
84
|
+
viewportOuterSize = {
|
|
85
|
+
width: rootDimensionsRef.current.width,
|
|
86
|
+
height: rootDimensionsRef.current.height - headerHeight
|
|
87
|
+
};
|
|
88
|
+
const scrollInformation = hasScroll({
|
|
89
|
+
content: {
|
|
90
|
+
width: Math.round(columnsTotalWidth),
|
|
91
|
+
height: rowsMeta.currentPageTotalHeight
|
|
92
|
+
},
|
|
93
|
+
container: viewportOuterSize,
|
|
94
|
+
scrollBarSize
|
|
95
|
+
});
|
|
96
|
+
hasScrollY = scrollInformation.hasScrollY;
|
|
97
|
+
hasScrollX = scrollInformation.hasScrollX;
|
|
98
|
+
}
|
|
99
|
+
|
|
87
100
|
const viewportInnerSize = {
|
|
88
101
|
width: viewportOuterSize.width - (hasScrollY ? scrollBarSize : 0),
|
|
89
102
|
height: viewportOuterSize.height - (hasScrollX ? scrollBarSize : 0)
|
|
@@ -70,6 +70,12 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
70
70
|
}, [apiRef]);
|
|
71
71
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
72
72
|
if (params.cellMode === GridCellModes.Edit) {
|
|
73
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
74
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
75
|
+
if (event.which === 229) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
73
79
|
let reason;
|
|
74
80
|
|
|
75
81
|
if (event.key === 'Escape') {
|
|
@@ -175,6 +175,12 @@ export const useCellEditing = (apiRef, props) => {
|
|
|
175
175
|
};
|
|
176
176
|
useGridApiMethod(apiRef, cellEditingApi, 'EditRowApi');
|
|
177
177
|
const handleCellKeyDown = React.useCallback(async (params, event) => {
|
|
178
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
179
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
180
|
+
if (event.which === 229) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
178
184
|
const {
|
|
179
185
|
id,
|
|
180
186
|
field,
|
|
@@ -108,6 +108,12 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
108
108
|
}, []);
|
|
109
109
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
110
110
|
if (params.cellMode === GridRowModes.Edit) {
|
|
111
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
112
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
113
|
+
if (event.which === 229) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
111
117
|
let reason;
|
|
112
118
|
|
|
113
119
|
if (event.key === 'Escape') {
|
|
@@ -172,6 +172,12 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
172
172
|
};
|
|
173
173
|
useGridApiMethod(apiRef, rowEditingApi, 'EditRowApi');
|
|
174
174
|
const handleCellKeyDown = React.useCallback(async (params, event) => {
|
|
175
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
176
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
177
|
+
if (event.which === 229) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
175
181
|
const {
|
|
176
182
|
cellMode,
|
|
177
183
|
isEditable
|
|
@@ -93,7 +93,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
93
93
|
const updateRows = React.useCallback(updates => {
|
|
94
94
|
if (props.signature === GridSignature.DataGrid && updates.length > 1) {
|
|
95
95
|
// TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
|
|
96
|
-
throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to
|
|
96
|
+
throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
97
97
|
} // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.
|
|
98
98
|
|
|
99
99
|
|
|
@@ -11,7 +11,7 @@ const flatRowTreeCreationMethod = ({
|
|
|
11
11
|
for (let i = 0; i < ids.length; i += 1) {
|
|
12
12
|
const rowId = ids[i];
|
|
13
13
|
|
|
14
|
-
if (previousTree && previousTree[rowId]) {
|
|
14
|
+
if (previousTree && previousTree[rowId] && previousTree[rowId].depth === 0 && previousTree[rowId].parent == null) {
|
|
15
15
|
tree[rowId] = previousTree[rowId];
|
|
16
16
|
} else {
|
|
17
17
|
tree[rowId] = {
|
|
@@ -4,7 +4,7 @@ export function useGridApiContext() {
|
|
|
4
4
|
const apiRef = React.useContext(GridApiContext);
|
|
5
5
|
|
|
6
6
|
if (apiRef === undefined) {
|
|
7
|
-
throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid or
|
|
7
|
+
throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\n'));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
return apiRef;
|
|
@@ -4,7 +4,7 @@ export const useGridRootProps = () => {
|
|
|
4
4
|
const contextValue = React.useContext(GridRootPropsContext);
|
|
5
5
|
|
|
6
6
|
if (!contextValue) {
|
|
7
|
-
throw new Error('MUI: useGridRootProps should only be used inside the DataGrid
|
|
7
|
+
throw new Error('MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.');
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
return contextValue;
|
package/modern/index.js
CHANGED
package/modern/locales/index.js
CHANGED
|
@@ -15,9 +15,11 @@ export * from './huHU';
|
|
|
15
15
|
export * from './itIT';
|
|
16
16
|
export * from './jaJP';
|
|
17
17
|
export * from './koKR';
|
|
18
|
+
export * from './nbNO';
|
|
18
19
|
export * from './nlNL';
|
|
19
20
|
export * from './plPL';
|
|
20
21
|
export * from './ptBR';
|
|
22
|
+
export * from './roRO';
|
|
21
23
|
export * from './ruRU';
|
|
22
24
|
export * from './skSK';
|
|
23
25
|
export * from './svSE';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { roRO as roROCore } from '@mui/material/locale';
|
|
2
|
+
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
3
|
+
const roROGrid = {
|
|
4
|
+
// Root
|
|
5
|
+
noRowsLabel: 'Lipsă date',
|
|
6
|
+
noResultsOverlayLabel: 'Nu au fost găsite rezultate.',
|
|
7
|
+
errorOverlayDefaultLabel: 'A apărut o eroare neașteptată.',
|
|
8
|
+
// Density selector toolbar button text
|
|
9
|
+
toolbarDensity: 'Înălțime rând',
|
|
10
|
+
toolbarDensityLabel: 'Înălțime rând',
|
|
11
|
+
toolbarDensityCompact: 'Compact',
|
|
12
|
+
toolbarDensityStandard: 'Standard',
|
|
13
|
+
toolbarDensityComfortable: 'Lat',
|
|
14
|
+
// Columns selector toolbar button text
|
|
15
|
+
toolbarColumns: 'Coloane',
|
|
16
|
+
toolbarColumnsLabel: 'Afișează selecție coloane',
|
|
17
|
+
// Filters toolbar button text
|
|
18
|
+
toolbarFilters: 'Filtru',
|
|
19
|
+
toolbarFiltersLabel: 'Afișează filtru',
|
|
20
|
+
toolbarFiltersTooltipHide: 'Ascunde filtru',
|
|
21
|
+
toolbarFiltersTooltipShow: 'Afișează filtru',
|
|
22
|
+
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} filtru activ` : `${count} filtru activ`,
|
|
23
|
+
// Quick filter toolbar field
|
|
24
|
+
// toolbarQuickFilterPlaceholder: 'Search...',
|
|
25
|
+
// toolbarQuickFilterLabel: 'Search',
|
|
26
|
+
// toolbarQuickFilterDeleteIconLabel: 'Clear',
|
|
27
|
+
// Export selector toolbar button text
|
|
28
|
+
toolbarExport: 'Export',
|
|
29
|
+
toolbarExportLabel: 'Export',
|
|
30
|
+
toolbarExportCSV: 'Download în format CSV',
|
|
31
|
+
toolbarExportPrint: 'Printare',
|
|
32
|
+
toolbarExportExcel: 'Download în format Excel',
|
|
33
|
+
// Columns panel text
|
|
34
|
+
columnsPanelTextFieldLabel: 'Găsește coloana',
|
|
35
|
+
columnsPanelTextFieldPlaceholder: 'Titlu coloană',
|
|
36
|
+
columnsPanelDragIconLabel: 'Resortare coloană',
|
|
37
|
+
columnsPanelShowAllButton: 'Afișează tot',
|
|
38
|
+
columnsPanelHideAllButton: 'Ascunde tot',
|
|
39
|
+
// Filter panel text
|
|
40
|
+
filterPanelAddFilter: 'Adăugare filtru',
|
|
41
|
+
filterPanelDeleteIconLabel: 'Ștergere',
|
|
42
|
+
filterPanelLinkOperator: 'Operatori logici',
|
|
43
|
+
filterPanelOperators: 'Operatori',
|
|
44
|
+
// TODO v6: rename to filterPanelOperator
|
|
45
|
+
filterPanelOperatorAnd: 'Și',
|
|
46
|
+
filterPanelOperatorOr: 'Sau',
|
|
47
|
+
filterPanelColumns: 'Coloane',
|
|
48
|
+
filterPanelInputLabel: 'Valoare',
|
|
49
|
+
filterPanelInputPlaceholder: 'Filtrare valoare',
|
|
50
|
+
// Filter operators text
|
|
51
|
+
filterOperatorContains: 'conține',
|
|
52
|
+
filterOperatorEquals: 'este egal cu',
|
|
53
|
+
filterOperatorStartsWith: 'începe cu',
|
|
54
|
+
filterOperatorEndsWith: 'se termină cu',
|
|
55
|
+
filterOperatorIs: 'este',
|
|
56
|
+
filterOperatorNot: 'nu este',
|
|
57
|
+
filterOperatorAfter: 'este după',
|
|
58
|
+
filterOperatorOnOrAfter: 'este la sau după',
|
|
59
|
+
filterOperatorBefore: 'este înainte de',
|
|
60
|
+
filterOperatorOnOrBefore: 'este la sau înainte de',
|
|
61
|
+
filterOperatorIsEmpty: 'este gol',
|
|
62
|
+
filterOperatorIsNotEmpty: 'nu este gol',
|
|
63
|
+
filterOperatorIsAnyOf: 'este una din valori',
|
|
64
|
+
// Filter values text
|
|
65
|
+
filterValueAny: 'Aleatoriu',
|
|
66
|
+
filterValueTrue: 'Da',
|
|
67
|
+
filterValueFalse: 'Nu',
|
|
68
|
+
// Column menu text
|
|
69
|
+
columnMenuLabel: 'Meniu',
|
|
70
|
+
columnMenuShowColumns: 'Afișează toate coloanele',
|
|
71
|
+
columnMenuFilter: 'Filtru',
|
|
72
|
+
columnMenuHideColumn: 'Ascunde',
|
|
73
|
+
columnMenuUnsort: 'Dezactivare sortare',
|
|
74
|
+
columnMenuSortAsc: 'Sortează crescător',
|
|
75
|
+
columnMenuSortDesc: 'Sortează descrescător',
|
|
76
|
+
// Column header text
|
|
77
|
+
columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} filtru activ` : `${count} filtru activ`,
|
|
78
|
+
columnHeaderFiltersLabel: 'Afișează filtru',
|
|
79
|
+
columnHeaderSortIconLabel: 'Sortare',
|
|
80
|
+
// Rows selected footer text
|
|
81
|
+
footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} Înregistrări selectate` : `${count.toLocaleString()} Înregistrare selectată`,
|
|
82
|
+
// Total row amount footer text
|
|
83
|
+
footerTotalRows: 'Total:',
|
|
84
|
+
// Total visible row amount footer text
|
|
85
|
+
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} din ${totalCount.toLocaleString()}`,
|
|
86
|
+
// Checkbox selection text
|
|
87
|
+
checkboxSelectionHeaderName: 'Checkbox Selecție',
|
|
88
|
+
checkboxSelectionSelectAllRows: 'Selectare toate rândurile',
|
|
89
|
+
checkboxSelectionUnselectAllRows: 'Deselectare toate rândurile',
|
|
90
|
+
checkboxSelectionSelectRow: 'Selectare rând',
|
|
91
|
+
checkboxSelectionUnselectRow: 'Deselectare rând',
|
|
92
|
+
// Boolean cell text
|
|
93
|
+
booleanCellTrueLabel: 'Da',
|
|
94
|
+
booleanCellFalseLabel: 'Nu',
|
|
95
|
+
// Actions cell more text
|
|
96
|
+
actionsCellMore: 'Mai multe',
|
|
97
|
+
// Column pinning text
|
|
98
|
+
pinToLeft: 'Fixare în stânga',
|
|
99
|
+
pinToRight: 'Fixare în dreapta',
|
|
100
|
+
unpin: 'Anulare fixare',
|
|
101
|
+
// Tree Data
|
|
102
|
+
treeDataGroupingHeaderName: 'Grup',
|
|
103
|
+
treeDataExpand: 'Afișare copii',
|
|
104
|
+
treeDataCollapse: 'Ascundere copii',
|
|
105
|
+
// Grouping columns
|
|
106
|
+
groupingColumnHeaderName: 'Grupare',
|
|
107
|
+
groupColumn: name => `Grupare după ${name}`,
|
|
108
|
+
unGroupColumn: name => `Anulare Grupare după ${name}`,
|
|
109
|
+
// Master/detail
|
|
110
|
+
// detailPanelToggle: 'Detail panel toggle',
|
|
111
|
+
expandDetailPanel: 'Extindere',
|
|
112
|
+
collapseDetailPanel: 'Restrângere',
|
|
113
|
+
// Row reordering text
|
|
114
|
+
rowReorderingHeaderName: 'Reordonare rânduri'
|
|
115
|
+
};
|
|
116
|
+
export const roRO = getGridLocalization(roROGrid, roROCore);
|
package/modern/locales/skSK.js
CHANGED
|
@@ -31,15 +31,15 @@ const skSKGrid = {
|
|
|
31
31
|
return `${count} ${pluralForm}`;
|
|
32
32
|
},
|
|
33
33
|
// Quick filter toolbar field
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
toolbarQuickFilterPlaceholder: 'Vyhľadať...',
|
|
35
|
+
toolbarQuickFilterLabel: 'Vyhľadať',
|
|
36
|
+
toolbarQuickFilterDeleteIconLabel: 'Vymazať',
|
|
37
37
|
// Export selector toolbar button text
|
|
38
38
|
toolbarExport: 'Export',
|
|
39
39
|
toolbarExportLabel: 'Export',
|
|
40
40
|
toolbarExportCSV: 'Stiahnuť ako CSV',
|
|
41
41
|
toolbarExportPrint: 'Vytlačiť',
|
|
42
|
-
|
|
42
|
+
toolbarExportExcel: 'Stiahnuť ako Excel',
|
|
43
43
|
// Columns panel text
|
|
44
44
|
columnsPanelTextFieldLabel: 'Nájsť stĺpec',
|
|
45
45
|
columnsPanelTextFieldPlaceholder: 'Názov stĺpca',
|
|
@@ -49,7 +49,7 @@ const skSKGrid = {
|
|
|
49
49
|
// Filter panel text
|
|
50
50
|
filterPanelAddFilter: 'Pridať filter',
|
|
51
51
|
filterPanelDeleteIconLabel: 'Odstrániť',
|
|
52
|
-
|
|
52
|
+
filterPanelLinkOperator: 'Logický operátor',
|
|
53
53
|
filterPanelOperators: 'Operátory',
|
|
54
54
|
// TODO v6: rename to filterPanelOperator
|
|
55
55
|
filterPanelOperatorAnd: 'A',
|
|
@@ -70,7 +70,7 @@ const skSKGrid = {
|
|
|
70
70
|
filterOperatorOnOrBefore: 'je na alebo skôr',
|
|
71
71
|
filterOperatorIsEmpty: 'je prázdny',
|
|
72
72
|
filterOperatorIsNotEmpty: 'nie je prázdny',
|
|
73
|
-
|
|
73
|
+
filterOperatorIsAnyOf: 'je jeden z',
|
|
74
74
|
// Filter values text
|
|
75
75
|
filterValueAny: 'akýkoľvek',
|
|
76
76
|
filterValueTrue: 'áno',
|
|
@@ -120,10 +120,10 @@ const skSKGrid = {
|
|
|
120
120
|
},
|
|
121
121
|
// Checkbox selection text
|
|
122
122
|
checkboxSelectionHeaderName: 'Výber riadku',
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
checkboxSelectionSelectAllRows: 'Vybrať všetky riadky',
|
|
124
|
+
checkboxSelectionUnselectAllRows: 'Zrušiť výber všetkých riadkov',
|
|
125
|
+
checkboxSelectionSelectRow: 'Vyber riadok',
|
|
126
|
+
checkboxSelectionUnselectRow: 'Zruš výber riadku',
|
|
127
127
|
// Boolean cell text
|
|
128
128
|
booleanCellTrueLabel: 'áno',
|
|
129
129
|
booleanCellFalseLabel: 'nie',
|
|
@@ -140,12 +140,12 @@ const skSKGrid = {
|
|
|
140
140
|
// Grouping columns
|
|
141
141
|
groupingColumnHeaderName: 'Skupina',
|
|
142
142
|
groupColumn: name => `Zoskupiť podľa ${name}`,
|
|
143
|
-
unGroupColumn: name => `Prestať zoskupovať podľa ${name}
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
unGroupColumn: name => `Prestať zoskupovať podľa ${name}`,
|
|
144
|
+
// Master/detail
|
|
145
|
+
detailPanelToggle: 'Prepnúť detail panelu',
|
|
146
|
+
expandDetailPanel: 'Rozbaliť',
|
|
147
|
+
collapseDetailPanel: 'Zbaliť',
|
|
147
148
|
// Row reordering text
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
rowReorderingHeaderName: 'Preusporiadávanie riadkov'
|
|
150
150
|
};
|
|
151
151
|
export const skSK = getGridLocalization(skSKGrid, skSKCore);
|
|
@@ -8,9 +8,10 @@ export const isSpaceKey = key => key === ' ';
|
|
|
8
8
|
export const isArrowKeys = key => key.indexOf('Arrow') === 0;
|
|
9
9
|
export const isHomeOrEndKeys = key => key === 'Home' || key === 'End';
|
|
10
10
|
export const isPageKeys = key => key.indexOf('Page') === 0;
|
|
11
|
-
export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace';
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace'; // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
|
|
12
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
13
|
+
|
|
14
|
+
export const isPrintableKey = key => key.length === 1;
|
|
14
15
|
export const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
|
|
15
16
|
export const GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
|
|
16
17
|
export const GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];
|
|
@@ -109,7 +109,7 @@ DataGridRaw.propTypes = {
|
|
|
109
109
|
columns: (0, _utils.chainPropTypes)(_propTypes.default.array.isRequired, props => {
|
|
110
110
|
// @ts-ignore because otherwise `build:api` doesn't work
|
|
111
111
|
if (props.columns && props.columns.some(column => column.resizable)) {
|
|
112
|
-
return new Error([`MUI: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to
|
|
112
|
+
return new Error([`MUI: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
return null;
|
|
@@ -679,14 +679,14 @@ DataGridRaw.propTypes = {
|
|
|
679
679
|
*/
|
|
680
680
|
pageSize: (0, _utils.chainPropTypes)(_propTypes.default.number, props => {
|
|
681
681
|
if (props.pageSize && props.pageSize > _useDataGridProps.MAX_PAGE_SIZE) {
|
|
682
|
-
return new Error([`MUI: \`<DataGrid pageSize={${props.pageSize}} />\` is not a valid prop.`, `Only page size below ${_useDataGridProps.MAX_PAGE_SIZE} is available in the MIT version.`, '', 'You need to upgrade to
|
|
682
|
+
return new Error([`MUI: \`<DataGrid pageSize={${props.pageSize}} />\` is not a valid prop.`, `Only page size below ${_useDataGridProps.MAX_PAGE_SIZE} is available in the MIT version.`, '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
return null;
|
|
686
686
|
}),
|
|
687
687
|
pagination: props => {
|
|
688
688
|
if (props.pagination === false) {
|
|
689
|
-
return new Error(['MUI: `<DataGrid pagination={false} />` is not a valid prop.', 'Infinite scrolling is not available in the MIT version.', '', 'You need to upgrade to
|
|
689
|
+
return new Error(['MUI: `<DataGrid pagination={false} />` is not a valid prop.', 'Infinite scrolling is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination.'].join('\n'));
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
return null;
|
|
@@ -766,7 +766,7 @@ DataGridRaw.propTypes = {
|
|
|
766
766
|
*/
|
|
767
767
|
selectionModel: (0, _utils.chainPropTypes)(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.array]), props => {
|
|
768
768
|
if (!props.checkboxSelection && Array.isArray(props.selectionModel) && props.selectionModel.length > 1) {
|
|
769
|
-
return new Error([`MUI: \`<DataGrid selectionModel={${JSON.stringify(props.selectionModel)}} />\` is not a valid prop.`, 'selectionModel can only be of 1 item in DataGrid.', '', 'You need to upgrade to
|
|
769
|
+
return new Error([`MUI: \`<DataGrid selectionModel={${JSON.stringify(props.selectionModel)}} />\` is not a valid prop.`, 'selectionModel can only be of 1 item in DataGrid.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.'].join('\n'));
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
return null;
|
|
@@ -26,14 +26,15 @@ const getGridStringQuickFilterFn = value => {
|
|
|
26
26
|
|
|
27
27
|
exports.getGridStringQuickFilterFn = getGridStringQuickFilterFn;
|
|
28
28
|
|
|
29
|
-
const getGridStringOperators = () => [{
|
|
29
|
+
const getGridStringOperators = (disableTrim = false) => [{
|
|
30
30
|
value: 'contains',
|
|
31
31
|
getApplyFilterFn: filterItem => {
|
|
32
32
|
if (!filterItem.value) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
37
|
+
const filterRegex = new RegExp((0, _utils.escapeRegExp)(filterItemValue), 'i');
|
|
37
38
|
return ({
|
|
38
39
|
value
|
|
39
40
|
}) => {
|
|
@@ -48,6 +49,7 @@ const getGridStringOperators = () => [{
|
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
51
53
|
const collator = new Intl.Collator(undefined, {
|
|
52
54
|
sensitivity: 'base',
|
|
53
55
|
usage: 'search'
|
|
@@ -55,7 +57,7 @@ const getGridStringOperators = () => [{
|
|
|
55
57
|
return ({
|
|
56
58
|
value
|
|
57
59
|
}) => {
|
|
58
|
-
return value != null ? collator.compare(
|
|
60
|
+
return value != null ? collator.compare(filterItemValue, value.toString()) === 0 : false;
|
|
59
61
|
};
|
|
60
62
|
},
|
|
61
63
|
InputComponent: _GridFilterInputValue.GridFilterInputValue
|
|
@@ -66,7 +68,8 @@ const getGridStringOperators = () => [{
|
|
|
66
68
|
return null;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
const
|
|
71
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
72
|
+
const filterRegex = new RegExp(`^${(0, _utils.escapeRegExp)(filterItemValue)}.*$`, 'i');
|
|
70
73
|
return ({
|
|
71
74
|
value
|
|
72
75
|
}) => {
|
|
@@ -81,7 +84,8 @@ const getGridStringOperators = () => [{
|
|
|
81
84
|
return null;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
const
|
|
87
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
88
|
+
const filterRegex = new RegExp(`.*${(0, _utils.escapeRegExp)(filterItemValue)}$`, 'i');
|
|
85
89
|
return ({
|
|
86
90
|
value
|
|
87
91
|
}) => {
|
|
@@ -114,13 +118,14 @@ const getGridStringOperators = () => [{
|
|
|
114
118
|
return null;
|
|
115
119
|
}
|
|
116
120
|
|
|
121
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
|
|
117
122
|
const collator = new Intl.Collator(undefined, {
|
|
118
123
|
sensitivity: 'base',
|
|
119
124
|
usage: 'search'
|
|
120
125
|
});
|
|
121
126
|
return ({
|
|
122
127
|
value
|
|
123
|
-
}) => value != null ?
|
|
128
|
+
}) => value != null ? filterItemValue.some(filterValue => {
|
|
124
129
|
return collator.compare(filterValue, value.toString() || '') === 0;
|
|
125
130
|
}) : false;
|
|
126
131
|
},
|
|
@@ -139,7 +139,7 @@ function GridRow(props) {
|
|
|
139
139
|
// Fallback for IE
|
|
140
140
|
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
141
141
|
}
|
|
142
|
-
});
|
|
142
|
+
}, [apiRef, rowHeight, rowId]);
|
|
143
143
|
React.useLayoutEffect(() => {
|
|
144
144
|
if (currentPage.range) {
|
|
145
145
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|