var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef } from 'react';
import { makeStyles, TextField } from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
    input: {
        borderRadius: 2,
        height: (props) => !props.multiline && !Array.isArray(props.value) && 32, // multiline or multiselect
        padding: (props) => !props.multiline && 0,
        marginTop: 3
    },
    formTextInput: {
        fontSize: 14
    },
    labelRoot: {
        fontSize: 14
    },
    FormControl: {
        display: 'none',
        marginTop: 0
    },
    root: {
        marginTop: 25,
        '& .MuiFormLabel-root': {
            marginTop: -27,
            marginLeft: -15
        },
        '& .MuiInputAdornment-root': {
            paddingLeft: theme.spacing(1)
        }
    },
    noLabel: {
        marginTop: theme.spacing(1)
    }
}));
export const FluentTextFieldComponent = (props, ref) => {
    var _a;
    const classes = useStyles(props);
    const { id, label, startAdornment, endAdornment, udprecordid, inputProps } = props, InputProps = __rest(props, ["id", "label", "startAdornment", "endAdornment", "udprecordid", "inputProps"]);
    return (React.createElement("div", { className: label ? classes.root : classes.noLabel }, React.createElement(TextField, Object.assign({}, InputProps, { id: id, variant: "outlined", size: "small", inputRef: ref, margin: "dense", label: label, classes: { label: classes.label }, inputProps: Object.assign({ id: id, udprecordid: udprecordid }, inputProps), InputProps: Object.assign(Object.assign(Object.assign({ classes: Object.assign({ root: classes.input, input: classes.formTextInput }, (_a = props.InputProps) === null || _a === void 0 ? void 0 : _a.classes) }, props.InputProps), startAdornment), endAdornment), InputLabelProps: {
            shrink: false,
            classes: {
                root: classes.labelRoot,
                focused: classes.labelFocused
            }
        } }))));
};
export const FluentTextField = forwardRef(FluentTextFieldComponent);
//# sourceMappingURL=FluentTextField.js.map