@etsoo/materialui
Version:
TypeScript Material-UI Implementation
23 lines (22 loc) • 1 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useAppContext } from "./app/ReactApp";
import { MUGlobal } from "./MUGlobal";
import { InputField } from "./InputField";
/**
* Phone input
* @param props Props
*/
export function PhoneInput(props) {
// Global app
const app = useAppContext();
// Destruct
const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "phone", fullWidth = true, label = app?.get("phone"), name = "phone", ...rest } = props;
// Slot props
const { htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
// Layout
return (_jsx(InputField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
htmlInput: { inputMode: "tel", maxLength: 18, ...htmlInput },
inputLabel: { shrink: MUGlobal.inputFieldShrink, ...inputLabel },
...restSlotProps
}, ...rest }));
}