Sha256: a550aab47f386adeda3bc20f9d6bbe7788803f6294b3c8295b36fbff0896aac2
Contents?: true
Size: 875 Bytes
Versions: 18
Compression:
Stored size: 875 Bytes
Contents
import React from 'react'; import { TextInput, TextArea, FormGroup, FormSelect, FormSelectOption, } from '@patternfly/react-core'; const withFormGroup = Component => componentProps => { const { validation, ...rest } = componentProps; return ( <FormGroup label="" helperTextInvalid={validation.msg} validated={validation.key} > <Component {...rest} validated={validation.key} /> </FormGroup> ); }; export const SelectField = componentProps => { const { selectItems, ...rest } = componentProps; return ( <FormSelect className="without_select2" {...rest}> {selectItems.map(item => ( <FormSelectOption key={item.id} value={item.value} label={item.name} /> ))} </FormSelect> ); }; export const TextInputField = withFormGroup(TextInput); export const TextAreaField = withFormGroup(TextArea);
Version data entries
18 entries across 18 versions & 1 rubygems