Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/rescript-mui-material/src/components/Autocomplete.res
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ type renderGroupParams = {
children?: React.element,
}

type renderInputParams<'value> = {
type renderInputParams<'value, 'inputRef> = {
id: string,
disabled: bool,
fullWidth: bool,
size: size,
@as("InputLabelProps") inputLabelProps: InputLabel.props,
@as("InputProps") inputProps_: Input.props<'value>,
@as("InputProps") inputProps_: Input.props<'value, 'inputRef>,
inputProps: InputBase.inputBaseComponentProps,
}

external renderInputParamsToTextFieldProps: renderInputParams<'a> => TextField.props<'value> =
external renderInputParamsToTextFieldProps: renderInputParams<'a, 'inputRef> => TextField.props<'value, 'inputRef> =
"%identity"

type slotProps = {
Expand All @@ -167,7 +167,7 @@ type slotProps = {
popupIndicator?: IconButton.props,
}

type autocompleteProps<'value> = {
type autocompleteProps<'value, 'inputRef> = {
...CommonProps.t_NoId,
/**
* Array of options.
Expand All @@ -179,7 +179,7 @@ type autocompleteProps<'value> = {
* @param {object} params
* @returns {ReactNode}
*/
renderInput: renderInputParams<'value> => React.element,
renderInput: renderInputParams<'value, 'inputRef> => React.element,
/**
* If `true`, the portion of the selected suggestion that has not been typed by the user,
* known as the completion string, appears inline after the input cursor in the textbox.
Expand Down Expand Up @@ -530,8 +530,8 @@ module Multiple = {
@unboxed
type multiple = | @as(true) True

type props<'value> = {
...autocompleteProps<'value>,
type props<'value, 'inputRef> = {
...autocompleteProps<'value, 'inputRef>,
/**
* The default value. Use when the component is not controlled.
* @default []
Expand Down Expand Up @@ -570,11 +570,11 @@ module Multiple = {
}

@module("@mui/material/Autocomplete")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
}

type props<'value> = {
...autocompleteProps<'value>,
type props<'value, 'inputRef> = {
...autocompleteProps<'value, 'inputRef>,
/**
* The default value. Use when the component is not controlled.
* @default null
Expand Down Expand Up @@ -611,4 +611,4 @@ type props<'value> = {
}

@module("@mui/material/Autocomplete")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
6 changes: 3 additions & 3 deletions packages/rescript-mui-material/src/components/Checkbox.res
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type edge =
| @as("end") End
| @as(false) False

type props<'value> = {
type props<'value, 'inputRef> = {
...ButtonBase.publicPropsWithOnClick,
/**
* If `true`, the component is checked.
Expand Down Expand Up @@ -103,7 +103,7 @@ type props<'value> = {
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.ref<'value>,
inputRef?: React.ref<'inputRef>,
/**
* Name attribute of the `input` element.
*/
Expand Down Expand Up @@ -139,4 +139,4 @@ type props<'value> = {
}

@module("@mui/material/Checkbox")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
6 changes: 3 additions & 3 deletions packages/rescript-mui-material/src/components/FilledInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type classes = {
inputTypeSearch?: string,
}

type props<'value> = {
...InputBase.publicProps<'value>,
type props<'value, 'inputRef> = {
...InputBase.publicProps<'value, 'inputRef>,
/**
* Override or extend the styles applied to the component.
*/
Expand All @@ -64,4 +64,4 @@ type props<'value> = {
}

@module("@mui/material/FilledInput")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type labelPlacement =
| @as("top") Top
| @as("bottom") Bottom

type props<'value> = {
type props<'value, 'inputRef> = {
...CommonProps.t,
/**
* A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
Expand All @@ -59,7 +59,7 @@ type props<'value> = {
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.ref<unknown>,
inputRef?: React.ref<'inputRef>,
/**
* A text or an element to be used in an enclosing label element.
*/
Expand Down Expand Up @@ -96,4 +96,4 @@ type props<'value> = {
}

@module("@mui/material/FormControlLabel")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
6 changes: 3 additions & 3 deletions packages/rescript-mui-material/src/components/Input.res
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type classes = {
inputTypeSearch?: string,
}

type props<'value> = {
...InputBase.publicProps<'value>,
type props<'value, 'inputRef> = {
...InputBase.publicProps<'value, 'inputRef>,
/**
* Override or extend the styles applied to the component.
*/
Expand All @@ -53,4 +53,4 @@ type props<'value> = {
}

@module("@mui/material/Input")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
10 changes: 5 additions & 5 deletions packages/rescript-mui-material/src/components/InputBase.res
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type slots = {
input?: React.element,
}

type publicProps<'value> = {
type publicProps<'value, 'inputRef> = {
...CommonProps.t_NoId,
/**
* This prop helps users to fill forms faster, especially on mobile devices.
Expand Down Expand Up @@ -157,7 +157,7 @@ type publicProps<'value> = {
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.ref<'value>,
inputRef?: React.ref<'inputRef>,
/**
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
* FormControl.
Expand Down Expand Up @@ -256,8 +256,8 @@ type publicProps<'value> = {
wrap?: CommonProps.wrap,
}

type props<'value> = {
...publicProps<'value>,
type props<'value, 'inputRef> = {
...publicProps<'value, 'inputRef>,
/**
* Override or extend the styles applied to the component.
*/
Expand All @@ -276,4 +276,4 @@ type props<'value> = {
}

@module("@mui/material/InputBase")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ type variant =
| @as("outlined") Outlined
| @as("standard") Standard

type props<'value> = {
...InputBase.publicProps<'value>,
type props<'value, 'inputRef> = {
...InputBase.publicProps<'value, 'inputRef>,
/**
* The option elements to populate the select with.
* Can be some `<option>` elements.
Expand Down Expand Up @@ -75,4 +75,4 @@ type props<'value> = {
}

@module("@mui/material/NativeSelect")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
10 changes: 5 additions & 5 deletions packages/rescript-mui-material/src/components/OutlinedInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ type classes = {
inputTypeSearch?: string,
}

type publicProps<'value> = {
...InputBase.publicProps<'value>,
type publicProps<'value, 'inputRef> = {
...InputBase.publicProps<'value, 'inputRef>,
/**
* If `true`, the outline is notched to accommodate the label.
*/
notched?: bool,
}

type props<'value> = {
...publicProps<'value>,
type props<'value, 'inputRef> = {
...publicProps<'value, 'inputRef>,
/**
* Override or extend the styles applied to the component.
*/
Expand All @@ -65,4 +65,4 @@ type props<'value> = {
}

@module("@mui/material/OutlinedInput")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
6 changes: 3 additions & 3 deletions packages/rescript-mui-material/src/components/Radio.res
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type edge =
| @as("end") End
| @as(false) False

type props<'value> = {
type props<'value, 'inputRef> = {
...ButtonBase.publicPropsWithOnClick,
/**
* If `true`, the component is checked.
Expand Down Expand Up @@ -88,7 +88,7 @@ type props<'value> = {
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.ref<'value>,
inputRef?: React.ref<'inputRef>,
/**
* Name attribute of the `input` element.
*/
Expand Down Expand Up @@ -124,4 +124,4 @@ type props<'value> = {
}

@module("@mui/material/Radio")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
6 changes: 3 additions & 3 deletions packages/rescript-mui-material/src/components/Select.res
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type variant =
| @as("outlined") Outlined
| @as("filled") Filled

type props<'value> = {
...OutlinedInput.publicProps<'value>,
type props<'value, 'inputRef> = {
...OutlinedInput.publicProps<'value, 'inputRef>,
/**
* If `true`, the width of the popover will automatically be set according to the items inside the
* menu, otherwise it will be at least the width of the select input.
Expand Down Expand Up @@ -162,4 +162,4 @@ type props<'value> = {
}

@module("@mui/material/Select")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
6 changes: 3 additions & 3 deletions packages/rescript-mui-material/src/components/Switch.res
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type edge =
| @as("end") End
| @as(false) False

type props<'value> = {
type props<'value, 'inputRef> = {
...ButtonBase.publicPropsWithOnClick,
/**
* If `true`, the component is checked.
Expand Down Expand Up @@ -102,7 +102,7 @@ type props<'value> = {
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.ref<'value>,
inputRef?: React.ref<'inputRef>,
/**
* Name attribute of the `input` element.
*/
Expand Down Expand Up @@ -139,4 +139,4 @@ type props<'value> = {
}

@module("@mui/material/Switch")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type labelDisplayedRowsArgs = {
page: int,
}

type props = {
type props<'inputRef> = {
...TableCell.publicProps,
/**
* The total number of rows.
Expand Down Expand Up @@ -163,7 +163,7 @@ type props = {
* @default {}
*/
@as("SelectProps")
selectProps?: Select.props<int>,
selectProps?: Select.props<int, 'inputRef>,
/**
* If `true`, show the first-page button.
* @default false
Expand All @@ -181,4 +181,4 @@ type props = {
}

@module("@mui/material/TablePagination")
external make: React.component<props> = "default"
external make: React.component<props<'inputRef>> = "default"
10 changes: 5 additions & 5 deletions packages/rescript-mui-material/src/components/TextField.res
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type variant =
| @as("outlined") Outlined
| @as("filled") Filled

type props<'value> = {
type props<'value, 'inputRef> = {
...CommonProps.t,
...CommonProps.inputTextareaProps,
...CommonProps.eventHandlerProps,
Expand Down Expand Up @@ -86,11 +86,11 @@ type props<'value> = {
* component depending on the `variant` prop value.
*/
@as("InputProps")
inputProps_?: Input.props<'value>,
inputProps_?: Input.props<'value, 'inputRef>,
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.ref<unknown>,
inputRef?: React.ref<'inputRef>,
/**
* The label content.
*/
Expand Down Expand Up @@ -123,7 +123,7 @@ type props<'value> = {
* Props applied to the [`Select`](/material-ui/api/select/) element.
*/
@as("SelectProps")
selectProps?: Select.props<'value>,
selectProps?: Select.props<'value, 'inputRef>,
/**
* The size of the component.
*/
Expand All @@ -143,4 +143,4 @@ type props<'value> = {
}

@module("@mui/material/TextField")
external make: React.component<props<'value>> = "default"
external make: React.component<props<'value, 'inputRef>> = "default"
Loading