Skip to content

Commit

Permalink
[core] Remove outdated prop-types (#13181)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed May 20, 2024
1 parent 1fca5ac commit 55111b3
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 195 deletions.
20 changes: 0 additions & 20 deletions packages/x-charts/src/LineChart/MarkElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,6 @@ const MarkElementPath = styled(animated.path, {
strokeWidth: 2,
}));

MarkElementPath.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
as: PropTypes.elementType,
ownerState: PropTypes.shape({
classes: PropTypes.object,
color: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
isFaded: PropTypes.bool.isRequired,
isHighlighted: PropTypes.bool.isRequired,
}).isRequired,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
} as any;

export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighlighted'> &
Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> & {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import MenuItem from '@mui/material/MenuItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
Expand All @@ -17,7 +16,7 @@ import {
} from '../hooks/features/rowGrouping/gridRowGroupingUtils';
import { useGridRootProps } from '../hooks/utils/useGridRootProps';

function GridColumnMenuRowGroupItem(props: GridColumnMenuItemProps) {
export function GridColumnMenuRowGroupItem(props: GridColumnMenuItemProps) {
const { colDef, onClick } = props;
const apiRef = useGridApiContext();
const rowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
Expand Down Expand Up @@ -52,14 +51,3 @@ function GridColumnMenuRowGroupItem(props: GridColumnMenuItemProps) {

return renderUnGroupingMenuItem(getRowGroupingCriteriaFromGroupingField(colDef.field)!);
}

GridColumnMenuRowGroupItem.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
colDef: PropTypes.object.isRequired,
onClick: PropTypes.func.isRequired,
} as any;

export { GridColumnMenuRowGroupItem };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import MenuItem from '@mui/material/MenuItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
Expand All @@ -12,7 +11,7 @@ import { useGridApiContext } from '../hooks/utils/useGridApiContext';
import { gridRowGroupingSanitizedModelSelector } from '../hooks/features/rowGrouping/gridRowGroupingSelector';
import { useGridRootProps } from '../hooks/utils/useGridRootProps';

function GridColumnMenuRowUngroupItem(props: GridColumnMenuItemProps) {
export function GridColumnMenuRowUngroupItem(props: GridColumnMenuItemProps) {
const { colDef, onClick } = props;
const apiRef = useGridApiContext();
const rowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
Expand Down Expand Up @@ -55,14 +54,3 @@ function GridColumnMenuRowUngroupItem(props: GridColumnMenuItemProps) {
</MenuItem>
);
}

GridColumnMenuRowUngroupItem.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
colDef: PropTypes.object.isRequired,
onClick: PropTypes.func.isRequired,
} as any;

export { GridColumnMenuRowUngroupItem };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import {
GridGenericColumnMenu,
GridColumnMenuProps,
Expand Down Expand Up @@ -33,7 +32,7 @@ export const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM = {
columnMenuGroupingItem: { displayOrder: 27 },
};

const GridPremiumColumnMenu = React.forwardRef<HTMLUListElement, GridColumnMenuProps>(
export const GridPremiumColumnMenu = React.forwardRef<HTMLUListElement, GridColumnMenuProps>(
function GridPremiumColumnMenuSimple(props, ref) {
return (
<GridGenericColumnMenu
Expand All @@ -45,15 +44,3 @@ const GridPremiumColumnMenu = React.forwardRef<HTMLUListElement, GridColumnMenuP
);
},
);

GridPremiumColumnMenu.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
colDef: PropTypes.object.isRequired,
hideMenu: PropTypes.func.isRequired,
open: PropTypes.bool.isRequired,
} as any;

export { GridPremiumColumnMenu };
15 changes: 1 addition & 14 deletions packages/x-data-grid-pro/src/components/GridProColumnMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import {
GridGenericColumnMenu,
GridColumnMenuProps,
Expand All @@ -20,7 +19,7 @@ export const GRID_COLUMN_MENU_SLOT_PROPS_PRO = {
},
};

const GridProColumnMenu = React.forwardRef<HTMLUListElement, GridColumnMenuProps>(
export const GridProColumnMenu = React.forwardRef<HTMLUListElement, GridColumnMenuProps>(
function GridProColumnMenu(props, ref) {
return (
<GridGenericColumnMenu
Expand All @@ -32,15 +31,3 @@ const GridProColumnMenu = React.forwardRef<HTMLUListElement, GridColumnMenuProps
);
},
);

GridProColumnMenu.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
colDef: PropTypes.object.isRequired,
hideMenu: PropTypes.func.isRequired,
open: PropTypes.bool.isRequired,
} as any;

export { GridProColumnMenu };
13 changes: 1 addition & 12 deletions packages/x-data-grid/src/components/GridScrollArea.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import {
unstable_composeClasses as composeClasses,
Expand Down Expand Up @@ -170,14 +169,4 @@ function GridScrollAreaRaw(props: ScrollAreaProps) {
);
}

GridScrollAreaRaw.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
scrollDirection: PropTypes.oneOf(['left', 'right']).isRequired,
} as any;

const GridScrollArea = fastMemo(GridScrollAreaRaw);

export { GridScrollArea };
export const GridScrollArea = fastMemo(GridScrollAreaRaw);
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ const DateRangePickerDayRoot = styled('div', {
],
}));

