Skip to content

Commit

Permalink
[DataGrid] Rename Checkbox component and props slots to BaseCheckbox (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DanailH authored Nov 9, 2021
1 parent 3d532fb commit 005df0e
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api-docs/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@
"throttleRowsMs": { "type": { "name": "number" }, "default": "0" }
},
"slots": {
"BaseCheckbox": { "default": "Checkbox", "type": { "name": "elementType" } },
"BooleanCellFalseIcon": { "default": "GridCloseIcon", "type": { "name": "elementType" } },
"BooleanCellTrueIcon": { "default": "GridCheckIcon", "type": { "name": "elementType" } },
"Cell": { "type": { "name": "elementType" } },
"Checkbox": { "default": "Checkbox", "type": { "name": "elementType" } },
"ColumnFilteredIcon": { "default": "GridFilterAltIcon", "type": { "name": "elementType" } },
"ColumnMenu": { "default": "GridColumnMenu", "type": { "name": "elementType" } },
"ColumnMenuIcon": {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/api-docs/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@
}
},
"slots": {
"BaseCheckbox": { "default": "Checkbox", "type": { "name": "elementType" } },
"BooleanCellFalseIcon": { "default": "GridCloseIcon", "type": { "name": "elementType" } },
"BooleanCellTrueIcon": { "default": "GridCheckIcon", "type": { "name": "elementType" } },
"Cell": { "type": { "name": "elementType" } },
"Checkbox": { "default": "Checkbox", "type": { "name": "elementType" } },
"ColumnFilteredIcon": { "default": "GridFilterAltIcon", "type": { "name": "elementType" } },
"ColumnMenu": { "default": "GridColumnMenu", "type": { "name": "elementType" } },
"ColumnMenuIcon": {
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/data-grid/data-grid-pro-pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
},
"slotDescriptions": {
"Cell": "Component rendered for each cell.",
"Checkbox": "The custom Checkbox component used in the grid for both header and cells.",
"BaseCheckbox": "The custom Checkbox component used in the grid for both header and cells.",
"ColumnMenu": "Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.",
"ErrorOverlay": "Error overlay component rendered above the grid when an error is caught.",
"Footer": "Footer component rendered at the bottom of the grid viewport.",
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/data-grid/data-grid-pro-zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
},
"slotDescriptions": {
"Cell": "Component rendered for each cell.",
"Checkbox": "The custom Checkbox component used in the grid for both header and cells.",
"BaseCheckbox": "The custom Checkbox component used in the grid for both header and cells.",
"ColumnMenu": "Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.",
"ErrorOverlay": "Error overlay component rendered above the grid when an error is caught.",
"Footer": "Footer component rendered at the bottom of the grid viewport.",
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
},
"slotDescriptions": {
"Cell": "Component rendered for each cell.",
"Checkbox": "The custom Checkbox component used in the grid for both header and cells.",
"BaseCheckbox": "The custom Checkbox component used in the grid for both header and cells.",
"ColumnMenu": "Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.",
"ErrorOverlay": "Error overlay component rendered above the grid when an error is caught.",
"Footer": "Footer component rendered at the bottom of the grid viewport.",
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/data-grid/data-grid-pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
},
"slotDescriptions": {
"Cell": "Component rendered for each cell.",
"Checkbox": "The custom Checkbox component used in the grid for both header and cells.",
"BaseCheckbox": "The custom Checkbox component used in the grid for both header and cells.",
"ColumnMenu": "Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.",
"ErrorOverlay": "Error overlay component rendered above the grid when an error is caught.",
"Footer": "Footer component rendered at the bottom of the grid viewport.",
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/data-grid/data-grid-zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
},
"slotDescriptions": {
"Cell": "Component rendered for each cell.",
"Checkbox": "The custom Checkbox component used in the grid for both header and cells.",
"BaseCheckbox": "The custom Checkbox component used in the grid for both header and cells.",
"ColumnMenu": "Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.",
"ErrorOverlay": "Error overlay component rendered above the grid when an error is caught.",
"Footer": "Footer component rendered at the bottom of the grid viewport.",
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/api-docs/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
},
"slotDescriptions": {
"Cell": "Component rendered for each cell.",
"Checkbox": "The custom Checkbox component used in the grid for both header and cells.",
"BaseCheckbox": "The custom Checkbox component used in the grid for both header and cells.",
"ColumnMenu": "Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.",
"ErrorOverlay": "Error overlay component rendered above the grid when an error is caught.",
"Footer": "Footer component rendered at the bottom of the grid viewport.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const GridCellCheckboxForwardRef = React.forwardRef<HTMLInputElement, GridCellPa
!rootProps.isRowSelectable || rootProps.isRowSelectable(apiRef.current.getRowParams(id));

return (
<rootProps.components.Checkbox
<rootProps.components.BaseCheckbox
ref={handleRef}
tabIndex={tabIndex}
checked={!!value}
Expand All @@ -84,7 +84,7 @@ const GridCellCheckboxForwardRef = React.forwardRef<HTMLInputElement, GridCellPa
inputProps={{ 'aria-label': 'Select Row checkbox' }}
onKeyDown={handleKeyDown}
disabled={!isSelectable}
{...rootProps.componentsProps?.checkbox}
{...rootProps.componentsProps?.baseCheckbox}
/>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const GridHeaderCheckbox = React.forwardRef<HTMLInputElement, GridColumnHeaderPa
}, [apiRef, handleSelectionChange]);

return (
<rootProps.components.Checkbox
<rootProps.components.BaseCheckbox
ref={ref}
indeterminate={isIndeterminate}
checked={isChecked}
Expand All @@ -128,7 +128,7 @@ const GridHeaderCheckbox = React.forwardRef<HTMLInputElement, GridColumnHeaderPa
inputProps={{ 'aria-label': 'Select All Rows checkbox' }}
tabIndex={tabIndex}
onKeyDown={handleKeyDown}
{...rootProps.componentsProps?.checkbox}
{...rootProps.componentsProps?.baseCheckbox}
/>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const DEFAULT_GRID_ICON_SLOTS_COMPONENTS: GridIconSlotsComponent = {
const DEFAULT_GRID_SLOTS_COMPONENTS: GridSlotsComponent = {
...DEFAULT_GRID_ICON_SLOTS_COMPONENTS,
Cell: GridCell,
Checkbox: MUICheckbox,
BaseCheckbox: MUICheckbox,
ColumnMenu: GridColumnMenu,
ErrorOverlay,
Footer: GridFooter,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/_modules_/grid/models/gridSlotsComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
* The custom Checkbox component used in the grid for both header and cells.
* @default Checkbox
*/
Checkbox: React.JSXElementConstructor<any>;
BaseCheckbox: React.JSXElementConstructor<any>;
/**
* Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.
* @default GridColumnMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Overrideable components props dynamically passed to the component at rendering.
*/
export interface GridSlotsComponentsProps {
checkbox?: any;
baseCheckbox?: any;
cell?: any;
columnMenu?: any;
columnsPanel?: any;
Expand Down

0 comments on commit 005df0e

Please sign in to comment.