All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
assets.pt.view.components.Inputs.js Maven / Gradle / Ivy
import SecondaryText from "./SecondaryText.js";
const TextInput = props => {
return Input(Object.assign({}, props, {
type: "text"
}));
};
const TimeInput = props => {
return Input(Object.assign({}, props, {
type: "time"
}));
};
const DateInput = props => {
return Input(Object.assign({}, props, {
type: "date"
}));
};
const Select = ({
value,
label = "",
options,
onChange,
actionType
}) => {
return React.createElement("div", {
className: "inputContainer"
}, React.createElement(SecondaryText, null, label), React.createElement("select", {
className: "select",
value: value,
onChange: e => onChange({
type: actionType,
value: e.target.value
})
}, options.map((option, i) => {
return React.createElement("option", {
value: option.value,
key: i
}, option.label);
})));
};
const Input = ({
value,
label = "",
type,
actionType,
onChange
}) => {
return React.createElement("div", {
className: "inputContainer"
}, React.createElement(SecondaryText, null, label), React.createElement("input", {
className: "input",
type: type,
value: value,
onChange: e => onChange({
type: actionType,
value: e.target.value
})
}));
};
export { TextInput, TimeInput, DateInput, Select };