Sha256: 08e9769830a752cf154d826e0d59ac7dc4babd32ebb90f71c07e430640077130

Contents?: true

Size: 892 Bytes

Versions: 8

Compression:

Stored size: 892 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Table } from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';
import { noop } from 'foremanReact/common/helpers';

const TableSelectionCell = ({
  id, before, after, label, checked, onChange, ...props
}) => (
  <Table.SelectionCell>
    {before}
    <Table.Checkbox
      id={id}
      label={label}
      checked={checked}
      onChange={onChange}
      {...props}
    />
    {after}
  </Table.SelectionCell>
);

TableSelectionCell.propTypes = {
  id: PropTypes.string.isRequired,
  before: PropTypes.node,
  after: PropTypes.node,
  label: PropTypes.string,
  checked: PropTypes.bool,
  onChange: PropTypes.func,
};

TableSelectionCell.defaultProps = {
  before: null,
  after: null,
  label: __('Select row'),
  checked: false,
  onChange: noop,
};

export default TableSelectionCell;

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
katello-3.13.4 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.3 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.2 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.1 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.0 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.0.rc2.1 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.0.rc2 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js
katello-3.13.0.rc1 webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js