UNPKG

@adaptabletools/adaptable

Version:

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

22 lines (21 loc) 963 B
import { jsx as _jsx } from "react/jsx-runtime"; import * as React from 'react'; import { Box } from '../Flex'; import { targetOwn } from '../twUtils'; import { cn } from '../../lib/utils'; export const baseClassName = 'ab-Input'; const Input = React.forwardRef((props, ref) => { const { disabled, className, as, ...inputProps } = props; let type = 'text'; if (inputProps && inputProps.type) { type = inputProps.type; } if (type === 'string') { type = 'text'; } return (_jsx(Box, { as: as ?? 'input', ref: ref, ...inputProps, type: type, disabled: disabled, className: cn(baseClassName, 'twa:min-h-input', 'twa:rounded-input', targetOwn.focusOutline, type ? `${baseClassName}--type-${type}` : '', disabled ? `${baseClassName}--disabled` : '', { 'twa:bg-input-background': !disabled, 'twa:bg-(--ab-cmp-input--disabled__background)': disabled, }, className) })); }); export default Input;