Skip to content

Commit

Permalink
Reuse definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw committed Feb 16, 2023
1 parent ea6384b commit 97dfb27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { TextFieldProps } from '@mui/material/TextField';
import { unstable_useId as useId } from '@mui/utils';
import MenuItem from '@mui/material/MenuItem';
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
import { GridSingleSelectColDef, ValueOptions } from '../../../models/colDef/gridColDef';
import { GridSingleSelectColDef } from '../../../models/colDef/gridColDef';
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';

const renderSingleSelectOptions = (
{ valueOptions, field }: GridSingleSelectColDef,
OptionComponent: React.ElementType,
getOptionLabel: (value: ValueOptions) => string,
getOptionValue: (value: ValueOptions) => any,
getOptionLabel: NonNullable<GridSingleSelectColDef['getOptionLabel']>,
getOptionValue: NonNullable<GridSingleSelectColDef['getOptionValue']>,
) => {
const iterableColumnValues =
typeof valueOptions === 'function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function isSingleSelectColDef(colDef: GridColDef | null): colDef is GridS
export function getValueFromValueOptions(
value: string,
valueOptions: any[] | undefined,
getOptionValue: (value: ValueOptions) => any,
getOptionValue: NonNullable<GridSingleSelectColDef['getOptionValue']>,
) {
if (valueOptions === undefined) {
return undefined;
Expand Down

0 comments on commit 97dfb27

Please sign in to comment.