Skip to content

Commit

Permalink
refactor: split base props file
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk committed Dec 16, 2024
1 parent c9434a4 commit 8f7134c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@mui/utils';
import { ButtonProps } from '@mui/material/Button';
import { TooltipProps } from '@mui/material/Tooltip';
import { BadgeProps } from '../../models/gridSlotsComponentsProps';
import { BadgeProps } from '../../models/gridBaseSlots';
import { gridColumnLookupSelector } from '../../hooks/features/columns/gridColumnsSelector';
import { useGridSelector } from '../../hooks/utils/useGridSelector';
import { gridFilterActiveItemsSelector } from '../../hooks/features/filter/gridFilterSelector';
Expand Down
23 changes: 23 additions & 0 deletions packages/x-data-grid/src/models/gridBaseSlots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export type BadgeProps = {
badgeContent?: React.ReactNode;
children: React.ReactNode;
color?: 'primary' | 'default' | 'error';
overlap?: 'circular';
variant?: 'dot';
invisible?: boolean;
};

export type DividerProps = {};

export type MenuItemProps = {
autoFocus?: boolean;
children: React.ReactNode;
/** For items that aren't interactive themselves (but may contain an interactive widget) */
inert?: boolean;
disabled?: boolean;
onClick?: React.MouseEventHandler<HTMLElement>;
iconStart?: React.ReactNode;
iconEnd?: React.ReactNode;
selected?: boolean;
value?: number | string | readonly string[];
};
25 changes: 1 addition & 24 deletions packages/x-data-grid/src/models/gridSlotsComponentsProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,11 @@ import type { GridColumnsManagementProps } from '../components/columnsManagement
import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
import type { GridRowCountProps } from '../components/GridRowCount';
import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
import type { BadgeProps, DividerProps, MenuItemProps } from './gridBaseSlots';

type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;

export type BadgeProps = {
badgeContent?: React.ReactNode;
children: React.ReactNode;
color?: 'primary' | 'default' | 'error';
overlap?: 'circular';
variant?: 'dot';
invisible?: boolean;
};

export type DividerProps = {};

export type MenuItemProps = {
autoFocus?: boolean;
children: React.ReactNode;
/** For items that aren't interactive themselves (but may contain an interactive widget) */
inert?: boolean;
disabled?: boolean;
onClick?: React.MouseEventHandler<HTMLElement>;
iconStart?: React.ReactNode;
iconEnd?: React.ReactNode;
selected?: boolean;
value?: number | string | readonly string[];
};

// Overrides for module augmentation
export interface BaseBadgePropsOverrides {}
export interface BaseCheckboxPropsOverrides {}
Expand Down
2 changes: 1 addition & 1 deletion scripts/x-data-grid-premium.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@
{ "name": "GridSkeletonCell", "kind": "Variable" },
{ "name": "GridSkeletonCellProps", "kind": "Interface" },
{ "name": "GridSkeletonRowNode", "kind": "Interface" },
{ "name": "GridSlotProps", "kind": "Interface" },
{ "name": "GridSlotProps", "kind": "TypeAlias" },
{ "name": "GridSlots", "kind": "Interface" },
{ "name": "GridSlotsComponent", "kind": "Interface" },
{ "name": "GridSlotsComponentsProps", "kind": "TypeAlias" },
Expand Down
2 changes: 1 addition & 1 deletion scripts/x-data-grid-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@
{ "name": "GridSkeletonCell", "kind": "Variable" },
{ "name": "GridSkeletonCellProps", "kind": "Interface" },
{ "name": "GridSkeletonRowNode", "kind": "Interface" },
{ "name": "GridSlotProps", "kind": "Interface" },
{ "name": "GridSlotProps", "kind": "TypeAlias" },
{ "name": "GridSlots", "kind": "Interface" },
{ "name": "GridSlotsComponent", "kind": "Interface" },
{ "name": "GridSlotsComponentsProps", "kind": "TypeAlias" },
Expand Down
2 changes: 1 addition & 1 deletion scripts/x-data-grid.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
{ "name": "GridSkeletonCell", "kind": "Variable" },
{ "name": "GridSkeletonCellProps", "kind": "Interface" },
{ "name": "GridSkeletonRowNode", "kind": "Interface" },
{ "name": "GridSlotProps", "kind": "Interface" },
{ "name": "GridSlotProps", "kind": "TypeAlias" },
{ "name": "GridSlots", "kind": "Interface" },
{ "name": "GridSlotsComponent", "kind": "Interface" },
{ "name": "GridSlotsComponentsProps", "kind": "TypeAlias" },
Expand Down

0 comments on commit 8f7134c

Please sign in to comment.