@mui/x-data-grid 6.19.3 → 6.19.5
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 +117 -0
- package/DataGrid/DataGrid.js +1 -1
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +8 -1
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridActionsCellItem.d.ts +13 -1
- package/components/cell/GridActionsCellItem.js +27 -15
- package/components/containers/GridRootStyles.js +6 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/hooks/features/export/useGridPrintExport.js +3 -1
- package/hooks/features/filter/gridFilterUtils.js +15 -22
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +1 -1
- package/legacy/components/GridPagination.js +8 -1
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridActionsCellItem.js +30 -17
- package/legacy/components/containers/GridRootStyles.js +5 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +6 -3
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -5
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/hooks/features/export/useGridPrintExport.js +11 -7
- package/legacy/hooks/features/filter/gridFilterUtils.js +11 -14
- package/legacy/index.js +1 -1
- package/legacy/locales/daDK.js +12 -12
- package/locales/daDK.js +12 -12
- package/models/props/DataGridProps.d.ts +2 -2
- package/modern/DataGrid/DataGrid.js +1 -1
- package/modern/components/GridPagination.js +8 -1
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +27 -15
- package/modern/components/containers/GridRootStyles.js +6 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/modern/hooks/features/export/useGridPrintExport.js +3 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +15 -22
- package/modern/index.js +1 -1
- package/modern/locales/daDK.js +12 -12
- package/node/DataGrid/DataGrid.js +1 -1
- package/node/components/GridPagination.js +8 -1
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +27 -15
- package/node/components/containers/GridRootStyles.js +6 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/node/hooks/features/export/useGridPrintExport.js +3 -1
- package/node/hooks/features/filter/gridFilterUtils.js +15 -21
- package/node/index.js +1 -1
- package/node/locales/daDK.js +12 -12
- package/package.json +1 -1
|
@@ -60,11 +60,15 @@ export var GridRootStyles = styled('div', {
|
|
|
60
60
|
height: 'auto'
|
|
61
61
|
}, "& .".concat(gridClasses['row--lastVisible'], " .").concat(gridClasses.cell), {
|
|
62
62
|
borderBottomColor: 'transparent'
|
|
63
|
-
})), "&.".concat(gridClasses.autosizing), _defineProperty(_defineProperty({}, "& .".concat(gridClasses.columnHeaderTitleContainerContent, " > *"), {
|
|
63
|
+
})), "&.".concat(gridClasses.autosizing), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "& .".concat(gridClasses.columnHeaderTitleContainerContent, " > *"), {
|
|
64
64
|
overflow: 'visible !important'
|
|
65
65
|
}), "& .".concat(gridClasses.cell, " > *"), {
|
|
66
66
|
overflow: 'visible !important',
|
|
67
67
|
whiteSpace: 'nowrap'
|
|
68
|
+
}), "& .".concat(gridClasses.groupingCriteriaCell), {
|
|
69
|
+
width: 'unset'
|
|
70
|
+
}), "& .".concat(gridClasses.treeDataGroupingCell), {
|
|
71
|
+
width: 'unset'
|
|
68
72
|
})), "& .".concat(gridClasses['virtualScrollerContent--overflowed'], " .").concat(gridClasses['row--lastVisible'], " .").concat(gridClasses.cell), {
|
|
69
73
|
borderBottomColor: 'transparent'
|
|
70
74
|
}), "& .".concat(gridClasses.columnHeader, ", & .").concat(gridClasses.cell), {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
5
|
+
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -27,6 +27,8 @@ function GridFilterInputBoolean(props) {
|
|
|
27
27
|
clearButton = props.clearButton,
|
|
28
28
|
tabIndex = props.tabIndex,
|
|
29
29
|
labelProp = props.label,
|
|
30
|
+
_props$variant = props.variant,
|
|
31
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
30
32
|
InputLabelProps = props.InputLabelProps,
|
|
31
33
|
others = _objectWithoutProperties(props, _excluded);
|
|
32
34
|
var _React$useState = React.useState(item.value || ''),
|
|
@@ -56,7 +58,7 @@ function GridFilterInputBoolean(props) {
|
|
|
56
58
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
|
|
57
59
|
id: labelId,
|
|
58
60
|
shrink: true,
|
|
59
|
-
variant:
|
|
61
|
+
variant: variant,
|
|
60
62
|
children: label
|
|
61
63
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
62
64
|
labelId: labelId,
|
|
@@ -64,7 +66,8 @@ function GridFilterInputBoolean(props) {
|
|
|
64
66
|
label: label,
|
|
65
67
|
value: filterValueState,
|
|
66
68
|
onChange: onFilterChange,
|
|
67
|
-
variant:
|
|
69
|
+
variant: variant,
|
|
70
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
68
71
|
native: isSelectNative,
|
|
69
72
|
displayEmpty: true,
|
|
70
73
|
inputProps: {
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
6
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -54,6 +54,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
54
54
|
placeholder = props.placeholder,
|
|
55
55
|
tabIndex = props.tabIndex,
|
|
56
56
|
labelProp = props.label,
|
|
57
|
+
_props$variant = props.variant,
|
|
58
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
57
59
|
isFilterActive = props.isFilterActive,
|
|
58
60
|
clearButton = props.clearButton,
|
|
59
61
|
InputLabelProps = props.InputLabelProps,
|
|
@@ -124,7 +126,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
124
126
|
id: labelId,
|
|
125
127
|
htmlFor: id,
|
|
126
128
|
shrink: true,
|
|
127
|
-
variant:
|
|
129
|
+
variant: variant,
|
|
128
130
|
children: label
|
|
129
131
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
130
132
|
id: id,
|
|
@@ -132,15 +134,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
132
134
|
labelId: labelId,
|
|
133
135
|
value: filterValueState,
|
|
134
136
|
onChange: onFilterChange,
|
|
135
|
-
variant:
|
|
137
|
+
variant: variant,
|
|
136
138
|
type: type || 'text',
|
|
137
139
|
inputProps: {
|
|
138
140
|
tabIndex: tabIndex,
|
|
139
141
|
ref: focusElementRef,
|
|
140
142
|
placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
141
143
|
},
|
|
142
|
-
native: isSelectNative
|
|
143
|
-
|
|
144
|
+
native: isSelectNative,
|
|
145
|
+
notched: variant === 'outlined' ? true : undefined
|
|
146
|
+
}, others /* FIXME: typing error */, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
|
|
144
147
|
children: renderSingleSelectOptions({
|
|
145
148
|
column: resolvedColumn,
|
|
146
149
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
4
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -20,6 +20,8 @@ function GridFilterInputValue(props) {
|
|
|
20
20
|
isFilterActive = props.isFilterActive,
|
|
21
21
|
clearButton = props.clearButton,
|
|
22
22
|
InputProps = props.InputProps,
|
|
23
|
+
_props$variant = props.variant,
|
|
24
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
23
25
|
others = _objectWithoutProperties(props, _excluded);
|
|
24
26
|
var filterTimeout = useTimeout();
|
|
25
27
|
var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
|
|
@@ -58,7 +60,7 @@ function GridFilterInputValue(props) {
|
|
|
58
60
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
59
61
|
value: filterValueState,
|
|
60
62
|
onChange: onFilterChange,
|
|
61
|
-
variant:
|
|
63
|
+
variant: variant,
|
|
62
64
|
type: type || 'text',
|
|
63
65
|
InputProps: _extends({}, applying || clearButton ? {
|
|
64
66
|
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
@@ -16,6 +16,7 @@ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
|
16
16
|
import { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';
|
|
17
17
|
import { getTotalHeaderHeight } from '../columns/gridColumnsUtils';
|
|
18
18
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef/gridCheckboxSelectionColDef';
|
|
19
|
+
import { gridDataRowIdsSelector, gridRowsLookupSelector } from '../rows/gridRowsSelector';
|
|
19
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
21
|
function raf() {
|
|
21
22
|
return new Promise(function (resolve) {
|
|
@@ -226,7 +227,7 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
226
227
|
}, [apiRef]);
|
|
227
228
|
var exportDataAsPrint = React.useCallback( /*#__PURE__*/function () {
|
|
228
229
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
229
|
-
var visibleRowCount, paginationModel, printWindow;
|
|
230
|
+
var gridRowsLookup, visibleRowCount, paginationModel, printWindow;
|
|
230
231
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
231
232
|
while (1) switch (_context.prev = _context.next) {
|
|
232
233
|
case 0:
|
|
@@ -240,7 +241,10 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
240
241
|
previousGridState.current = apiRef.current.exportState();
|
|
241
242
|
// It appends that the visibility model is not exported, especially if columnVisibility is not controlled
|
|
242
243
|
previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);
|
|
243
|
-
|
|
244
|
+
gridRowsLookup = gridRowsLookupSelector(apiRef);
|
|
245
|
+
previousRows.current = gridDataRowIdsSelector(apiRef).map(function (rowId) {
|
|
246
|
+
return gridRowsLookup[rowId];
|
|
247
|
+
});
|
|
244
248
|
if (props.pagination) {
|
|
245
249
|
visibleRowCount = gridExpandedRowCountSelector(apiRef);
|
|
246
250
|
paginationModel = {
|
|
@@ -252,16 +256,16 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
252
256
|
mergeStateWithPaginationModel(visibleRowCount, 'DataGridPro', paginationModel));
|
|
253
257
|
apiRef.current.forceUpdate();
|
|
254
258
|
}
|
|
255
|
-
_context.next =
|
|
259
|
+
_context.next = 10;
|
|
256
260
|
return updateGridColumnsForPrint(options == null ? void 0 : options.fields, options == null ? void 0 : options.allColumns, options == null ? void 0 : options.includeCheckboxes);
|
|
257
|
-
case
|
|
261
|
+
case 10:
|
|
258
262
|
if (options != null && options.getRowsToExport) {
|
|
259
263
|
updateGridRowsForPrint(options.getRowsToExport);
|
|
260
264
|
}
|
|
261
265
|
apiRef.current.unstable_setVirtualization(false);
|
|
262
|
-
_context.next =
|
|
266
|
+
_context.next = 14;
|
|
263
267
|
return raf();
|
|
264
|
-
case
|
|
268
|
+
case 14:
|
|
265
269
|
// wait for the state changes to take action
|
|
266
270
|
printWindow = buildPrintWindow(options == null ? void 0 : options.fileName);
|
|
267
271
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -282,7 +286,7 @@ export var useGridPrintExport = function useGridPrintExport(apiRef, props) {
|
|
|
282
286
|
};
|
|
283
287
|
doc.current.body.appendChild(printWindow);
|
|
284
288
|
}
|
|
285
|
-
case
|
|
289
|
+
case 16:
|
|
286
290
|
case "end":
|
|
287
291
|
return _context.stop();
|
|
288
292
|
}
|
|
@@ -5,22 +5,18 @@ import { getDefaultGridFilterModel } from './gridFilterState';
|
|
|
5
5
|
import { buildWarning } from '../../../utils/warning';
|
|
6
6
|
import { getPublicApiRef } from '../../../utils/getPublicApiRef';
|
|
7
7
|
import { gridColumnFieldsSelector, gridColumnLookupSelector, gridVisibleColumnFieldsSelector } from '../columns';
|
|
8
|
-
|
|
9
|
-
// Fixes https://github.com/mui/mui-x/issues/10056
|
|
10
|
-
var globalScope = typeof window === 'undefined' ? globalThis : window;
|
|
11
|
-
var evalCode = globalScope[atob('ZXZhbA==')];
|
|
12
8
|
var hasEval;
|
|
13
|
-
|
|
9
|
+
function getHasEval() {
|
|
14
10
|
if (hasEval !== undefined) {
|
|
15
11
|
return hasEval;
|
|
16
12
|
}
|
|
17
13
|
try {
|
|
18
|
-
hasEval =
|
|
14
|
+
hasEval = new Function('return true')();
|
|
19
15
|
} catch (_) {
|
|
20
16
|
hasEval = false;
|
|
21
17
|
}
|
|
22
18
|
return hasEval;
|
|
23
|
-
}
|
|
19
|
+
}
|
|
24
20
|
/**
|
|
25
21
|
* Adds default values to the optional fields of a filter items.
|
|
26
22
|
* @param {GridFilterItem} item The raw filter item.
|
|
@@ -198,18 +194,19 @@ var buildAggregatedFilterItemsApplier = function buildAggregatedFilterItemsAppli
|
|
|
198
194
|
};
|
|
199
195
|
}
|
|
200
196
|
|
|
201
|
-
// We generate a new function with `
|
|
197
|
+
// We generate a new function with `new Function()` to avoid expensive patterns for JS engines
|
|
202
198
|
// such as a dynamic object assignment, e.g. `{ [dynamicKey]: value }`.
|
|
203
|
-
var
|
|
199
|
+
var filterItemCore = new Function('getRowId', 'appliers', 'row', 'shouldApplyFilter', "\"use strict\";\n".concat(appliers.map(function (applier, i) {
|
|
204
200
|
return "const shouldApply".concat(i, " = !shouldApplyFilter || shouldApplyFilter(").concat(JSON.stringify(applier.item.field), ");");
|
|
205
|
-
}).join('\n'), "\n\
|
|
206
|
-
return "".concat(JSON.stringify(String(applier.item.id)), "
|
|
207
|
-
}).join('\n'), "};\n\
|
|
208
|
-
|
|
201
|
+
}).join('\n'), "\n\nconst result$$ = {\n").concat(appliers.map(function (applier, i) {
|
|
202
|
+
return " ".concat(JSON.stringify(String(applier.item.id)), ": !shouldApply").concat(i, "\n ? false\n : ").concat(applier.v7 ? "appliers[".concat(i, "].fn(row)") : "appliers[".concat(i, "].fn(getRowId(row))"), ",");
|
|
203
|
+
}).join('\n'), "\n};\n\nreturn result$$;").replaceAll('$$', String(filterItemsApplierId)));
|
|
204
|
+
filterItemsApplierId += 1;
|
|
205
|
+
|
|
206
|
+
// Assign to the arrow function a name to help debugging
|
|
209
207
|
var filterItem = function filterItem(row, shouldApplyItem) {
|
|
210
208
|
return filterItemCore(apiRef.current.getRowId, appliers, row, shouldApplyItem);
|
|
211
209
|
};
|
|
212
|
-
filterItemsApplierId += 1;
|
|
213
210
|
return filterItem;
|
|
214
211
|
};
|
|
215
212
|
|
package/legacy/index.js
CHANGED
package/legacy/locales/daDK.js
CHANGED
|
@@ -11,8 +11,8 @@ var daDKGrid = {
|
|
|
11
11
|
toolbarDensityStandard: 'Standard',
|
|
12
12
|
toolbarDensityComfortable: 'Luftig',
|
|
13
13
|
// Columns selector toolbar button text
|
|
14
|
-
toolbarColumns: '
|
|
15
|
-
toolbarColumnsLabel: 'Vælg
|
|
14
|
+
toolbarColumns: 'Kolonner',
|
|
15
|
+
toolbarColumnsLabel: 'Vælg kolonner',
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filtre',
|
|
18
18
|
toolbarFiltersLabel: 'Vis filtre',
|
|
@@ -42,12 +42,12 @@ var daDKGrid = {
|
|
|
42
42
|
filterPanelRemoveAll: 'Fjern alle',
|
|
43
43
|
filterPanelDeleteIconLabel: 'Slet',
|
|
44
44
|
filterPanelLogicOperator: 'Logisk operator',
|
|
45
|
-
filterPanelOperator: '
|
|
45
|
+
filterPanelOperator: 'Operator',
|
|
46
46
|
filterPanelOperatorAnd: 'Og',
|
|
47
47
|
filterPanelOperatorOr: 'Eller',
|
|
48
|
-
filterPanelColumns: '
|
|
48
|
+
filterPanelColumns: 'Kolonner',
|
|
49
49
|
filterPanelInputLabel: 'Værdi',
|
|
50
|
-
filterPanelInputPlaceholder: '
|
|
50
|
+
filterPanelInputPlaceholder: 'Filterværdi',
|
|
51
51
|
// Filter operators text
|
|
52
52
|
filterOperatorContains: 'indeholder',
|
|
53
53
|
filterOperatorEquals: 'lig med',
|
|
@@ -94,10 +94,10 @@ var daDKGrid = {
|
|
|
94
94
|
filterValueFalse: 'negativ',
|
|
95
95
|
// Column menu text
|
|
96
96
|
columnMenuLabel: 'Menu',
|
|
97
|
-
columnMenuShowColumns: 'Vis
|
|
97
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
98
98
|
columnMenuManageColumns: 'Administrer kolonner',
|
|
99
|
-
columnMenuFilter: '
|
|
100
|
-
columnMenuHideColumn: 'Skjul',
|
|
99
|
+
columnMenuFilter: 'Filtrer',
|
|
100
|
+
columnMenuHideColumn: 'Skjul kolonne',
|
|
101
101
|
columnMenuUnsort: 'Fjern sortering',
|
|
102
102
|
columnMenuSortAsc: 'Sorter stigende',
|
|
103
103
|
columnMenuSortDesc: 'Sorter faldende',
|
|
@@ -133,16 +133,16 @@ var daDKGrid = {
|
|
|
133
133
|
pinToRight: 'Fastgør til højre',
|
|
134
134
|
unpin: 'Frigiv',
|
|
135
135
|
// Tree Data
|
|
136
|
-
treeDataGroupingHeaderName: '
|
|
136
|
+
treeDataGroupingHeaderName: 'Gruppe',
|
|
137
137
|
treeDataExpand: 'Vis underelementer',
|
|
138
138
|
treeDataCollapse: 'Skjul underelementer',
|
|
139
139
|
// Grouping columns
|
|
140
|
-
groupingColumnHeaderName: '
|
|
140
|
+
groupingColumnHeaderName: 'Gruppe',
|
|
141
141
|
groupColumn: function groupColumn(name) {
|
|
142
142
|
return "Grupp\xE9r efter ".concat(name);
|
|
143
143
|
},
|
|
144
144
|
unGroupColumn: function unGroupColumn(name) {
|
|
145
|
-
return "Fjern
|
|
145
|
+
return "Fjern gruppering efter ".concat(name);
|
|
146
146
|
},
|
|
147
147
|
// Master/detail
|
|
148
148
|
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
@@ -151,7 +151,7 @@ var daDKGrid = {
|
|
|
151
151
|
// Row reordering text
|
|
152
152
|
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
153
153
|
// Aggregation
|
|
154
|
-
aggregationMenuItemHeader: '
|
|
154
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
155
155
|
aggregationFunctionLabelSum: 'sum',
|
|
156
156
|
aggregationFunctionLabelAvg: 'gns',
|
|
157
157
|
aggregationFunctionLabelMin: 'min',
|
package/locales/daDK.js
CHANGED
|
@@ -11,8 +11,8 @@ const daDKGrid = {
|
|
|
11
11
|
toolbarDensityStandard: 'Standard',
|
|
12
12
|
toolbarDensityComfortable: 'Luftig',
|
|
13
13
|
// Columns selector toolbar button text
|
|
14
|
-
toolbarColumns: '
|
|
15
|
-
toolbarColumnsLabel: 'Vælg
|
|
14
|
+
toolbarColumns: 'Kolonner',
|
|
15
|
+
toolbarColumnsLabel: 'Vælg kolonner',
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filtre',
|
|
18
18
|
toolbarFiltersLabel: 'Vis filtre',
|
|
@@ -40,12 +40,12 @@ const daDKGrid = {
|
|
|
40
40
|
filterPanelRemoveAll: 'Fjern alle',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Slet',
|
|
42
42
|
filterPanelLogicOperator: 'Logisk operator',
|
|
43
|
-
filterPanelOperator: '
|
|
43
|
+
filterPanelOperator: 'Operator',
|
|
44
44
|
filterPanelOperatorAnd: 'Og',
|
|
45
45
|
filterPanelOperatorOr: 'Eller',
|
|
46
|
-
filterPanelColumns: '
|
|
46
|
+
filterPanelColumns: 'Kolonner',
|
|
47
47
|
filterPanelInputLabel: 'Værdi',
|
|
48
|
-
filterPanelInputPlaceholder: '
|
|
48
|
+
filterPanelInputPlaceholder: 'Filterværdi',
|
|
49
49
|
// Filter operators text
|
|
50
50
|
filterOperatorContains: 'indeholder',
|
|
51
51
|
filterOperatorEquals: 'lig med',
|
|
@@ -92,10 +92,10 @@ const daDKGrid = {
|
|
|
92
92
|
filterValueFalse: 'negativ',
|
|
93
93
|
// Column menu text
|
|
94
94
|
columnMenuLabel: 'Menu',
|
|
95
|
-
columnMenuShowColumns: 'Vis
|
|
95
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
96
96
|
columnMenuManageColumns: 'Administrer kolonner',
|
|
97
|
-
columnMenuFilter: '
|
|
98
|
-
columnMenuHideColumn: 'Skjul',
|
|
97
|
+
columnMenuFilter: 'Filtrer',
|
|
98
|
+
columnMenuHideColumn: 'Skjul kolonne',
|
|
99
99
|
columnMenuUnsort: 'Fjern sortering',
|
|
100
100
|
columnMenuSortAsc: 'Sorter stigende',
|
|
101
101
|
columnMenuSortDesc: 'Sorter faldende',
|
|
@@ -125,13 +125,13 @@ const daDKGrid = {
|
|
|
125
125
|
pinToRight: 'Fastgør til højre',
|
|
126
126
|
unpin: 'Frigiv',
|
|
127
127
|
// Tree Data
|
|
128
|
-
treeDataGroupingHeaderName: '
|
|
128
|
+
treeDataGroupingHeaderName: 'Gruppe',
|
|
129
129
|
treeDataExpand: 'Vis underelementer',
|
|
130
130
|
treeDataCollapse: 'Skjul underelementer',
|
|
131
131
|
// Grouping columns
|
|
132
|
-
groupingColumnHeaderName: '
|
|
132
|
+
groupingColumnHeaderName: 'Gruppe',
|
|
133
133
|
groupColumn: name => `Gruppér efter ${name}`,
|
|
134
|
-
unGroupColumn: name => `Fjern
|
|
134
|
+
unGroupColumn: name => `Fjern gruppering efter ${name}`,
|
|
135
135
|
// Master/detail
|
|
136
136
|
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
137
137
|
expandDetailPanel: 'Udvid',
|
|
@@ -139,7 +139,7 @@ const daDKGrid = {
|
|
|
139
139
|
// Row reordering text
|
|
140
140
|
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
141
141
|
// Aggregation
|
|
142
|
-
aggregationMenuItemHeader: '
|
|
142
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
143
143
|
aggregationFunctionLabelSum: 'sum',
|
|
144
144
|
aggregationFunctionLabelAvg: 'gns',
|
|
145
145
|
aggregationFunctionLabelMin: 'min',
|
|
@@ -80,7 +80,7 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
|
80
80
|
slots?: UncapitalizeObjectKeys<Partial<GridSlotsComponent>>;
|
|
81
81
|
/**
|
|
82
82
|
* Set the locale text of the Data Grid.
|
|
83
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
83
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
84
84
|
*/
|
|
85
85
|
localeText?: Partial<GridLocaleText>;
|
|
86
86
|
}
|
|
@@ -278,7 +278,7 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
278
278
|
* Select the pageSize dynamically using the component UI.
|
|
279
279
|
* @default [25, 50, 100]
|
|
280
280
|
*/
|
|
281
|
-
pageSizeOptions:
|
|
281
|
+
pageSizeOptions: ReadonlyArray<number | {
|
|
282
282
|
value: number;
|
|
283
283
|
label: string;
|
|
284
284
|
}>;
|
|
@@ -314,7 +314,7 @@ DataGridRaw.propTypes = {
|
|
|
314
314
|
loading: PropTypes.bool,
|
|
315
315
|
/**
|
|
316
316
|
* Set the locale text of the Data Grid.
|
|
317
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
317
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
318
318
|
*/
|
|
319
319
|
localeText: PropTypes.object,
|
|
320
320
|
/**
|
|
@@ -24,6 +24,9 @@ const GridPaginationRoot = styled(TablePagination)(({
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}));
|
|
27
|
+
|
|
28
|
+
// A mutable version of a readonly array.
|
|
29
|
+
|
|
27
30
|
export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {
|
|
28
31
|
const apiRef = useGridApiContext();
|
|
29
32
|
const rootProps = useGridRootProps();
|
|
@@ -65,7 +68,11 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
65
68
|
ref: ref,
|
|
66
69
|
component: "div",
|
|
67
70
|
count: rowCount,
|
|
68
|
-
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
71
|
+
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
72
|
+
// TODO: Remove the cast once the type is fixed in Material UI and that the min Material UI version
|
|
73
|
+
// for x-data-grid is past the fix.
|
|
74
|
+
// Note that Material UI will not mutate the array, so this is safe.
|
|
75
|
+
,
|
|
69
76
|
rowsPerPageOptions: pageSizeOptions,
|
|
70
77
|
rowsPerPage: paginationModel.pageSize,
|
|
71
78
|
onPageChange: handlePageChange,
|
|
@@ -136,7 +136,7 @@ function GridActionsCell(props) {
|
|
|
136
136
|
if (event.key === 'Tab') {
|
|
137
137
|
event.preventDefault();
|
|
138
138
|
}
|
|
139
|
-
if (['Tab', '
|
|
139
|
+
if (['Tab', 'Escape'].includes(event.key)) {
|
|
140
140
|
hideMenu();
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -173,7 +173,6 @@ function GridActionsCell(props) {
|
|
|
173
173
|
target: buttonRef.current,
|
|
174
174
|
position: position,
|
|
175
175
|
onClose: hideMenu,
|
|
176
|
-
onClick: hideMenu,
|
|
177
176
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
178
177
|
id: menuId,
|
|
179
178
|
className: gridClasses.menuList,
|
|
@@ -182,7 +181,8 @@ function GridActionsCell(props) {
|
|
|
182
181
|
variant: "menu",
|
|
183
182
|
autoFocusItem: true,
|
|
184
183
|
children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
185
|
-
key: index
|
|
184
|
+
key: index,
|
|
185
|
+
closeMenu: hideMenu
|
|
186
186
|
}))
|
|
187
187
|
})
|
|
188
188
|
})]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["label", "icon", "showInMenu", "onClick"]
|
|
3
|
+
const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
4
|
+
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -9,20 +10,17 @@ import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
-
const {
|
|
13
|
-
label,
|
|
14
|
-
icon,
|
|
15
|
-
showInMenu,
|
|
16
|
-
onClick
|
|
17
|
-
} = props,
|
|
18
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
19
13
|
const rootProps = useGridRootProps();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
if (!props.showInMenu) {
|
|
15
|
+
const {
|
|
16
|
+
label,
|
|
17
|
+
icon,
|
|
18
|
+
onClick
|
|
19
|
+
} = props,
|
|
20
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
|
+
const handleClick = event => {
|
|
22
|
+
onClick?.(event);
|
|
23
|
+
};
|
|
26
24
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
27
25
|
ref: ref,
|
|
28
26
|
size: "small",
|
|
@@ -36,10 +34,24 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
36
34
|
})
|
|
37
35
|
}));
|
|
38
36
|
}
|
|
37
|
+
const {
|
|
38
|
+
label,
|
|
39
|
+
icon,
|
|
40
|
+
onClick,
|
|
41
|
+
closeMenuOnClick = true,
|
|
42
|
+
closeMenu
|
|
43
|
+
} = props,
|
|
44
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
45
|
+
const handleClick = event => {
|
|
46
|
+
onClick?.(event);
|
|
47
|
+
if (closeMenuOnClick) {
|
|
48
|
+
closeMenu?.();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
39
51
|
return /*#__PURE__*/_jsxs(MenuItem, _extends({
|
|
40
52
|
ref: ref
|
|
41
53
|
}, other, {
|
|
42
|
-
onClick:
|
|
54
|
+
onClick: handleClick,
|
|
43
55
|
children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {
|
|
44
56
|
children: icon
|
|
45
57
|
}), label]
|
|
@@ -193,6 +193,12 @@ export const GridRootStyles = styled('div', {
|
|
|
193
193
|
[`& .${gridClasses.cell} > *`]: {
|
|
194
194
|
overflow: 'visible !important',
|
|
195
195
|
whiteSpace: 'nowrap'
|
|
196
|
+
},
|
|
197
|
+
[`& .${gridClasses.groupingCriteriaCell}`]: {
|
|
198
|
+
width: 'unset'
|
|
199
|
+
},
|
|
200
|
+
[`& .${gridClasses.treeDataGroupingCell}`]: {
|
|
201
|
+
width: 'unset'
|
|
196
202
|
}
|
|
197
203
|
},
|
|
198
204
|
[`& .${gridClasses['virtualScrollerContent--overflowed']} .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {
|
|
@@ -1,6 +1,6 @@
|
|
|
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", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -24,7 +24,8 @@ function GridFilterInputBoolean(props) {
|
|
|
24
24
|
focusElementRef,
|
|
25
25
|
clearButton,
|
|
26
26
|
tabIndex,
|
|
27
|
-
label: labelProp
|
|
27
|
+
label: labelProp,
|
|
28
|
+
variant = 'standard'
|
|
28
29
|
} = props,
|
|
29
30
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
31
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -51,7 +52,7 @@ function GridFilterInputBoolean(props) {
|
|
|
51
52
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
|
|
52
53
|
id: labelId,
|
|
53
54
|
shrink: true,
|
|
54
|
-
variant:
|
|
55
|
+
variant: variant,
|
|
55
56
|
children: label
|
|
56
57
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
57
58
|
labelId: labelId,
|
|
@@ -59,7 +60,8 @@ function GridFilterInputBoolean(props) {
|
|
|
59
60
|
label: label,
|
|
60
61
|
value: filterValueState,
|
|
61
62
|
onChange: onFilterChange,
|
|
62
|
-
variant:
|
|
63
|
+
variant: variant,
|
|
64
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
63
65
|
native: isSelectNative,
|
|
64
66
|
displayEmpty: true,
|
|
65
67
|
inputProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -54,6 +54,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
54
54
|
placeholder,
|
|
55
55
|
tabIndex,
|
|
56
56
|
label: labelProp,
|
|
57
|
+
variant = 'standard',
|
|
57
58
|
clearButton
|
|
58
59
|
} = props,
|
|
59
60
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -119,7 +120,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
119
120
|
id: labelId,
|
|
120
121
|
htmlFor: id,
|
|
121
122
|
shrink: true,
|
|
122
|
-
variant:
|
|
123
|
+
variant: variant,
|
|
123
124
|
children: label
|
|
124
125
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
125
126
|
id: id,
|
|
@@ -127,15 +128,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
127
128
|
labelId: labelId,
|
|
128
129
|
value: filterValueState,
|
|
129
130
|
onChange: onFilterChange,
|
|
130
|
-
variant:
|
|
131
|
+
variant: variant,
|
|
131
132
|
type: type || 'text',
|
|
132
133
|
inputProps: {
|
|
133
134
|
tabIndex,
|
|
134
135
|
ref: focusElementRef,
|
|
135
136
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
136
137
|
},
|
|
137
|
-
native: isSelectNative
|
|
138
|
-
|
|
138
|
+
native: isSelectNative,
|
|
139
|
+
notched: variant === 'outlined' ? true : undefined
|
|
140
|
+
}, others /* FIXME: typing error */, rootProps.slotProps?.baseSelect, {
|
|
139
141
|
children: renderSingleSelectOptions({
|
|
140
142
|
column: resolvedColumn,
|
|
141
143
|
OptionComponent: rootProps.slots.baseSelectOption,
|