@talend/react-components
Version:
Set of react components.
32 lines • 1.02 kB
JavaScript
import PropTypes from 'prop-types';
import ColumnChooserRow from '../ColumnChooserRow';
import { columnsPropTypes } from '../../columnChooser.propTypes';
import { jsx as _jsx } from "react/jsx-runtime";
const ColumnChooserTable = ({
columns = [],
id,
onChangeCheckbox,
t
}) => columns.map(column => /*#__PURE__*/_jsx(ColumnChooserRow, {
children: /*#__PURE__*/_jsx(ColumnChooserRow.Checkbox, {
checked: column.visible,
id: id,
dataFeature: "column-chooser.select",
description: t('CHECKBOX_DISPLAY_COLUMN_DESCRIPTION', {
defaultValue: 'display the column {{label}}',
label: column.label
}),
label: column.label,
locked: column.locked,
onChange: onChangeCheckbox,
t: t
})
}, column.key));
ColumnChooserTable.propTypes = {
columns: columnsPropTypes,
id: PropTypes.string.isRequired,
onChangeCheckbox: PropTypes.func.isRequired,
t: PropTypes.func.isRequired
};
export default ColumnChooserTable;
//# sourceMappingURL=ColumnChooserTable.component.js.map