Skip to content
Snippets Groups Projects
Commit c73a7feb authored by Tom Robinson's avatar Tom Robinson
Browse files

Add boolean and numeric form widgets

parent 125ed8b3
Branches
Tags
No related merge requests found
......@@ -5,6 +5,8 @@ import FormTextAreaWidget from "./widgets/FormTextAreaWidget";
import FormPasswordWidget from "./widgets/FormPasswordWidget";
import FormColorWidget from "./widgets/FormColorWidget";
import FormSelectWidget from "./widgets/FormSelectWidget";
import FormNumericInputWidget from "./widgets/FormNumericInputWidget";
import FormToggleWidget from "./widgets/FormToggleWidget";
import FormCollectionWidget from "./widgets/FormCollectionWidget";
import FormHiddenWidget from "./widgets/FormHiddenWidget";
......@@ -14,6 +16,8 @@ const WIDGETS = {
color: FormColorWidget,
password: FormPasswordWidget,
select: FormSelectWidget,
integer: FormNumericInputWidget,
boolean: FormToggleWidget,
collection: FormCollectionWidget,
hidden: FormHiddenWidget,
};
......
import React from "react";
import cx from "classnames";
import { formDomOnlyProps } from "metabase/lib/redux";
import NumericInput from "metabase/components/NumericInput";
const FormInputWidget = ({ placeholder, field, offset }) => (
<NumericInput
className={cx("Form-input full", { "Form-offset": offset })}
placeholder={placeholder}
{...formDomOnlyProps(field)}
/>
);
export default FormInputWidget;
import React from "react";
import Toggle from "metabase/components/Toggle";
const FormToggleWidget = ({ field }) => <Toggle {...field} />;
export default FormToggleWidget;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment