UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

17 lines (16 loc) 678 B
import * as React from 'react'; import { Box } from 'rebass'; import join from '../utils/join'; export const baseClassName = 'ab-Input'; const Input = React.forwardRef((props, ref) => { const { disabled, className, ...inputProps } = props; let type = 'text'; if (inputProps && inputProps.type) { type = inputProps.type; } if (type === 'string') { type = 'text'; } return (React.createElement(Box, { as: "input", ref: ref, ...inputProps, type: type, disabled: disabled, className: join(className, baseClassName, type ? `${baseClassName}--type-${type}` : '', disabled ? `${baseClassName}--disabled` : '') })); }); export default Input;