Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Merge ff7da4f into 0ab9c67
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgrunert committed Aug 20, 2018
2 parents 0ab9c67 + ff7da4f commit 40e764f
Showing 1 changed file with 45 additions and 20 deletions.
65 changes: 45 additions & 20 deletions src/elements/Form/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,55 @@
import * as classNames from 'classnames';
import * as React from 'react';
import * as classNames from "classnames";
import * as React from "react";

import {
Bulma,
getColorModifiers, getSizeModifiers, getStateModifiers,
removeColorProps, removeSizeProps, removeStateProps,
withHelpersModifiers,
} from './../../bulma';
import { combineModifiers, getHTMLProps } from './../../helpers';
Bulma,
getColorModifiers,
getSizeModifiers,
getStateModifiers,
removeColorProps,
removeSizeProps,
removeStateProps,
withHelpersModifiers
} from "./../../bulma";
import { combineModifiers, getHTMLProps } from "./../../helpers";

export interface Input<T> extends Bulma.Color, Bulma.Size, Bulma.State,
React.HTMLProps<T> {
}
export interface InputProps<T>
extends Bulma.Color,
Bulma.Size,
Bulma.State,
React.HTMLProps<T> {}

export function Input(props: Input<HTMLElement>) {
export class Input extends React.Component<InputProps<HTMLElement>, {}> {
render() {
const className = classNames(
'input',
{
...combineModifiers(props, getColorModifiers, getSizeModifiers, getStateModifiers),
},
props.className);
"input",
{
...combineModifiers(
this.props,
getColorModifiers,
getSizeModifiers,
getStateModifiers
)
},
this.props.className
);

const HTMLProps = getHTMLProps(props, removeColorProps, removeSizeProps, removeStateProps);
const HTMLProps = getHTMLProps(
this.props,
removeColorProps,
removeSizeProps,
removeStateProps
);

return <input {...HTMLProps} className={className} type={props.type || 'text'} />;
return (
<input
{...HTMLProps}
className={className}
type={this.props.type || "text"}
/>
);
}
}

const HOC = /*@__PURE__*/withHelpersModifiers(Input);
const HOC = /*@__PURE__*/ withHelpersModifiers(Input);
export default HOC;

0 comments on commit 40e764f

Please sign in to comment.