DateRangePickerDayRoot.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
ownerState: PropTypes.object.isRequired,
} as any;

const DateRangePickerDayRangeIntervalPreview = styled('div', {
name: 'MuiDateRangePickerDay',
slot: 'RangeIntervalPreview',
Expand Down Expand Up @@ -272,14 +264,6 @@ const DateRangePickerDayRangeIntervalPreview = styled('div', {
],
}));

DateRangePickerDayRangeIntervalPreview.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
ownerState: PropTypes.object.isRequired,
} as any;

const DateRangePickerDayDay = styled(PickersDay, {
name: 'MuiDateRangePickerDay',
slot: 'Day',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,6 @@ const DateTimePickerToolbarRoot = styled(PickersToolbar, {
],
}));

DateTimePickerToolbarRoot.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
as: PropTypes.elementType,
classes: PropTypes.object,
className: PropTypes.string,
isLandscape: PropTypes.bool.isRequired,
isMobileKeyboardViewOpen: PropTypes.bool,
landscapeDirection: PropTypes.oneOf(['column', 'row']),
ownerState: PropTypes.object.isRequired,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
toggleMobileKeyboardView: PropTypes.func,
toolbarTitle: PropTypes.node,
viewType: PropTypes.oneOf(['date', 'time']),
} as any;

const DateTimePickerToolbarDateContainer = styled('div', {
name: 'MuiDateTimePickerToolbar',
slot: 'DateContainer',
Expand Down Expand Up @@ -175,20 +153,6 @@ const DateTimePickerToolbarTimeDigitsContainer = styled('div', {
],
}));

DateTimePickerToolbarTimeContainer.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
as: PropTypes.elementType,
ownerState: PropTypes.object.isRequired,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
} as any;

const DateTimePickerToolbarSeparator = styled(PickersToolbarText, {
name: 'MuiDateTimePickerToolbar',
slot: 'Separator',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ const DayCalendarSkeletonDay = styled(Skeleton, {
],
});

DayCalendarSkeletonDay.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
ownerState: PropTypes.shape({
day: PropTypes.number.isRequired,
}).isRequired,
} as any;

const monthMap = [
[0, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
Expand Down
20 changes: 1 addition & 19 deletions packages/x-date-pickers/src/PickersLayout/PickersLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const useUtilityClasses = (ownerState: PickersLayoutProps<any, any, any>) => {
return composeClasses(slots, getPickersLayoutUtilityClass, classes);
};

const PickersLayoutRoot = styled('div', {
export const PickersLayoutRoot = styled('div', {
name: 'MuiPickersLayout',
slot: 'Root',
overridesResolver: (props, styles) => styles.root,
Expand Down Expand Up @@ -52,24 +52,6 @@ const PickersLayoutRoot = styled('div', {
],
}));

PickersLayoutRoot.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
as: PropTypes.elementType,
ownerState: PropTypes.shape({
isLandscape: PropTypes.bool.isRequired,
}).isRequired,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
} as any;

export { PickersLayoutRoot };

export const PickersLayoutContentWrapper = styled('div', {
name: 'MuiPickersLayout',
slot: 'ContentWrapper',
Expand Down
28 changes: 0 additions & 28 deletions packages/x-date-pickers/src/TimePicker/TimePickerToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ const TimePickerToolbarHourMinuteLabel = styled('div', {
],
}));

TimePickerToolbarHourMinuteLabel.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
as: PropTypes.elementType,
ownerState: PropTypes.object.isRequired,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
} as any;

const TimePickerToolbarAmPmSelection = styled('div', {
name: 'MuiTimePickerToolbar',
slot: 'AmPmSelection',
Expand Down Expand Up @@ -143,20 +129,6 @@ const TimePickerToolbarAmPmSelection = styled('div', {
],
});

TimePickerToolbarAmPmSelection.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
as: PropTypes.elementType,
ownerState: PropTypes.object.isRequired,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
} as any;

/**
* Demos:
*
Expand Down

0 comments on commit 55111b3

Please sign in to comment.