diff --git a/packages/material-renderers/src/controls/MaterialDateControl.tsx b/packages/material-renderers/src/controls/MaterialDateControl.tsx index 111e20243..98127f923 100644 --- a/packages/material-renderers/src/controls/MaterialDateControl.tsx +++ b/packages/material-renderers/src/controls/MaterialDateControl.tsx @@ -35,12 +35,7 @@ import { withJsonFormsControlProps } from '@jsonforms/react'; import { FormHelperText, Hidden } from '@mui/material'; import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; -import { - createOnChangeHandler, - getData, - useFocus, - PickersActionBarParams, -} from '../util'; +import { createOnChangeHandler, getData, useFocus } from '../util'; export const MaterialDateControl = (props: ControlProps) => { const [focused, onFocus, onBlur] = useFocus(); @@ -96,7 +91,7 @@ export const MaterialDateControl = (props: ControlProps) => { views={views} disabled={!enabled} slotProps={{ - actionBar: ({ wrapperVariant }: PickersActionBarParams) => ({ + actionBar: ({ wrapperVariant }) => ({ actions: wrapperVariant === 'desktop' ? [] diff --git a/packages/material-renderers/src/controls/MaterialDateTimeControl.tsx b/packages/material-renderers/src/controls/MaterialDateTimeControl.tsx index 9ab353e98..5a83bf45b 100644 --- a/packages/material-renderers/src/controls/MaterialDateTimeControl.tsx +++ b/packages/material-renderers/src/controls/MaterialDateTimeControl.tsx @@ -35,12 +35,7 @@ import { withJsonFormsControlProps } from '@jsonforms/react'; import { FormHelperText, Hidden } from '@mui/material'; import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; -import { - createOnChangeHandler, - getData, - PickersActionBarParams, - useFocus, -} from '../util'; +import { createOnChangeHandler, getData, useFocus } from '../util'; export const MaterialDateTimeControl = (props: ControlProps) => { const [focused, onFocus, onBlur] = useFocus(); @@ -104,7 +99,7 @@ export const MaterialDateTimeControl = (props: ControlProps) => { views={views} disabled={!enabled} slotProps={{ - actionBar: ({ wrapperVariant }: PickersActionBarParams) => ({ + actionBar: ({ wrapperVariant }) => ({ actions: wrapperVariant === 'desktop' ? [] diff --git a/packages/material-renderers/src/controls/MaterialTimeControl.tsx b/packages/material-renderers/src/controls/MaterialTimeControl.tsx index 67cce2e28..ebdaba76a 100644 --- a/packages/material-renderers/src/controls/MaterialTimeControl.tsx +++ b/packages/material-renderers/src/controls/MaterialTimeControl.tsx @@ -35,12 +35,7 @@ import { withJsonFormsControlProps } from '@jsonforms/react'; import { FormHelperText, Hidden } from '@mui/material'; import { TimePicker, LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; -import { - createOnChangeHandler, - getData, - PickersActionBarParams, - useFocus, -} from '../util'; +import { createOnChangeHandler, getData, useFocus } from '../util'; export const MaterialTimeControl = (props: ControlProps) => { const [focused, onFocus, onBlur] = useFocus(); @@ -98,7 +93,7 @@ export const MaterialTimeControl = (props: ControlProps) => { views={views} disabled={!enabled} slotProps={{ - actionBar: ({ wrapperVariant }: PickersActionBarParams) => ({ + actionBar: ({ wrapperVariant }) => ({ actions: wrapperVariant === 'desktop' ? [] diff --git a/packages/material-renderers/src/util/types.ts b/packages/material-renderers/src/util/types.ts deleted file mode 100644 index ec8da4f64..000000000 --- a/packages/material-renderers/src/util/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - The MIT License - - Copyright (c) 2023 EclipseSource Munich - https://github.com/eclipsesource/jsonforms - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -// @mui/x-date-pickers does not provide types for the functional ActionBar API, therefore this -// helper interface was introduced to satisfy TS -export interface PickersActionBarParams { - wrapperVariant: 'mobile' | 'desktop' | null; -}