UNPKG

@etsoo/materialui

Version:

TypeScript Material-UI Implementation

29 lines (28 loc) 1.44 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import FormControl from "@mui/material/FormControl"; import FormHelperText from "@mui/material/FormHelperText"; import InputLabel from "@mui/material/InputLabel"; import NotchedOutline from "@mui/material/OutlinedInput"; import React from "react"; /** * FieldSetEx * @param props Props * @returns Component */ export function FieldSetEx(props) { // Destruct const { label, helperText, required, fullWidth, children, ...rest } = props; // Layout return (_jsxs(React.Fragment, { children: [_jsxs(FormControl, { fullWidth: fullWidth, ...rest, children: [label && (_jsx(InputLabel, { required: required, variant: "outlined", shrink: true, children: label })), _jsx(NotchedOutline, { label: label && required ? label + " *" : label, notched: true, endAdornment: children, sx: { cursor: "default", display: "flex", flexWrap: "wrap", gap: 1, paddingX: 2, paddingY: "7px", width: fullWidth ? "100%" : "auto", "& input": { display: "none" } } })] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] })); }