diff --git a/src/components/fields/Email/Settings.tsx b/src/components/fields/Email/Settings.tsx new file mode 100644 index 00000000..72246736 --- /dev/null +++ b/src/components/fields/Email/Settings.tsx @@ -0,0 +1,28 @@ +import { ISettingsProps } from "@src/components/fields/types"; +import { TextField, Button } from "@mui/material"; + +export default function Settings({ onChange, config }: ISettingsProps) { + + const copyStandardRegex = () => { + onChange("validationRegex")("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-zA-z]{2,3}$"); + } + + return ( + <> + { + if (e.target.value === "") onChange("validationRegex")(null); + else onChange("validationRegex")(e.target.value); + }} + /> + + + ); +} diff --git a/src/components/fields/Email/index.tsx b/src/components/fields/Email/index.tsx index 3ea395d8..29e274c0 100644 --- a/src/components/fields/Email/index.tsx +++ b/src/components/fields/Email/index.tsx @@ -13,6 +13,10 @@ const SideDrawerField = lazy( import("./SideDrawerField" /* webpackChunkName: "SideDrawerField-Email" */) ); +const Settings = lazy( + () => import("./Settings" /* webpackChunkName: "Settings-ShortText" */) +); + export const config: IFieldConfig = { type: FieldType.email, name: "Email", @@ -25,6 +29,7 @@ export const config: IFieldConfig = { contextMenuActions: BasicContextMenuActions, TableCell: withRenderTableCell(DisplayCell, EditorCell), SideDrawerField, + settings: Settings, filter: { operators: filterOperators, },