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

Version Path
foreman_ansible-7.1.8 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.7 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.6 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.5 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.4 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-9.0.1 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.3 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-9.0.0 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.2 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.1 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-8.0.1 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-8.0.0 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.0.4 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.1.0 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.0.3 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.0.2 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.0.1 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
foreman_ansible-7.0.0 webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js