@mui/x-data-grid 7.0.0-alpha.4 → 7.0.0-alpha.6
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 +342 -0
- package/DataGrid/DataGrid.js +25 -19
- package/DataGrid/useDataGridProps.js +0 -1
- package/colDef/gridDateOperators.js +13 -6
- package/colDef/gridSingleSelectColDef.js +6 -15
- package/components/cell/GridEditSingleSelectCell.d.ts +1 -2
- package/components/cell/GridEditSingleSelectCell.js +9 -29
- package/components/columnSelection/GridHeaderCheckbox.js +3 -1
- package/components/panel/filterPanel/GridFilterForm.js +44 -9
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +25 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +7 -48
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +15 -57
- package/components/panel/filterPanel/filterPanelUtils.d.ts +3 -2
- package/components/panel/filterPanel/filterPanelUtils.js +10 -5
- package/hooks/features/rowSelection/useGridRowSelection.js +9 -9
- package/hooks/features/rowSelection/utils.d.ts +2 -0
- package/hooks/features/rowSelection/utils.js +8 -0
- package/hooks/utils/useGridAriaAttributes.js +2 -1
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +25 -19
- package/legacy/DataGrid/useDataGridProps.js +0 -1
- package/legacy/colDef/gridDateOperators.js +13 -13
- package/legacy/colDef/gridSingleSelectColDef.js +6 -15
- package/legacy/components/cell/GridEditSingleSelectCell.js +8 -28
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +51 -19
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +27 -8
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -53
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +14 -59
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +10 -6
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +9 -9
- package/legacy/hooks/features/rowSelection/utils.js +8 -0
- package/legacy/hooks/utils/useGridAriaAttributes.js +2 -1
- package/legacy/index.js +1 -1
- package/legacy/locales/svSE.js +31 -33
- package/legacy/locales/urPK.js +26 -28
- package/locales/svSE.js +31 -33
- package/locales/urPK.js +26 -28
- package/models/controlStateItem.d.ts +1 -4
- package/models/props/DataGridProps.d.ts +26 -25
- package/modern/DataGrid/DataGrid.js +25 -19
- package/modern/DataGrid/useDataGridProps.js +0 -1
- package/modern/colDef/gridDateOperators.js +13 -6
- package/modern/colDef/gridSingleSelectColDef.js +6 -15
- package/modern/components/cell/GridEditSingleSelectCell.js +9 -29
- package/modern/components/columnSelection/GridHeaderCheckbox.js +3 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +44 -9
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +24 -6
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +7 -47
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +15 -56
- package/modern/components/panel/filterPanel/filterPanelUtils.js +10 -5
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +9 -9
- package/modern/hooks/features/rowSelection/utils.js +8 -0
- package/modern/hooks/utils/useGridAriaAttributes.js +2 -1
- package/modern/index.js +1 -1
- package/modern/locales/svSE.js +31 -33
- package/modern/locales/urPK.js +26 -28
- package/node/DataGrid/DataGrid.js +25 -19
- package/node/DataGrid/useDataGridProps.js +0 -1
- package/node/colDef/gridDateOperators.js +13 -6
- package/node/colDef/gridSingleSelectColDef.js +5 -14
- package/node/components/cell/GridEditSingleSelectCell.js +8 -28
- package/node/components/columnSelection/GridHeaderCheckbox.js +3 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +44 -9
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +24 -6
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -46
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +14 -55
- package/node/components/panel/filterPanel/filterPanelUtils.js +12 -7
- package/node/hooks/features/rowSelection/useGridRowSelection.js +9 -9
- package/node/hooks/features/rowSelection/utils.js +14 -0
- package/node/hooks/utils/useGridAriaAttributes.js +2 -1
- package/node/index.js +1 -1
- package/node/locales/svSE.js +31 -33
- package/node/locales/urPK.js +26 -28
- package/package.json +3 -3
- package/utils/createSelector.d.ts +1 -1
|
@@ -15,26 +15,24 @@ var _styles = require("@mui/material/styles");
|
|
|
15
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
16
16
|
var _filterPanelUtils = require("./filterPanelUtils");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "
|
|
18
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
const renderSingleSelectOptions = ({
|
|
22
|
-
column
|
|
23
|
-
valueOptions,
|
|
24
|
-
field
|
|
25
|
-
},
|
|
22
|
+
column,
|
|
26
23
|
OptionComponent,
|
|
27
24
|
getOptionLabel,
|
|
28
25
|
getOptionValue,
|
|
29
26
|
isSelectNative,
|
|
30
27
|
baseSelectOptionProps
|
|
31
28
|
}) => {
|
|
32
|
-
const iterableColumnValues =
|
|
33
|
-
field
|
|
34
|
-
})] : ['', ...(valueOptions || [])];
|
|
29
|
+
const iterableColumnValues = ['', ...((0, _filterPanelUtils.getValueOptions)(column) || [])];
|
|
35
30
|
return iterableColumnValues.map(option => {
|
|
36
31
|
const value = getOptionValue(option);
|
|
37
|
-
|
|
32
|
+
let label = getOptionLabel(option);
|
|
33
|
+
if (label === '') {
|
|
34
|
+
label = ' '; // To force the height of the empty option
|
|
35
|
+
}
|
|
38
36
|
return /*#__PURE__*/(0, _react.createElement)(OptionComponent, (0, _extends2.default)({}, baseSelectOptionProps, {
|
|
39
37
|
native: isSelectNative,
|
|
40
38
|
key: value,
|
|
@@ -57,19 +55,17 @@ function GridFilterInputSingleSelect(props) {
|
|
|
57
55
|
type,
|
|
58
56
|
apiRef,
|
|
59
57
|
focusElementRef,
|
|
60
|
-
getOptionLabel: getOptionLabelProp,
|
|
61
|
-
getOptionValue: getOptionValueProp,
|
|
62
58
|
placeholder,
|
|
63
59
|
tabIndex,
|
|
64
60
|
label: labelProp,
|
|
65
61
|
clearButton
|
|
66
62
|
} = props,
|
|
67
63
|
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
68
|
-
const
|
|
64
|
+
const filterValue = item.value ?? '';
|
|
69
65
|
const id = (0, _utils.unstable_useId)();
|
|
70
66
|
const labelId = (0, _utils.unstable_useId)();
|
|
71
67
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
72
|
-
const isSelectNative = rootProps.slotProps?.baseSelect?.native ??
|
|
68
|
+
const isSelectNative = rootProps.slotProps?.baseSelect?.native ?? false;
|
|
73
69
|
let resolvedColumn = null;
|
|
74
70
|
if (item.field) {
|
|
75
71
|
const column = apiRef.current.getColumn(item.field);
|
|
@@ -77,52 +73,27 @@ function GridFilterInputSingleSelect(props) {
|
|
|
77
73
|
resolvedColumn = column;
|
|
78
74
|
}
|
|
79
75
|
}
|
|
80
|
-
const getOptionValue =
|
|
81
|
-
const getOptionLabel =
|
|
76
|
+
const getOptionValue = resolvedColumn?.getOptionValue;
|
|
77
|
+
const getOptionLabel = resolvedColumn?.getOptionLabel;
|
|
82
78
|
const currentValueOptions = React.useMemo(() => {
|
|
83
|
-
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
return typeof resolvedColumn.valueOptions === 'function' ? resolvedColumn.valueOptions({
|
|
87
|
-
field: resolvedColumn.field
|
|
88
|
-
}) : resolvedColumn.valueOptions;
|
|
79
|
+
return (0, _filterPanelUtils.getValueOptions)(resolvedColumn);
|
|
89
80
|
}, [resolvedColumn]);
|
|
90
81
|
const onFilterChange = React.useCallback(event => {
|
|
91
82
|
let value = event.target.value;
|
|
92
83
|
|
|
93
84
|
// NativeSelect casts the value to a string.
|
|
94
85
|
value = (0, _filterPanelUtils.getValueFromValueOptions)(value, currentValueOptions, getOptionValue);
|
|
95
|
-
setFilterValueState(String(value));
|
|
96
86
|
applyValue((0, _extends2.default)({}, item, {
|
|
97
87
|
value
|
|
98
88
|
}));
|
|
99
89
|
}, [currentValueOptions, getOptionValue, applyValue, item]);
|
|
100
|
-
React.useEffect(() => {
|
|
101
|
-
let itemValue;
|
|
102
|
-
if (currentValueOptions !== undefined) {
|
|
103
|
-
// sanitize if valueOptions are provided
|
|
104
|
-
itemValue = (0, _filterPanelUtils.getValueFromValueOptions)(item.value, currentValueOptions, getOptionValue);
|
|
105
|
-
if (itemValue !== item.value) {
|
|
106
|
-
applyValue((0, _extends2.default)({}, item, {
|
|
107
|
-
value: itemValue
|
|
108
|
-
}));
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
} else {
|
|
112
|
-
itemValue = item.value;
|
|
113
|
-
}
|
|
114
|
-
itemValue = itemValue ?? '';
|
|
115
|
-
setFilterValueState(String(itemValue));
|
|
116
|
-
}, [item, currentValueOptions, applyValue, getOptionValue]);
|
|
117
|
-
if (!(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
90
|
if (!(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
|
|
121
91
|
return null;
|
|
122
92
|
}
|
|
123
93
|
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
124
94
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SingleSelectOperatorContainer, {
|
|
125
95
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseFormControl, {
|
|
96
|
+
fullWidth: true,
|
|
126
97
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, rootProps.slotProps?.baseInputLabel, {
|
|
127
98
|
id: labelId,
|
|
128
99
|
htmlFor: id,
|
|
@@ -133,7 +104,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
133
104
|
id: id,
|
|
134
105
|
label: label,
|
|
135
106
|
labelId: labelId,
|
|
136
|
-
value:
|
|
107
|
+
value: filterValue,
|
|
137
108
|
onChange: onFilterChange,
|
|
138
109
|
variant: "standard",
|
|
139
110
|
type: type || 'text',
|
|
@@ -167,18 +138,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
167
138
|
applyValue: _propTypes.default.func.isRequired,
|
|
168
139
|
clearButton: _propTypes.default.node,
|
|
169
140
|
focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
170
|
-
/**
|
|
171
|
-
* Used to determine the label displayed for a given value option.
|
|
172
|
-
* @param {ValueOptions} value The current value option.
|
|
173
|
-
* @returns {string} The text to be displayed.
|
|
174
|
-
*/
|
|
175
|
-
getOptionLabel: _propTypes.default.func,
|
|
176
|
-
/**
|
|
177
|
-
* Used to determine the value used for a value option.
|
|
178
|
-
* @param {ValueOptions} value The current value option.
|
|
179
|
-
* @returns {string} The value to be used.
|
|
180
|
-
*/
|
|
181
|
-
getOptionValue: _propTypes.default.func,
|
|
182
141
|
/**
|
|
183
142
|
* It is `true` if the filter either has a value or an operator with no value
|
|
184
143
|
* required is selected (e.g. `isEmpty`)
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.getLabelFromValueOption = void 0;
|
|
7
7
|
exports.getValueFromValueOptions = getValueFromValueOptions;
|
|
8
|
+
exports.getValueOptions = getValueOptions;
|
|
8
9
|
exports.isSingleSelectColDef = isSingleSelectColDef;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
11
|
function isSingleSelectColDef(colDef) {
|
|
10
12
|
return colDef?.type === 'singleSelect';
|
|
11
13
|
}
|
|
14
|
+
function getValueOptions(column, additionalParams) {
|
|
15
|
+
if (!column) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return typeof column.valueOptions === 'function' ? column.valueOptions((0, _extends2.default)({
|
|
19
|
+
field: column.field
|
|
20
|
+
}, additionalParams)) : column.valueOptions;
|
|
21
|
+
}
|
|
12
22
|
function getValueFromValueOptions(value, valueOptions, getOptionValue) {
|
|
13
23
|
if (valueOptions === undefined) {
|
|
14
24
|
return undefined;
|
|
@@ -18,9 +28,4 @@ function getValueFromValueOptions(value, valueOptions, getOptionValue) {
|
|
|
18
28
|
return String(optionValue) === String(value);
|
|
19
29
|
});
|
|
20
30
|
return getOptionValue(result);
|
|
21
|
-
}
|
|
22
|
-
const getLabelFromValueOption = valueOption => {
|
|
23
|
-
const label = typeof valueOption === 'object' ? valueOption.label : valueOption;
|
|
24
|
-
return label != null ? String(label) : '';
|
|
25
|
-
};
|
|
26
|
-
exports.getLabelFromValueOption = getLabelFromValueOption;
|
|
31
|
+
}
|
|
@@ -22,6 +22,7 @@ var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
|
22
22
|
var _gridDetailPanelToggleField = require("../../../constants/gridDetailPanelToggleField");
|
|
23
23
|
var _gridClasses = require("../../../constants/gridClasses");
|
|
24
24
|
var _domUtils = require("../../../utils/domUtils");
|
|
25
|
+
var _utils = require("./utils");
|
|
25
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
27
28
|
const getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {
|
|
@@ -67,11 +68,10 @@ const useGridRowSelection = (apiRef, props) => {
|
|
|
67
68
|
});
|
|
68
69
|
const {
|
|
69
70
|
checkboxSelection,
|
|
70
|
-
disableMultipleRowSelection,
|
|
71
71
|
disableRowSelectionOnClick,
|
|
72
72
|
isRowSelectable: propIsRowSelectable
|
|
73
73
|
} = props;
|
|
74
|
-
const canHaveMultipleSelection =
|
|
74
|
+
const canHaveMultipleSelection = (0, _utils.isMultipleRowSelectionEnabled)(props);
|
|
75
75
|
const visibleRows = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, props);
|
|
76
76
|
const expandMouseRowRangeSelection = React.useCallback(id => {
|
|
77
77
|
let endId = id;
|
|
@@ -101,7 +101,7 @@ const useGridRowSelection = (apiRef, props) => {
|
|
|
101
101
|
* API METHODS
|
|
102
102
|
*/
|
|
103
103
|
const setRowSelectionModel = React.useCallback(model => {
|
|
104
|
-
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && !
|
|
104
|
+
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && !canHaveMultipleSelection && Array.isArray(model) && model.length > 1) {
|
|
105
105
|
throw new Error(['MUI: `rowSelectionModel` can only contain 1 item in DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.'].join('\n'));
|
|
106
106
|
}
|
|
107
107
|
const currentModel = (0, _gridRowSelectionSelector.gridRowSelectionStateSelector)(apiRef.current.state);
|
|
@@ -112,7 +112,7 @@ const useGridRowSelection = (apiRef, props) => {
|
|
|
112
112
|
}));
|
|
113
113
|
apiRef.current.forceUpdate();
|
|
114
114
|
}
|
|
115
|
-
}, [apiRef, logger, props.rowSelection, props.signature,
|
|
115
|
+
}, [apiRef, logger, props.rowSelection, props.signature, canHaveMultipleSelection]);
|
|
116
116
|
const isRowSelected = React.useCallback(id => (0, _gridRowSelectionSelector.gridRowSelectionStateSelector)(apiRef.current.state).includes(id), [apiRef]);
|
|
117
117
|
const isRowSelectable = React.useCallback(id => {
|
|
118
118
|
if (propIsRowSelectable && !propIsRowSelectable(apiRef.current.getRowParams(id))) {
|
|
@@ -263,24 +263,24 @@ const useGridRowSelection = (apiRef, props) => {
|
|
|
263
263
|
if (rowNode.type === 'pinnedRow') {
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
|
-
if (event.shiftKey &&
|
|
266
|
+
if (event.shiftKey && canHaveMultipleSelection) {
|
|
267
267
|
expandMouseRowRangeSelection(params.id);
|
|
268
268
|
} else {
|
|
269
269
|
handleSingleRowSelection(params.id, event);
|
|
270
270
|
}
|
|
271
|
-
}, [disableRowSelectionOnClick, canHaveMultipleSelection,
|
|
271
|
+
}, [disableRowSelectionOnClick, canHaveMultipleSelection, apiRef, expandMouseRowRangeSelection, handleSingleRowSelection]);
|
|
272
272
|
const preventSelectionOnShift = React.useCallback((params, event) => {
|
|
273
273
|
if (canHaveMultipleSelection && event.shiftKey) {
|
|
274
274
|
window.getSelection()?.removeAllRanges();
|
|
275
275
|
}
|
|
276
276
|
}, [canHaveMultipleSelection]);
|
|
277
277
|
const handleRowSelectionCheckboxChange = React.useCallback((params, event) => {
|
|
278
|
-
if (event.nativeEvent.shiftKey) {
|
|
278
|
+
if (canHaveMultipleSelection && event.nativeEvent.shiftKey) {
|
|
279
279
|
expandMouseRowRangeSelection(params.id);
|
|
280
280
|
} else {
|
|
281
|
-
apiRef.current.selectRow(params.id, params.value);
|
|
281
|
+
apiRef.current.selectRow(params.id, params.value, !canHaveMultipleSelection);
|
|
282
282
|
}
|
|
283
|
-
}, [apiRef, expandMouseRowRangeSelection]);
|
|
283
|
+
}, [apiRef, expandMouseRowRangeSelection, canHaveMultipleSelection]);
|
|
284
284
|
const handleHeaderSelectionCheckboxChange = React.useCallback(params => {
|
|
285
285
|
const shouldLimitSelectionToCurrentPage = props.checkboxSelectionVisibleOnly && props.pagination;
|
|
286
286
|
const rowsToBeSelected = shouldLimitSelectionToCurrentPage ? (0, _pagination.gridPaginatedVisibleSortedGridRowIdsSelector)(apiRef) : (0, _gridFilterSelector.gridExpandedSortedRowIdsSelector)(apiRef);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isMultipleRowSelectionEnabled = isMultipleRowSelectionEnabled;
|
|
7
|
+
var _useGridApiEventHandler = require("../../utils/useGridApiEventHandler");
|
|
8
|
+
function isMultipleRowSelectionEnabled(props) {
|
|
9
|
+
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid) {
|
|
10
|
+
// DataGrid Community has multiple row selection enabled only if checkbox selection is enabled.
|
|
11
|
+
return props.checkboxSelection && props.disableMultipleRowSelection !== true;
|
|
12
|
+
}
|
|
13
|
+
return !props.disableMultipleRowSelection;
|
|
14
|
+
}
|
|
@@ -10,6 +10,7 @@ var _useGridRootProps = require("./useGridRootProps");
|
|
|
10
10
|
var _gridColumnGroupsSelector = require("../features/columnGrouping/gridColumnGroupsSelector");
|
|
11
11
|
var _gridRowsSelector = require("../features/rows/gridRowsSelector");
|
|
12
12
|
var _useGridPrivateApiContext = require("./useGridPrivateApiContext");
|
|
13
|
+
var _utils = require("../features/rowSelection/utils");
|
|
13
14
|
const useGridAriaAttributes = () => {
|
|
14
15
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
15
16
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
@@ -25,7 +26,7 @@ const useGridAriaAttributes = () => {
|
|
|
25
26
|
role,
|
|
26
27
|
'aria-colcount': visibleColumns.length,
|
|
27
28
|
'aria-rowcount': headerGroupingMaxDepth + 1 + pinnedRowsCount + totalRowCount,
|
|
28
|
-
'aria-multiselectable':
|
|
29
|
+
'aria-multiselectable': (0, _utils.isMultipleRowSelectionEnabled)(rootProps)
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
exports.useGridAriaAttributes = useGridAriaAttributes;
|
package/node/index.js
CHANGED
package/node/locales/svSE.js
CHANGED
|
@@ -15,7 +15,7 @@ const svSEGrid = {
|
|
|
15
15
|
toolbarDensityLabel: 'Densitet',
|
|
16
16
|
toolbarDensityCompact: 'Kompakt',
|
|
17
17
|
toolbarDensityStandard: 'Standard',
|
|
18
|
-
toolbarDensityComfortable: '
|
|
18
|
+
toolbarDensityComfortable: 'Luftig',
|
|
19
19
|
// Columns selector toolbar button text
|
|
20
20
|
toolbarColumns: 'Kolumner',
|
|
21
21
|
toolbarColumnsLabel: 'Välj kolumner',
|
|
@@ -45,8 +45,8 @@ const svSEGrid = {
|
|
|
45
45
|
filterPanelAddFilter: 'Lägg till filter',
|
|
46
46
|
filterPanelRemoveAll: 'Ta bort alla',
|
|
47
47
|
filterPanelDeleteIconLabel: 'Ta bort',
|
|
48
|
-
filterPanelLogicOperator: 'Logisk
|
|
49
|
-
filterPanelOperator: '
|
|
48
|
+
filterPanelLogicOperator: 'Logisk operator',
|
|
49
|
+
filterPanelOperator: 'Operator',
|
|
50
50
|
filterPanelOperatorAnd: 'Och',
|
|
51
51
|
filterPanelOperatorOr: 'Eller',
|
|
52
52
|
filterPanelColumns: 'Kolumner',
|
|
@@ -54,7 +54,7 @@ const svSEGrid = {
|
|
|
54
54
|
filterPanelInputPlaceholder: 'Filtervärde',
|
|
55
55
|
// Filter operators text
|
|
56
56
|
filterOperatorContains: 'innehåller',
|
|
57
|
-
filterOperatorEquals: '
|
|
57
|
+
filterOperatorEquals: 'lika med',
|
|
58
58
|
filterOperatorStartsWith: 'börjar med',
|
|
59
59
|
filterOperatorEndsWith: 'slutar med',
|
|
60
60
|
filterOperatorIs: 'är',
|
|
@@ -66,34 +66,32 @@ const svSEGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'är tom',
|
|
67
67
|
filterOperatorIsNotEmpty: 'är inte tom',
|
|
68
68
|
filterOperatorIsAnyOf: 'är någon av',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
'filterOperator=': '=',
|
|
70
|
+
'filterOperator!=': '!=',
|
|
71
|
+
'filterOperator>': '>',
|
|
72
|
+
'filterOperator>=': '>=',
|
|
73
|
+
'filterOperator<': '<',
|
|
74
|
+
'filterOperator<=': '<=',
|
|
76
75
|
// Header filter operators text
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
headerFilterOperatorContains: 'Innehåller',
|
|
77
|
+
headerFilterOperatorEquals: 'Lika med',
|
|
78
|
+
headerFilterOperatorStartsWith: 'Börjar med',
|
|
79
|
+
headerFilterOperatorEndsWith: 'Slutar med',
|
|
80
|
+
headerFilterOperatorIs: 'Är',
|
|
81
|
+
headerFilterOperatorNot: 'Är inte',
|
|
82
|
+
headerFilterOperatorAfter: 'Är efter',
|
|
83
|
+
headerFilterOperatorOnOrAfter: 'Är på eller efter',
|
|
84
|
+
headerFilterOperatorBefore: 'Är innan',
|
|
85
|
+
headerFilterOperatorOnOrBefore: 'Är på eller innan',
|
|
86
|
+
headerFilterOperatorIsEmpty: 'Är tom',
|
|
87
|
+
headerFilterOperatorIsNotEmpty: 'Är inte tom',
|
|
88
|
+
headerFilterOperatorIsAnyOf: 'Innehåller någon av',
|
|
89
|
+
'headerFilterOperator=': 'Lika med',
|
|
90
|
+
'headerFilterOperator!=': 'Inte lika med',
|
|
91
|
+
'headerFilterOperator>': 'Större än',
|
|
92
|
+
'headerFilterOperator>=': 'Större eller lika med',
|
|
93
|
+
'headerFilterOperator<': 'Mindre än',
|
|
94
|
+
'headerFilterOperator<=': 'Mindre eller lika med',
|
|
97
95
|
// Filter values text
|
|
98
96
|
filterValueAny: 'något',
|
|
99
97
|
filterValueTrue: 'sant',
|
|
@@ -104,7 +102,7 @@ const svSEGrid = {
|
|
|
104
102
|
columnMenuManageColumns: 'Hantera kolumner',
|
|
105
103
|
columnMenuFilter: 'Filtrera',
|
|
106
104
|
columnMenuHideColumn: 'Dölj',
|
|
107
|
-
columnMenuUnsort: '
|
|
105
|
+
columnMenuUnsort: 'Ta bort sortering',
|
|
108
106
|
columnMenuSortAsc: 'Sortera stigande',
|
|
109
107
|
columnMenuSortDesc: 'Sortera fallande',
|
|
110
108
|
// Column header text
|
|
@@ -148,7 +146,7 @@ const svSEGrid = {
|
|
|
148
146
|
rowReorderingHeaderName: 'Ordna om rader',
|
|
149
147
|
// Aggregation
|
|
150
148
|
aggregationMenuItemHeader: 'Aggregering',
|
|
151
|
-
aggregationFunctionLabelSum: '
|
|
149
|
+
aggregationFunctionLabelSum: 'summa',
|
|
152
150
|
aggregationFunctionLabelAvg: 'medel',
|
|
153
151
|
aggregationFunctionLabelMin: 'min',
|
|
154
152
|
aggregationFunctionLabelMax: 'max',
|
package/node/locales/urPK.js
CHANGED
|
@@ -43,7 +43,7 @@ const urPKGrid = {
|
|
|
43
43
|
columnsPanelHideAllButton: 'سارے چھپائیں',
|
|
44
44
|
// Filter panel text
|
|
45
45
|
filterPanelAddFilter: 'نیا فلٹر',
|
|
46
|
-
|
|
46
|
+
filterPanelRemoveAll: 'سارے ختم کریں',
|
|
47
47
|
filterPanelDeleteIconLabel: 'ختم کریں',
|
|
48
48
|
filterPanelLogicOperator: 'لاجک آپریٹر',
|
|
49
49
|
filterPanelOperator: 'آپریٹر',
|
|
@@ -66,34 +66,32 @@ const urPKGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'خالی ہے',
|
|
67
67
|
filterOperatorIsNotEmpty: 'خالی نہیں ہے',
|
|
68
68
|
filterOperatorIsAnyOf: 'ان میں سے کوئی ہے',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
'filterOperator=': '=',
|
|
70
|
+
'filterOperator!=': '!=',
|
|
71
|
+
'filterOperator>': '>',
|
|
72
|
+
'filterOperator>=': '>=',
|
|
73
|
+
'filterOperator<': '<',
|
|
74
|
+
'filterOperator<=': '<=',
|
|
76
75
|
// Header filter operators text
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
headerFilterOperatorContains: 'شامل ہے',
|
|
77
|
+
headerFilterOperatorEquals: 'برابر ہے',
|
|
78
|
+
headerFilterOperatorStartsWith: 'شروع ہوتا ہے',
|
|
79
|
+
headerFilterOperatorEndsWith: 'ختم ہوتا ہے',
|
|
80
|
+
headerFilterOperatorIs: 'ہے',
|
|
81
|
+
headerFilterOperatorNot: 'نہیں ہے',
|
|
82
|
+
headerFilterOperatorAfter: 'بعد میں ہے',
|
|
83
|
+
headerFilterOperatorOnOrAfter: 'پر یا بعد میں ہے',
|
|
84
|
+
headerFilterOperatorBefore: 'پہلے ہے',
|
|
85
|
+
headerFilterOperatorOnOrBefore: 'پر یا پہلے ہے',
|
|
86
|
+
headerFilterOperatorIsEmpty: 'خالی ہے',
|
|
87
|
+
headerFilterOperatorIsNotEmpty: 'خالی نہیں ہے',
|
|
88
|
+
headerFilterOperatorIsAnyOf: 'ان میں سے کوئی ہے',
|
|
89
|
+
'headerFilterOperator=': 'برابر ہے',
|
|
90
|
+
'headerFilterOperator!=': 'برابر نہیں ہے',
|
|
91
|
+
'headerFilterOperator>': 'ذیادہ ہے',
|
|
92
|
+
'headerFilterOperator>=': 'ذیادہ یا برابر ہے',
|
|
93
|
+
'headerFilterOperator<': 'کم ہے',
|
|
94
|
+
'headerFilterOperator<=': 'کم یا برابر ہے',
|
|
97
95
|
// Filter values text
|
|
98
96
|
filterValueAny: 'کوئی بھی',
|
|
99
97
|
filterValueTrue: 'صحیح',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.6",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@babel/runtime": "^7.23.5",
|
|
40
|
-
"@mui/system": "^5.
|
|
41
|
-
"@mui/utils": "^5.
|
|
40
|
+
"@mui/system": "^5.15.0",
|
|
41
|
+
"@mui/utils": "^5.15.0",
|
|
42
42
|
"clsx": "^2.0.0",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"reselect": "^4.1.8"
|
|
@@ -6,7 +6,7 @@ export interface OutputSelector<State, Result> {
|
|
|
6
6
|
state: State;
|
|
7
7
|
instanceId: GridCoreApi['instanceId'];
|
|
8
8
|
}>): Result;
|
|
9
|
-
(state: State, instanceId
|
|
9
|
+
(state: State, instanceId: GridCoreApi['instanceId']): Result;
|
|
10
10
|
acceptsApiRef: boolean;
|
|
11
11
|
}
|
|
12
12
|
type StateFromSelector<T> = T extends (first: infer F, ...args: any[]) => any ? F extends {
|