@mui/x-data-grid 9.4.0 → 9.6.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 +251 -0
- package/DataGrid/DataGrid.js +74 -13
- package/DataGrid/DataGrid.mjs +74 -13
- package/colDef/gridColumnTypesRegistry.d.mts +8 -0
- package/colDef/gridColumnTypesRegistry.d.ts +8 -0
- package/colDef/gridColumnTypesRegistry.js +44 -0
- package/colDef/gridColumnTypesRegistry.mjs +34 -0
- package/colDef/gridDefaultColumnTypes.d.mts +1 -1
- package/colDef/gridDefaultColumnTypes.d.ts +1 -1
- package/colDef/gridDefaultColumnTypes.js +11 -23
- package/colDef/gridDefaultColumnTypes.mjs +4 -22
- package/components/GridColumnHeaders.js +1 -1
- package/components/GridColumnHeaders.mjs +1 -1
- package/components/GridColumnUnsortedIcon.js +1 -1
- package/components/GridColumnUnsortedIcon.mjs +1 -1
- package/components/GridFooter.js +1 -1
- package/components/GridFooter.mjs +1 -1
- package/components/GridLoadingOverlay.js +1 -1
- package/components/GridLoadingOverlay.mjs +1 -1
- package/components/GridNoColumnsOverlay.js +1 -1
- package/components/GridNoColumnsOverlay.mjs +1 -1
- package/components/GridNoRowsOverlay.js +1 -1
- package/components/GridNoRowsOverlay.mjs +1 -1
- package/components/GridRow.js +1 -1
- package/components/GridRow.mjs +1 -1
- package/components/GridRowCount.js +1 -1
- package/components/GridRowCount.mjs +1 -1
- package/components/GridRowDragAndDropOverlay.d.mts +1 -1
- package/components/GridRowDragAndDropOverlay.d.ts +1 -1
- package/components/GridSelectedRowCount.js +1 -1
- package/components/GridSelectedRowCount.mjs +1 -1
- package/components/GridShadowScrollArea.js +1 -1
- package/components/GridShadowScrollArea.mjs +1 -1
- package/components/cell/GridActionsCell.js +84 -4
- package/components/cell/GridActionsCell.mjs +84 -4
- package/components/cell/GridActionsCellItem.js +75 -1
- package/components/cell/GridActionsCellItem.mjs +74 -0
- package/components/cell/GridBooleanCell.js +1 -1
- package/components/cell/GridBooleanCell.mjs +1 -1
- package/components/cell/GridCell.js +1 -1
- package/components/cell/GridCell.mjs +1 -1
- package/components/cell/GridEditBooleanCell.js +1 -1
- package/components/cell/GridEditBooleanCell.mjs +1 -1
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditDateCell.mjs +1 -1
- package/components/cell/GridEditInputCell.js +68 -0
- package/components/cell/GridEditInputCell.mjs +68 -0
- package/components/cell/GridEditLongTextCell.d.mts +3 -0
- package/components/cell/GridEditLongTextCell.d.ts +3 -0
- package/components/cell/GridEditLongTextCell.js +141 -0
- package/components/cell/GridEditLongTextCell.mjs +141 -0
- package/components/cell/GridEditSingleSelectCell.js +1 -1
- package/components/cell/GridEditSingleSelectCell.mjs +1 -1
- package/components/cell/GridLongTextCell.d.mts +3 -0
- package/components/cell/GridLongTextCell.d.ts +3 -0
- package/components/cell/GridLongTextCell.js +68 -0
- package/components/cell/GridLongTextCell.mjs +68 -0
- package/components/cell/GridSkeletonCell.js +3 -2
- package/components/cell/GridSkeletonCell.mjs +3 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.mjs +2 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.mjs +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.mjs +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +1 -1
- package/components/columnSelection/GridHeaderCheckbox.mjs +1 -1
- package/components/columnSelection/GridRowCheckbox.js +1 -1
- package/components/columnSelection/GridRowCheckbox.mjs +1 -1
- package/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/components/columnsManagement/GridColumnsManagement.mjs +1 -1
- package/components/columnsPanel/ColumnsPanelTrigger.js +1 -1
- package/components/columnsPanel/ColumnsPanelTrigger.mjs +1 -1
- package/components/containers/GridFooterContainer.js +1 -1
- package/components/containers/GridFooterContainer.mjs +1 -1
- package/components/containers/GridOverlay.js +1 -1
- package/components/containers/GridOverlay.mjs +1 -1
- package/components/containers/GridRoot.js +1 -1
- package/components/containers/GridRoot.mjs +1 -1
- package/components/containers/GridRootStyles.js +32 -2
- package/components/containers/GridRootStyles.mjs +32 -2
- package/components/containers/GridToolbarContainer.js +1 -1
- package/components/containers/GridToolbarContainer.mjs +1 -1
- package/components/export/ExportCsv.js +1 -1
- package/components/export/ExportCsv.mjs +1 -1
- package/components/export/ExportPrint.js +1 -1
- package/components/export/ExportPrint.mjs +1 -1
- package/components/filterPanel/FilterPanelTrigger.js +1 -1
- package/components/filterPanel/FilterPanelTrigger.mjs +1 -1
- package/components/menu/GridMenu.js +1 -1
- package/components/menu/GridMenu.mjs +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.mjs +1 -1
- package/components/menu/columnMenu/GridColumnMenu.js +2 -2
- package/components/menu/columnMenu/GridColumnMenu.mjs +2 -2
- package/components/menu/columnMenu/GridColumnMenuContainer.js +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.mjs +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.mjs +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.mjs +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.mjs +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.mjs +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.mjs +1 -1
- package/components/panel/GridPanel.js +1 -1
- package/components/panel/GridPanel.mjs +1 -1
- package/components/panel/GridPanelContent.js +1 -1
- package/components/panel/GridPanelContent.mjs +1 -1
- package/components/panel/GridPanelFooter.js +1 -1
- package/components/panel/GridPanelFooter.mjs +1 -1
- package/components/panel/GridPanelHeader.js +1 -1
- package/components/panel/GridPanelHeader.mjs +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.mjs +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.mjs +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.mjs +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.mjs +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +3 -5
- package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +3 -5
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/components/panel/filterPanel/GridFilterInputValue.mjs +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/components/panel/filterPanel/GridFilterPanel.mjs +1 -1
- package/components/panel/filterPanel/filterPanelUtils.d.mts +3 -2
- package/components/panel/filterPanel/filterPanelUtils.d.ts +3 -2
- package/components/panel/filterPanel/filterPanelUtils.js +4 -0
- package/components/panel/filterPanel/filterPanelUtils.mjs +3 -0
- package/components/quickFilter/QuickFilter.js +1 -1
- package/components/quickFilter/QuickFilter.mjs +1 -1
- package/components/quickFilter/QuickFilterClear.js +1 -1
- package/components/quickFilter/QuickFilterClear.mjs +1 -1
- package/components/quickFilter/QuickFilterControl.js +1 -1
- package/components/quickFilter/QuickFilterControl.mjs +1 -1
- package/components/quickFilter/QuickFilterTrigger.js +1 -1
- package/components/quickFilter/QuickFilterTrigger.mjs +1 -1
- package/components/toolbar/GridToolbar.js +1 -1
- package/components/toolbar/GridToolbar.mjs +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +1 -1
- package/components/toolbar/GridToolbarColumnsButton.mjs +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/components/toolbar/GridToolbarDensitySelector.mjs +1 -1
- package/components/toolbar/GridToolbarExport.js +3 -3
- package/components/toolbar/GridToolbarExport.mjs +3 -3
- package/components/toolbar/GridToolbarExportContainer.js +1 -1
- package/components/toolbar/GridToolbarExportContainer.mjs +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +1 -1
- package/components/toolbar/GridToolbarFilterButton.mjs +1 -1
- package/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/components/toolbar/GridToolbarQuickFilter.mjs +1 -1
- package/components/toolbarV8/GridToolbar.js +8 -3
- package/components/toolbarV8/GridToolbar.mjs +8 -3
- package/components/toolbarV8/Toolbar.js +1 -1
- package/components/toolbarV8/Toolbar.mjs +1 -1
- package/components/toolbarV8/ToolbarButton.js +1 -1
- package/components/toolbarV8/ToolbarButton.mjs +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +8 -1
- package/components/virtualization/GridVirtualScrollbar.mjs +8 -1
- package/components/virtualization/GridVirtualScroller.js +12 -0
- package/components/virtualization/GridVirtualScroller.mjs +12 -0
- package/constants/cssVariables.d.mts +3 -0
- package/constants/cssVariables.d.ts +3 -0
- package/constants/cssVariables.js +2 -1
- package/constants/cssVariables.mjs +2 -1
- package/constants/gridClasses.d.mts +48 -0
- package/constants/gridClasses.d.ts +48 -0
- package/constants/gridClasses.js +1 -1
- package/constants/gridClasses.mjs +1 -1
- package/hooks/core/useGridProps.js +5 -3
- package/hooks/core/useGridProps.mjs +5 -3
- package/hooks/features/columns/gridColumnsUtils.js +18 -10
- package/hooks/features/columns/gridColumnsUtils.mjs +19 -11
- package/hooks/features/columns/useGridColumns.js +11 -0
- package/hooks/features/columns/useGridColumns.mjs +11 -0
- package/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
- package/hooks/features/dataSource/useGridDataSourceBase.mjs +2 -2
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridCellEditing.mjs +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.mjs +1 -1
- package/hooks/features/export/serializers/csvSerializer.js +3 -1
- package/hooks/features/export/serializers/csvSerializer.mjs +3 -1
- package/hooks/features/filter/gridFilterUtils.js +5 -3
- package/hooks/features/filter/gridFilterUtils.mjs +5 -3
- package/hooks/features/listView/useGridListView.js +1 -1
- package/hooks/features/listView/useGridListView.mjs +1 -1
- package/hooks/features/sorting/gridSortingUtils.js +3 -1
- package/hooks/features/sorting/gridSortingUtils.mjs +3 -1
- package/hooks/utils/useGridSelector.js +27 -24
- package/hooks/utils/useGridSelector.mjs +26 -24
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/index.d.mts +9 -4
- package/internals/index.d.ts +9 -4
- package/internals/index.js +62 -2
- package/internals/index.mjs +8 -4
- package/internals/utils/propValidation.js +3 -0
- package/internals/utils/propValidation.mjs +3 -0
- package/material/augmentation.d.mts +4 -0
- package/material/augmentation.d.ts +4 -0
- package/material/index.js +42 -26
- package/material/index.mjs +42 -26
- package/material/variables.js +2 -1
- package/material/variables.mjs +2 -1
- package/models/colDef/gridColDef.d.mts +35 -3
- package/models/colDef/gridColDef.d.ts +35 -3
- package/models/colDef/gridColType.d.mts +1 -0
- package/models/colDef/gridColType.d.ts +1 -0
- package/models/colDef/gridColumnTypesRecord.d.mts +1 -1
- package/models/colDef/gridColumnTypesRecord.d.ts +1 -1
- package/models/colDef/index.d.mts +1 -1
- package/models/colDef/index.d.ts +1 -1
- package/models/gridBaseSlots.d.mts +46 -0
- package/models/gridBaseSlots.d.ts +46 -0
- package/models/gridSlotsComponent.d.mts +5 -0
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.mts +3 -1
- package/models/gridSlotsComponentsProps.d.ts +3 -1
- package/models/gridStateCommunity.d.mts +1 -1
- package/models/gridStateCommunity.d.ts +1 -1
- package/package.json +7 -4
package/material/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon")
|
|
|
32
32
|
var _ListItemText = _interopRequireWildcard(require("@mui/material/ListItemText"));
|
|
33
33
|
var _MenuList = _interopRequireDefault(require("@mui/material/MenuList"));
|
|
34
34
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
35
|
+
var _Modal = _interopRequireDefault(require("@mui/material/Modal"));
|
|
35
36
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
36
37
|
var _TextareaAutosize = _interopRequireDefault(require("@mui/material/TextareaAutosize"));
|
|
37
38
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
@@ -61,7 +62,7 @@ var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
|
61
62
|
require("./augmentation");
|
|
62
63
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
63
64
|
var _variables = require("./variables");
|
|
64
|
-
const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "size", "style", "fullWidth"],
|
|
65
|
+
const _excluded = ["id", "label", "labelId", "material", "disabled", "multiple", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "renderValue", "size", "style", "fullWidth"],
|
|
65
66
|
_excluded2 = ["onRowsPerPageChange", "material", "disabled"],
|
|
66
67
|
_excluded3 = ["material"],
|
|
67
68
|
_excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material", "inputRef"],
|
|
@@ -77,18 +78,19 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
|
|
|
77
78
|
_excluded12 = ["material", "label", "className"],
|
|
78
79
|
_excluded13 = ["material"],
|
|
79
80
|
_excluded14 = ["inert", "iconStart", "iconEnd", "children", "material"],
|
|
80
|
-
_excluded15 = ["
|
|
81
|
-
_excluded16 = ["
|
|
82
|
-
_excluded17 = ["
|
|
83
|
-
_excluded18 = ["
|
|
81
|
+
_excluded15 = ["material"],
|
|
82
|
+
_excluded16 = ["slotProps", "material"],
|
|
83
|
+
_excluded17 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
|
|
84
|
+
_excluded18 = ["key"],
|
|
84
85
|
_excluded19 = ["slotProps"],
|
|
85
86
|
_excluded20 = ["slotProps"],
|
|
86
|
-
_excluded21 = ["slotProps"
|
|
87
|
-
_excluded22 = ["material"],
|
|
88
|
-
_excluded23 = ["
|
|
89
|
-
_excluded24 = ["
|
|
90
|
-
_excluded25 = ["
|
|
91
|
-
_excluded26 = ["
|
|
87
|
+
_excluded21 = ["slotProps"],
|
|
88
|
+
_excluded22 = ["slotProps", "material"],
|
|
89
|
+
_excluded23 = ["material"],
|
|
90
|
+
_excluded24 = ["open", "children", "className", "clickAwayTouchEvent", "clickAwayMouseEvent", "flip", "focusTrap", "onExited", "onClickAway", "onDidShow", "onDidHide", "id", "target", "transition", "placement", "material"],
|
|
91
|
+
_excluded25 = ["native"],
|
|
92
|
+
_excluded26 = ["children", "value", "active"],
|
|
93
|
+
_excluded27 = ["items", "value", "material"];
|
|
92
94
|
/* eslint-disable mui/disallow-react-api-in-server-components */
|
|
93
95
|
|
|
94
96
|
const InputAdornment = (0, _styles.styled)(_InputAdornment.default, {
|
|
@@ -155,11 +157,13 @@ const BaseSelect = (0, _forwardRef.forwardRef)(function BaseSelect(props, ref) {
|
|
|
155
157
|
labelId,
|
|
156
158
|
material,
|
|
157
159
|
disabled,
|
|
160
|
+
multiple,
|
|
158
161
|
slotProps,
|
|
159
162
|
onChange,
|
|
160
163
|
onKeyDown,
|
|
161
164
|
onOpen,
|
|
162
165
|
onClose,
|
|
166
|
+
renderValue,
|
|
163
167
|
size,
|
|
164
168
|
style,
|
|
165
169
|
fullWidth
|
|
@@ -196,7 +200,9 @@ const BaseSelect = (0, _forwardRef.forwardRef)(function BaseSelect(props, ref) {
|
|
|
196
200
|
labelId: labelId,
|
|
197
201
|
label: label,
|
|
198
202
|
displayEmpty: true,
|
|
203
|
+
multiple: multiple,
|
|
199
204
|
onChange: onChange,
|
|
205
|
+
renderValue: renderValue,
|
|
200
206
|
variant: computedVariant
|
|
201
207
|
}, other, {
|
|
202
208
|
inputProps: slotProps?.htmlInput,
|
|
@@ -484,12 +490,19 @@ function BaseMenuItem(props) {
|
|
|
484
490
|
children: iconEnd
|
|
485
491
|
}, "3")]);
|
|
486
492
|
}
|
|
493
|
+
function BaseModal(props) {
|
|
494
|
+
const {
|
|
495
|
+
material
|
|
496
|
+
} = props,
|
|
497
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded15);
|
|
498
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, (0, _extends2.default)({}, other, material));
|
|
499
|
+
}
|
|
487
500
|
function BaseTextField(props) {
|
|
488
501
|
const {
|
|
489
502
|
slotProps,
|
|
490
503
|
material
|
|
491
504
|
} = props,
|
|
492
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
505
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded16);
|
|
493
506
|
const theme = (0, _styles.useTheme)();
|
|
494
507
|
const textFieldDefaults = theme.components?.MuiTextField?.defaultProps ?? {};
|
|
495
508
|
const computedVariant = other.variant ?? textFieldDefaults.variant ?? 'outlined';
|
|
@@ -523,7 +536,7 @@ function BaseAutocomplete(props) {
|
|
|
523
536
|
slotProps,
|
|
524
537
|
material
|
|
525
538
|
} = props,
|
|
526
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
539
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded17);
|
|
527
540
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, (0, _extends2.default)({
|
|
528
541
|
id: id,
|
|
529
542
|
multiple: multiple,
|
|
@@ -540,28 +553,28 @@ function BaseAutocomplete(props) {
|
|
|
540
553
|
{
|
|
541
554
|
key
|
|
542
555
|
} = _getTagProps,
|
|
543
|
-
tagProps = (0, _objectWithoutPropertiesLoose2.default)(_getTagProps,
|
|
556
|
+
tagProps = (0, _objectWithoutPropertiesLoose2.default)(_getTagProps, _excluded18);
|
|
544
557
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, (0, _extends2.default)({
|
|
545
558
|
variant: "outlined",
|
|
546
559
|
size: "small",
|
|
547
560
|
label: typeof option === 'string' ? option : getOptionLabel?.(option)
|
|
548
|
-
}, tagProps), key);
|
|
561
|
+
}, tagProps, typeof slotProps?.chip === 'function' ? slotProps.chip(option, index) : slotProps?.chip), key);
|
|
549
562
|
}),
|
|
550
563
|
renderInput: params => {
|
|
551
564
|
const {
|
|
552
565
|
slotProps: autocompleteSlotProps
|
|
553
566
|
} = params,
|
|
554
|
-
inputRest = (0, _objectWithoutPropertiesLoose2.default)(params,
|
|
567
|
+
inputRest = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded19);
|
|
555
568
|
const _ref = slotProps?.textField ?? {},
|
|
556
569
|
{
|
|
557
570
|
slotProps: textFieldSlotProps
|
|
558
571
|
} = _ref,
|
|
559
|
-
textFieldRest = (0, _objectWithoutPropertiesLoose2.default)(_ref,
|
|
572
|
+
textFieldRest = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded20);
|
|
560
573
|
const _ref2 = rootProps.slotProps?.baseTextField ?? {},
|
|
561
574
|
{
|
|
562
575
|
slotProps: baseTextFieldSlotProps
|
|
563
576
|
} = _ref2,
|
|
564
|
-
baseTextFieldRest = (0, _objectWithoutPropertiesLoose2.default)(_ref2,
|
|
577
|
+
baseTextFieldRest = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded21);
|
|
565
578
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, (0, _extends2.default)({}, inputRest, {
|
|
566
579
|
label: label,
|
|
567
580
|
placeholder: placeholder
|
|
@@ -588,7 +601,7 @@ function transformInputProps(props, wrapAdornments = true) {
|
|
|
588
601
|
slotProps,
|
|
589
602
|
material
|
|
590
603
|
} = props,
|
|
591
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
604
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded22);
|
|
592
605
|
const result = other;
|
|
593
606
|
if (wrapAdornments) {
|
|
594
607
|
if (result.startAdornment) {
|
|
@@ -622,7 +635,7 @@ const BaseTextarea = (0, _forwardRef.forwardRef)(function BaseTextarea(props, re
|
|
|
622
635
|
const {
|
|
623
636
|
material
|
|
624
637
|
} = props,
|
|
625
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
638
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded23);
|
|
626
639
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextareaAutosize.default, (0, _extends2.default)({}, other, material, {
|
|
627
640
|
ref: ref
|
|
628
641
|
}));
|
|
@@ -632,7 +645,7 @@ const transformOrigin = {
|
|
|
632
645
|
'bottom-start': 'top left',
|
|
633
646
|
'bottom-end': 'top right'
|
|
634
647
|
};
|
|
635
|
-
function BasePopper(props) {
|
|
648
|
+
const BasePopper = (0, _forwardRef.forwardRef)(function BasePopper(props, ref) {
|
|
636
649
|
const {
|
|
637
650
|
open,
|
|
638
651
|
children,
|
|
@@ -647,7 +660,7 @@ function BasePopper(props) {
|
|
|
647
660
|
placement,
|
|
648
661
|
material
|
|
649
662
|
} = props,
|
|
650
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
663
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded24);
|
|
651
664
|
const modifiers = React.useMemo(() => {
|
|
652
665
|
const result = [{
|
|
653
666
|
name: 'preventOverflow',
|
|
@@ -707,9 +720,11 @@ function BasePopper(props) {
|
|
|
707
720
|
placement: placement,
|
|
708
721
|
modifiers: modifiers
|
|
709
722
|
}, other, material, {
|
|
723
|
+
ref: ref,
|
|
710
724
|
children: content
|
|
711
725
|
}));
|
|
712
|
-
}
|
|
726
|
+
});
|
|
727
|
+
if (process.env.NODE_ENV !== "production") BasePopper.displayName = "BasePopper";
|
|
713
728
|
function wrappers(props, content) {
|
|
714
729
|
return focusTrapWrapper(props, clickAwayWrapper(props, content));
|
|
715
730
|
}
|
|
@@ -742,7 +757,7 @@ function BaseSelectOption(_ref3) {
|
|
|
742
757
|
let {
|
|
743
758
|
native
|
|
744
759
|
} = _ref3,
|
|
745
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_ref3,
|
|
760
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded25);
|
|
746
761
|
if (native) {
|
|
747
762
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", (0, _extends2.default)({}, props));
|
|
748
763
|
}
|
|
@@ -777,7 +792,7 @@ function TabPanel(props) {
|
|
|
777
792
|
children,
|
|
778
793
|
active
|
|
779
794
|
} = props,
|
|
780
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props,
|
|
795
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded26);
|
|
781
796
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTabPanel, (0, _extends2.default)({
|
|
782
797
|
role: "tabpanel",
|
|
783
798
|
style: {
|
|
@@ -793,7 +808,7 @@ function BaseTabs(_ref4) {
|
|
|
793
808
|
value,
|
|
794
809
|
material
|
|
795
810
|
} = _ref4,
|
|
796
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_ref4,
|
|
811
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref4, _excluded27);
|
|
797
812
|
const id = (0, _useId.default)();
|
|
798
813
|
const labelId = `${id}-tab-${value}`;
|
|
799
814
|
const panelId = `${id}-tabpanel-${value}`;
|
|
@@ -873,6 +888,7 @@ const baseSlots = {
|
|
|
873
888
|
baseLinearProgress: BaseLinearProgress,
|
|
874
889
|
baseMenuList: BaseMenuList,
|
|
875
890
|
baseMenuItem: BaseMenuItem,
|
|
891
|
+
baseModal: BaseModal,
|
|
876
892
|
baseTextField: BaseTextField,
|
|
877
893
|
baseButton: BaseButton,
|
|
878
894
|
baseIconButton: BaseIconButton,
|
package/material/index.mjs
CHANGED
|
@@ -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 = ["id", "label", "labelId", "material", "disabled", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "size", "style", "fullWidth"],
|
|
3
|
+
const _excluded = ["id", "label", "labelId", "material", "disabled", "multiple", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "renderValue", "size", "style", "fullWidth"],
|
|
4
4
|
_excluded2 = ["onRowsPerPageChange", "material", "disabled"],
|
|
5
5
|
_excluded3 = ["material"],
|
|
6
6
|
_excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material", "inputRef"],
|
|
@@ -16,18 +16,19 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
|
|
|
16
16
|
_excluded12 = ["material", "label", "className"],
|
|
17
17
|
_excluded13 = ["material"],
|
|
18
18
|
_excluded14 = ["inert", "iconStart", "iconEnd", "children", "material"],
|
|
19
|
-
_excluded15 = ["
|
|
20
|
-
_excluded16 = ["
|
|
21
|
-
_excluded17 = ["
|
|
22
|
-
_excluded18 = ["
|
|
19
|
+
_excluded15 = ["material"],
|
|
20
|
+
_excluded16 = ["slotProps", "material"],
|
|
21
|
+
_excluded17 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
|
|
22
|
+
_excluded18 = ["key"],
|
|
23
23
|
_excluded19 = ["slotProps"],
|
|
24
24
|
_excluded20 = ["slotProps"],
|
|
25
|
-
_excluded21 = ["slotProps"
|
|
26
|
-
_excluded22 = ["material"],
|
|
27
|
-
_excluded23 = ["
|
|
28
|
-
_excluded24 = ["
|
|
29
|
-
_excluded25 = ["
|
|
30
|
-
_excluded26 = ["
|
|
25
|
+
_excluded21 = ["slotProps"],
|
|
26
|
+
_excluded22 = ["slotProps", "material"],
|
|
27
|
+
_excluded23 = ["material"],
|
|
28
|
+
_excluded24 = ["open", "children", "className", "clickAwayTouchEvent", "clickAwayMouseEvent", "flip", "focusTrap", "onExited", "onClickAway", "onDidShow", "onDidHide", "id", "target", "transition", "placement", "material"],
|
|
29
|
+
_excluded25 = ["native"],
|
|
30
|
+
_excluded26 = ["children", "value", "active"],
|
|
31
|
+
_excluded27 = ["items", "value", "material"];
|
|
31
32
|
import * as React from 'react';
|
|
32
33
|
import clsx from 'clsx';
|
|
33
34
|
import useForkRef from '@mui/utils/useForkRef';
|
|
@@ -46,6 +47,7 @@ import MUIListItemIcon from '@mui/material/ListItemIcon';
|
|
|
46
47
|
import MUIListItemText, { listItemTextClasses } from '@mui/material/ListItemText';
|
|
47
48
|
import MUIMenuList from '@mui/material/MenuList';
|
|
48
49
|
import MUIMenuItem from '@mui/material/MenuItem';
|
|
50
|
+
import MUIModal from '@mui/material/Modal';
|
|
49
51
|
import MUITextField from '@mui/material/TextField';
|
|
50
52
|
import MUITextareaAutosize from '@mui/material/TextareaAutosize';
|
|
51
53
|
import MUIFormControl from '@mui/material/FormControl';
|
|
@@ -142,11 +144,13 @@ const BaseSelect = forwardRef(function BaseSelect(props, ref) {
|
|
|
142
144
|
labelId,
|
|
143
145
|
material,
|
|
144
146
|
disabled,
|
|
147
|
+
multiple,
|
|
145
148
|
slotProps,
|
|
146
149
|
onChange,
|
|
147
150
|
onKeyDown,
|
|
148
151
|
onOpen,
|
|
149
152
|
onClose,
|
|
153
|
+
renderValue,
|
|
150
154
|
size,
|
|
151
155
|
style,
|
|
152
156
|
fullWidth
|
|
@@ -183,7 +187,9 @@ const BaseSelect = forwardRef(function BaseSelect(props, ref) {
|
|
|
183
187
|
labelId: labelId,
|
|
184
188
|
label: label,
|
|
185
189
|
displayEmpty: true,
|
|
190
|
+
multiple: multiple,
|
|
186
191
|
onChange: onChange,
|
|
192
|
+
renderValue: renderValue,
|
|
187
193
|
variant: computedVariant
|
|
188
194
|
}, other, {
|
|
189
195
|
inputProps: slotProps?.htmlInput,
|
|
@@ -471,12 +477,19 @@ function BaseMenuItem(props) {
|
|
|
471
477
|
children: iconEnd
|
|
472
478
|
}, "3")]);
|
|
473
479
|
}
|
|
480
|
+
function BaseModal(props) {
|
|
481
|
+
const {
|
|
482
|
+
material
|
|
483
|
+
} = props,
|
|
484
|
+
other = _objectWithoutPropertiesLoose(props, _excluded15);
|
|
485
|
+
return /*#__PURE__*/_jsx(MUIModal, _extends({}, other, material));
|
|
486
|
+
}
|
|
474
487
|
function BaseTextField(props) {
|
|
475
488
|
const {
|
|
476
489
|
slotProps,
|
|
477
490
|
material
|
|
478
491
|
} = props,
|
|
479
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
492
|
+
other = _objectWithoutPropertiesLoose(props, _excluded16);
|
|
480
493
|
const theme = useTheme();
|
|
481
494
|
const textFieldDefaults = theme.components?.MuiTextField?.defaultProps ?? {};
|
|
482
495
|
const computedVariant = other.variant ?? textFieldDefaults.variant ?? 'outlined';
|
|
@@ -510,7 +523,7 @@ function BaseAutocomplete(props) {
|
|
|
510
523
|
slotProps,
|
|
511
524
|
material
|
|
512
525
|
} = props,
|
|
513
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
526
|
+
other = _objectWithoutPropertiesLoose(props, _excluded17);
|
|
514
527
|
return /*#__PURE__*/_jsx(MUIAutocomplete, _extends({
|
|
515
528
|
id: id,
|
|
516
529
|
multiple: multiple,
|
|
@@ -527,28 +540,28 @@ function BaseAutocomplete(props) {
|
|
|
527
540
|
{
|
|
528
541
|
key
|
|
529
542
|
} = _getTagProps,
|
|
530
|
-
tagProps = _objectWithoutPropertiesLoose(_getTagProps,
|
|
543
|
+
tagProps = _objectWithoutPropertiesLoose(_getTagProps, _excluded18);
|
|
531
544
|
return /*#__PURE__*/_jsx(MUIChip, _extends({
|
|
532
545
|
variant: "outlined",
|
|
533
546
|
size: "small",
|
|
534
547
|
label: typeof option === 'string' ? option : getOptionLabel?.(option)
|
|
535
|
-
}, tagProps), key);
|
|
548
|
+
}, tagProps, typeof slotProps?.chip === 'function' ? slotProps.chip(option, index) : slotProps?.chip), key);
|
|
536
549
|
}),
|
|
537
550
|
renderInput: params => {
|
|
538
551
|
const {
|
|
539
552
|
slotProps: autocompleteSlotProps
|
|
540
553
|
} = params,
|
|
541
|
-
inputRest = _objectWithoutPropertiesLoose(params,
|
|
554
|
+
inputRest = _objectWithoutPropertiesLoose(params, _excluded19);
|
|
542
555
|
const _ref = slotProps?.textField ?? {},
|
|
543
556
|
{
|
|
544
557
|
slotProps: textFieldSlotProps
|
|
545
558
|
} = _ref,
|
|
546
|
-
textFieldRest = _objectWithoutPropertiesLoose(_ref,
|
|
559
|
+
textFieldRest = _objectWithoutPropertiesLoose(_ref, _excluded20);
|
|
547
560
|
const _ref2 = rootProps.slotProps?.baseTextField ?? {},
|
|
548
561
|
{
|
|
549
562
|
slotProps: baseTextFieldSlotProps
|
|
550
563
|
} = _ref2,
|
|
551
|
-
baseTextFieldRest = _objectWithoutPropertiesLoose(_ref2,
|
|
564
|
+
baseTextFieldRest = _objectWithoutPropertiesLoose(_ref2, _excluded21);
|
|
552
565
|
return /*#__PURE__*/_jsx(MUITextField, _extends({}, inputRest, {
|
|
553
566
|
label: label,
|
|
554
567
|
placeholder: placeholder
|
|
@@ -575,7 +588,7 @@ function transformInputProps(props, wrapAdornments = true) {
|
|
|
575
588
|
slotProps,
|
|
576
589
|
material
|
|
577
590
|
} = props,
|
|
578
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
591
|
+
other = _objectWithoutPropertiesLoose(props, _excluded22);
|
|
579
592
|
const result = other;
|
|
580
593
|
if (wrapAdornments) {
|
|
581
594
|
if (result.startAdornment) {
|
|
@@ -609,7 +622,7 @@ const BaseTextarea = forwardRef(function BaseTextarea(props, ref) {
|
|
|
609
622
|
const {
|
|
610
623
|
material
|
|
611
624
|
} = props,
|
|
612
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
625
|
+
other = _objectWithoutPropertiesLoose(props, _excluded23);
|
|
613
626
|
return /*#__PURE__*/_jsx(MUITextareaAutosize, _extends({}, other, material, {
|
|
614
627
|
ref: ref
|
|
615
628
|
}));
|
|
@@ -619,7 +632,7 @@ const transformOrigin = {
|
|
|
619
632
|
'bottom-start': 'top left',
|
|
620
633
|
'bottom-end': 'top right'
|
|
621
634
|
};
|
|
622
|
-
function BasePopper(props) {
|
|
635
|
+
const BasePopper = forwardRef(function BasePopper(props, ref) {
|
|
623
636
|
const {
|
|
624
637
|
open,
|
|
625
638
|
children,
|
|
@@ -634,7 +647,7 @@ function BasePopper(props) {
|
|
|
634
647
|
placement,
|
|
635
648
|
material
|
|
636
649
|
} = props,
|
|
637
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
650
|
+
other = _objectWithoutPropertiesLoose(props, _excluded24);
|
|
638
651
|
const modifiers = React.useMemo(() => {
|
|
639
652
|
const result = [{
|
|
640
653
|
name: 'preventOverflow',
|
|
@@ -694,9 +707,11 @@ function BasePopper(props) {
|
|
|
694
707
|
placement: placement,
|
|
695
708
|
modifiers: modifiers
|
|
696
709
|
}, other, material, {
|
|
710
|
+
ref: ref,
|
|
697
711
|
children: content
|
|
698
712
|
}));
|
|
699
|
-
}
|
|
713
|
+
});
|
|
714
|
+
if (process.env.NODE_ENV !== "production") BasePopper.displayName = "BasePopper";
|
|
700
715
|
function wrappers(props, content) {
|
|
701
716
|
return focusTrapWrapper(props, clickAwayWrapper(props, content));
|
|
702
717
|
}
|
|
@@ -729,7 +744,7 @@ function BaseSelectOption(_ref3) {
|
|
|
729
744
|
let {
|
|
730
745
|
native
|
|
731
746
|
} = _ref3,
|
|
732
|
-
props = _objectWithoutPropertiesLoose(_ref3,
|
|
747
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded25);
|
|
733
748
|
if (native) {
|
|
734
749
|
return /*#__PURE__*/_jsx("option", _extends({}, props));
|
|
735
750
|
}
|
|
@@ -764,7 +779,7 @@ function TabPanel(props) {
|
|
|
764
779
|
children,
|
|
765
780
|
active
|
|
766
781
|
} = props,
|
|
767
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
782
|
+
other = _objectWithoutPropertiesLoose(props, _excluded26);
|
|
768
783
|
return /*#__PURE__*/_jsx(StyledTabPanel, _extends({
|
|
769
784
|
role: "tabpanel",
|
|
770
785
|
style: {
|
|
@@ -780,7 +795,7 @@ function BaseTabs(_ref4) {
|
|
|
780
795
|
value,
|
|
781
796
|
material
|
|
782
797
|
} = _ref4,
|
|
783
|
-
props = _objectWithoutPropertiesLoose(_ref4,
|
|
798
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded27);
|
|
784
799
|
const id = useId();
|
|
785
800
|
const labelId = `${id}-tab-${value}`;
|
|
786
801
|
const panelId = `${id}-tabpanel-${value}`;
|
|
@@ -860,6 +875,7 @@ const baseSlots = {
|
|
|
860
875
|
baseLinearProgress: BaseLinearProgress,
|
|
861
876
|
baseMenuList: BaseMenuList,
|
|
862
877
|
baseMenuItem: BaseMenuItem,
|
|
878
|
+
baseModal: BaseModal,
|
|
863
879
|
baseTextField: BaseTextField,
|
|
864
880
|
baseButton: BaseButton,
|
|
865
881
|
baseIconButton: BaseIconButton,
|
package/material/variables.js
CHANGED
|
@@ -75,7 +75,8 @@ function transformTheme(t) {
|
|
|
75
75
|
[k.shadows.base]: (t.vars || t).shadows[2],
|
|
76
76
|
[k.shadows.overlay]: (t.vars || t).shadows[8],
|
|
77
77
|
[k.zIndex.panel]: (t.vars || t).zIndex.modal,
|
|
78
|
-
[k.zIndex.menu]: (t.vars || t).zIndex.modal
|
|
78
|
+
[k.zIndex.menu]: (t.vars || t).zIndex.modal,
|
|
79
|
+
[k.zIndex.modal]: (t.vars || t).zIndex.modal
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
function getRadius(theme) {
|
package/material/variables.mjs
CHANGED
|
@@ -68,7 +68,8 @@ function transformTheme(t) {
|
|
|
68
68
|
[k.shadows.base]: (t.vars || t).shadows[2],
|
|
69
69
|
[k.shadows.overlay]: (t.vars || t).shadows[8],
|
|
70
70
|
[k.zIndex.panel]: (t.vars || t).zIndex.modal,
|
|
71
|
-
[k.zIndex.menu]: (t.vars || t).zIndex.modal
|
|
71
|
+
[k.zIndex.menu]: (t.vars || t).zIndex.modal,
|
|
72
|
+
[k.zIndex.modal]: (t.vars || t).zIndex.modal
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
function getRadius(theme) {
|
|
@@ -250,7 +250,6 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
|
|
|
250
250
|
export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
|
|
251
251
|
/**
|
|
252
252
|
* The type of the column.
|
|
253
|
-
* @default 'actions'
|
|
254
253
|
*/
|
|
255
254
|
type: 'actions';
|
|
256
255
|
/**
|
|
@@ -282,7 +281,6 @@ export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F
|
|
|
282
281
|
export interface GridSingleSelectColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
|
|
283
282
|
/**
|
|
284
283
|
* The type of the column.
|
|
285
|
-
* @default 'singleSelect'
|
|
286
284
|
*/
|
|
287
285
|
type: 'singleSelect';
|
|
288
286
|
/**
|
|
@@ -304,12 +302,46 @@ export interface GridSingleSelectColDef<R extends GridValidRowModel = any, V = a
|
|
|
304
302
|
*/
|
|
305
303
|
getOptionValue: (value: ValueOptions) => any;
|
|
306
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Column Definition interface used for columns with the `multiSelect` type.
|
|
307
|
+
* @demos
|
|
308
|
+
* - [Special column properties](/x/react-data-grid/column-definition/#special-properties)
|
|
309
|
+
*/
|
|
310
|
+
export interface GridMultiSelectColDef<R extends GridValidRowModel = any, V = (string | number)[], F = string> extends GridBaseColDef<R, V, F> {
|
|
311
|
+
/**
|
|
312
|
+
* The type of the column.
|
|
313
|
+
*/
|
|
314
|
+
type: 'multiSelect';
|
|
315
|
+
/**
|
|
316
|
+
* To be used in combination with `type: 'multiSelect'`. This is an array (or a function returning an array) of the possible cell values and labels.
|
|
317
|
+
*/
|
|
318
|
+
valueOptions?: Array<ValueOptions> | ((params: GridValueOptionsParams<R>) => Array<ValueOptions>);
|
|
319
|
+
/**
|
|
320
|
+
* Used to determine the label displayed for a given value option.
|
|
321
|
+
* @param {ValueOptions} value The current value option.
|
|
322
|
+
* @returns {string} The text to be displayed.
|
|
323
|
+
* @default {defaultGetOptionLabel}
|
|
324
|
+
*/
|
|
325
|
+
getOptionLabel: (value: ValueOptions) => string;
|
|
326
|
+
/**
|
|
327
|
+
* Used to determine the value used for a value option.
|
|
328
|
+
* @param {ValueOptions} value The current value option.
|
|
329
|
+
* @returns {string | number} The value to be used.
|
|
330
|
+
* @default {defaultGetOptionValue}
|
|
331
|
+
*/
|
|
332
|
+
getOptionValue: (value: ValueOptions) => string | number;
|
|
333
|
+
/**
|
|
334
|
+
* The separator used to join array values for display and export.
|
|
335
|
+
* @default ','
|
|
336
|
+
*/
|
|
337
|
+
separator?: string;
|
|
338
|
+
}
|
|
307
339
|
/**
|
|
308
340
|
* Column Definition interface.
|
|
309
341
|
* @demos
|
|
310
342
|
* - [Column definition](/x/react-data-grid/column-definition/)
|
|
311
343
|
*/
|
|
312
|
-
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F> | GridSingleSelectColDef<R, V, F>;
|
|
344
|
+
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F> | GridSingleSelectColDef<R, V, F> | GridMultiSelectColDef<R, V, F>;
|
|
313
345
|
/**
|
|
314
346
|
* Column Definition interface used for the list view column.
|
|
315
347
|
* @demos
|
|
@@ -250,7 +250,6 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
|
|
|
250
250
|
export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
|
|
251
251
|
/**
|
|
252
252
|
* The type of the column.
|
|
253
|
-
* @default 'actions'
|
|
254
253
|
*/
|
|
255
254
|
type: 'actions';
|
|
256
255
|
/**
|
|
@@ -282,7 +281,6 @@ export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F
|
|
|
282
281
|
export interface GridSingleSelectColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
|
|
283
282
|
/**
|
|
284
283
|
* The type of the column.
|
|
285
|
-
* @default 'singleSelect'
|
|
286
284
|
*/
|
|
287
285
|
type: 'singleSelect';
|
|
288
286
|
/**
|
|
@@ -304,12 +302,46 @@ export interface GridSingleSelectColDef<R extends GridValidRowModel = any, V = a
|
|
|
304
302
|
*/
|
|
305
303
|
getOptionValue: (value: ValueOptions) => any;
|
|
306
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Column Definition interface used for columns with the `multiSelect` type.
|
|
307
|
+
* @demos
|
|
308
|
+
* - [Special column properties](/x/react-data-grid/column-definition/#special-properties)
|
|
309
|
+
*/
|
|
310
|
+
export interface GridMultiSelectColDef<R extends GridValidRowModel = any, V = (string | number)[], F = string> extends GridBaseColDef<R, V, F> {
|
|
311
|
+
/**
|
|
312
|
+
* The type of the column.
|
|
313
|
+
*/
|
|
314
|
+
type: 'multiSelect';
|
|
315
|
+
/**
|
|
316
|
+
* To be used in combination with `type: 'multiSelect'`. This is an array (or a function returning an array) of the possible cell values and labels.
|
|
317
|
+
*/
|
|
318
|
+
valueOptions?: Array<ValueOptions> | ((params: GridValueOptionsParams<R>) => Array<ValueOptions>);
|
|
319
|
+
/**
|
|
320
|
+
* Used to determine the label displayed for a given value option.
|
|
321
|
+
* @param {ValueOptions} value The current value option.
|
|
322
|
+
* @returns {string} The text to be displayed.
|
|
323
|
+
* @default {defaultGetOptionLabel}
|
|
324
|
+
*/
|
|
325
|
+
getOptionLabel: (value: ValueOptions) => string;
|
|
326
|
+
/**
|
|
327
|
+
* Used to determine the value used for a value option.
|
|
328
|
+
* @param {ValueOptions} value The current value option.
|
|
329
|
+
* @returns {string | number} The value to be used.
|
|
330
|
+
* @default {defaultGetOptionValue}
|
|
331
|
+
*/
|
|
332
|
+
getOptionValue: (value: ValueOptions) => string | number;
|
|
333
|
+
/**
|
|
334
|
+
* The separator used to join array values for display and export.
|
|
335
|
+
* @default ','
|
|
336
|
+
*/
|
|
337
|
+
separator?: string;
|
|
338
|
+
}
|
|
307
339
|
/**
|
|
308
340
|
* Column Definition interface.
|
|
309
341
|
* @demos
|
|
310
342
|
* - [Column definition](/x/react-data-grid/column-definition/)
|
|
311
343
|
*/
|
|
312
|
-
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F> | GridSingleSelectColDef<R, V, F>;
|
|
344
|
+
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F> | GridSingleSelectColDef<R, V, F> | GridMultiSelectColDef<R, V, F>;
|
|
313
345
|
/**
|
|
314
346
|
* Column Definition interface used for the list view column.
|
|
315
347
|
* @demos
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { GridColTypeDef } from "./gridColDef.mjs";
|
|
2
2
|
import type { GridColType } from "./gridColType.mjs";
|
|
3
|
-
export
|
|
3
|
+
export interface GridColumnTypesRecord extends Omit<Record<GridColType, GridColTypeDef>, 'multiSelect'> {}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { GridColTypeDef } from "./gridColDef.js";
|
|
2
2
|
import type { GridColType } from "./gridColType.js";
|
|
3
|
-
export
|
|
3
|
+
export interface GridColumnTypesRecord extends Omit<Record<GridColType, GridColTypeDef>, 'multiSelect'> {}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridListViewColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, GridValueGetter, GridValueFormatter, GridValueSetter, GridValueParser, GridColSpanFn } from "./gridColDef.mjs";
|
|
1
|
+
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridListViewColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridMultiSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, GridValueGetter, GridValueFormatter, GridValueSetter, GridValueParser, GridColSpanFn } from "./gridColDef.mjs";
|
|
2
2
|
export * from "./gridColType.mjs";
|
|
3
3
|
export * from "./gridColumnTypesRecord.mjs";
|
package/models/colDef/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridListViewColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, GridValueGetter, GridValueFormatter, GridValueSetter, GridValueParser, GridColSpanFn } from "./gridColDef.js";
|
|
1
|
+
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridListViewColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridMultiSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, GridValueGetter, GridValueFormatter, GridValueSetter, GridValueParser, GridColSpanFn } from "./gridColDef.js";
|
|
2
2
|
export * from "./gridColType.js";
|
|
3
3
|
export * from "./gridColumnTypesRecord.js";
|